diff options
Diffstat (limited to 'firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c')
-rw-r--r-- | firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c index a99260f105..3fd63de623 100644 --- a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c +++ b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c | |||
@@ -73,7 +73,7 @@ static void setup_lcd_pins(bool use_lcdif) | |||
73 | imx233_pinctrl_acquire(1, 21, "lcd cs"); | 73 | imx233_pinctrl_acquire(1, 21, "lcd cs"); |
74 | imx233_pinctrl_acquire(1, 23, "lcd enable"); | 74 | imx233_pinctrl_acquire(1, 23, "lcd enable"); |
75 | imx233_pinctrl_acquire(1, 25, "lcd vsync"); | 75 | imx233_pinctrl_acquire(1, 25, "lcd vsync"); |
76 | imx233_pinctrl_acquire_mask(1, 0x3ffff, "lcd data"); | 76 | //imx233_pinctrl_acquire_mask(1, 0x3ffff, "lcd data"); |
77 | if(use_lcdif) | 77 | if(use_lcdif) |
78 | { | 78 | { |
79 | imx233_pinctrl_set_function(1, 25, PINCTRL_FUNCTION_GPIO); /* lcd_vsync */ | 79 | imx233_pinctrl_set_function(1, 25, PINCTRL_FUNCTION_GPIO); /* lcd_vsync */ |
@@ -113,10 +113,10 @@ static void setup_lcd_pins_i80(bool i80) | |||
113 | imx233_pinctrl_set_function(1, 21, PINCTRL_FUNCTION_GPIO); /* lcd_cs */ | 113 | imx233_pinctrl_set_function(1, 21, PINCTRL_FUNCTION_GPIO); /* lcd_cs */ |
114 | imx233_pinctrl_set_function(1, 23, PINCTRL_FUNCTION_GPIO); /* lcd_enable */ | 114 | imx233_pinctrl_set_function(1, 23, PINCTRL_FUNCTION_GPIO); /* lcd_enable */ |
115 | /* lcd_{rs,wr,cs,enable} */ | 115 | /* lcd_{rs,wr,cs,enable} */ |
116 | imx233_pinctrl_enable_gpio_mask(1, (1 << 19) | (1 << 20) | (1 << 21) | (1 << 23), true); | 116 | HW_PINCTRL_DOEn_SET(1) = (1 << 19) | (1 << 20) | (1 << 21) | (1 << 23); |
117 | imx233_pinctrl_set_gpio_mask(1, (1 << 19) | (1 << 20) | (1 << 21) | (1 << 23), true); | 117 | HW_PINCTRL_DOUTn_SET(1) = (1 << 19) | (1 << 20) | (1 << 21) | (1 << 23); |
118 | 118 | ||
119 | imx233_pinctrl_enable_gpio_mask(1, 0x3ffff, false); /* lcd_d{0-17} */ | 119 | HW_PINCTRL_DOEn_CLR(1) = 0x3ffff; /* lcd_d{0-17} */ |
120 | HW_PINCTRL_MUXSELn_SET(2) = 0xffffffff; /* lcd_d{0-15} as GPIO */ | 120 | HW_PINCTRL_MUXSELn_SET(2) = 0xffffffff; /* lcd_d{0-15} as GPIO */ |
121 | imx233_pinctrl_set_function(1, 16, PINCTRL_FUNCTION_GPIO); /* lcd_d16 */ | 121 | imx233_pinctrl_set_function(1, 16, PINCTRL_FUNCTION_GPIO); /* lcd_d16 */ |
122 | imx233_pinctrl_set_function(1, 17, PINCTRL_FUNCTION_GPIO); /* lcd_d17 */ | 122 | imx233_pinctrl_set_function(1, 17, PINCTRL_FUNCTION_GPIO); /* lcd_d17 */ |
@@ -125,7 +125,8 @@ static void setup_lcd_pins_i80(bool i80) | |||
125 | } | 125 | } |
126 | else | 126 | else |
127 | { | 127 | { |
128 | imx233_pinctrl_set_gpio_mask(1, (1 << 19) | (1 << 20) | (1 << 21) | (1 << 23), true); | 128 | HW_PINCTRL_DOUTn_SET(1) = (1 << 19) | (1 << 20) | (1 << 21) | (1 << 23); |
129 | |||
129 | imx233_pinctrl_set_drive(1, 19, PINCTRL_DRIVE_4mA); /* lcd_rs */ | 130 | imx233_pinctrl_set_drive(1, 19, PINCTRL_DRIVE_4mA); /* lcd_rs */ |
130 | imx233_pinctrl_set_drive(1, 20, PINCTRL_DRIVE_4mA); /* lcd_wr */ | 131 | imx233_pinctrl_set_drive(1, 20, PINCTRL_DRIVE_4mA); /* lcd_wr */ |
131 | imx233_pinctrl_set_drive(1, 21, PINCTRL_DRIVE_4mA); /* lcd_cs */ | 132 | imx233_pinctrl_set_drive(1, 21, PINCTRL_DRIVE_4mA); /* lcd_cs */ |
@@ -133,7 +134,7 @@ static void setup_lcd_pins_i80(bool i80) | |||
133 | imx233_pinctrl_set_function(1, 19, PINCTRL_FUNCTION_MAIN); /* lcd_rs */ | 134 | imx233_pinctrl_set_function(1, 19, PINCTRL_FUNCTION_MAIN); /* lcd_rs */ |
134 | imx233_pinctrl_set_function(1, 20, PINCTRL_FUNCTION_MAIN); /* lcd_wr */ | 135 | imx233_pinctrl_set_function(1, 20, PINCTRL_FUNCTION_MAIN); /* lcd_wr */ |
135 | imx233_pinctrl_set_function(1, 21, PINCTRL_FUNCTION_MAIN); /* lcd_cs */ | 136 | imx233_pinctrl_set_function(1, 21, PINCTRL_FUNCTION_MAIN); /* lcd_cs */ |
136 | imx233_pinctrl_enable_gpio_mask(1, 0x3ffff, false); /* lcd_d{0-17} */ | 137 | HW_PINCTRL_DOEn_CLR(1) = 0x3ffff; /* lcd_d{0-17} */ |
137 | HW_PINCTRL_MUXSELn_CLR(2) = 0xffffffff; /* lcd_d{0-15} as lcd_d{0-15} */ | 138 | HW_PINCTRL_MUXSELn_CLR(2) = 0xffffffff; /* lcd_d{0-15} as lcd_d{0-15} */ |
138 | imx233_pinctrl_set_function(1, 16, PINCTRL_FUNCTION_MAIN); /* lcd_d16 */ | 139 | imx233_pinctrl_set_function(1, 16, PINCTRL_FUNCTION_MAIN); /* lcd_d16 */ |
139 | imx233_pinctrl_set_function(1, 17, PINCTRL_FUNCTION_MAIN); /* lcd_d17 */ | 140 | imx233_pinctrl_set_function(1, 17, PINCTRL_FUNCTION_MAIN); /* lcd_d17 */ |
@@ -182,7 +183,7 @@ static uint32_t i80_read_register(uint32_t data_out) | |||
182 | imx233_pinctrl_set_gpio(1, 19, true); /* lcd_rs */ | 183 | imx233_pinctrl_set_gpio(1, 19, true); /* lcd_rs */ |
183 | imx233_pinctrl_set_gpio(1, 23, true); /* lcd_enable */ | 184 | imx233_pinctrl_set_gpio(1, 23, true); /* lcd_enable */ |
184 | imx233_pinctrl_set_gpio(1, 20, true); /* lcd_wr */ | 185 | imx233_pinctrl_set_gpio(1, 20, true); /* lcd_wr */ |
185 | imx233_pinctrl_enable_gpio_mask(1, 0x3ffff, true); /* lcd_d{0-17} */ | 186 | HW_PINCTRL_DOEn_SET(1) = 0x3ffff; /* lcd_d{0-17} */ |
186 | udelay(2); | 187 | udelay(2); |
187 | imx233_pinctrl_set_gpio(1, 19, false); /* lcd_rs */ | 188 | imx233_pinctrl_set_gpio(1, 19, false); /* lcd_rs */ |
188 | udelay(1); | 189 | udelay(1); |
@@ -190,11 +191,11 @@ static uint32_t i80_read_register(uint32_t data_out) | |||
190 | udelay(1); | 191 | udelay(1); |
191 | imx233_pinctrl_set_gpio(1, 20, false); /* lcd_wr */ | 192 | imx233_pinctrl_set_gpio(1, 20, false); /* lcd_wr */ |
192 | udelay(1); | 193 | udelay(1); |
193 | imx233_pinctrl_set_gpio_mask(1, data_out & 0x3ffff, true); /* lcd_d{0-17} */ | 194 | HW_PINCTRL_DOUTn_SET(1) = data_out & 0x3ffff; /* lcd_d{0-17} */ |
194 | udelay(1); | 195 | udelay(1); |
195 | imx233_pinctrl_set_gpio(1, 20, true); /* lcd_wr */ | 196 | imx233_pinctrl_set_gpio(1, 20, true); /* lcd_wr */ |
196 | udelay(3); | 197 | udelay(3); |
197 | imx233_pinctrl_enable_gpio_mask(1, 0x3ffff, false); /* lcd_d{0-17} */ | 198 | HW_PINCTRL_DOUTn_CLR(1) = 0x3ffff; /* lcd_d{0-17} */ |
198 | udelay(2); | 199 | udelay(2); |
199 | imx233_pinctrl_set_gpio(1, 23, false); /* lcd_enable */ | 200 | imx233_pinctrl_set_gpio(1, 23, false); /* lcd_enable */ |
200 | udelay(1); | 201 | udelay(1); |
@@ -204,7 +205,7 @@ static uint32_t i80_read_register(uint32_t data_out) | |||
204 | udelay(3); | 205 | udelay(3); |
205 | imx233_pinctrl_set_gpio(1, 23, false); /* lcd_enable */ | 206 | imx233_pinctrl_set_gpio(1, 23, false); /* lcd_enable */ |
206 | udelay(2); | 207 | udelay(2); |
207 | uint32_t data_in = imx233_pinctrl_get_gpio_mask(1, 0x3ffff); /* lcd_d{0-17} */ | 208 | uint32_t data_in = HW_PINCTRL_DINn(1) & 0x3ffff; /* lcd_d{0-17} */ |
208 | udelay(1); | 209 | udelay(1); |
209 | imx233_pinctrl_set_gpio(1, 23, true); /* lcd_enable */ | 210 | imx233_pinctrl_set_gpio(1, 23, true); /* lcd_enable */ |
210 | udelay(1); | 211 | udelay(1); |