diff options
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c index 1d27716d2a..f0a2764851 100644 --- a/firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c +++ b/firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c | |||
@@ -29,10 +29,9 @@ | |||
29 | #include "spi-imx31.h" | 29 | #include "spi-imx31.h" |
30 | #include "mc13783.h" | 30 | #include "mc13783.h" |
31 | 31 | ||
32 | extern void lcd_set_active(bool active); | ||
33 | |||
34 | #define MAIN_LCD_IDMAC_CHANNEL 14 | 32 | #define MAIN_LCD_IDMAC_CHANNEL 14 |
35 | 33 | ||
34 | extern bool lcd_on; /* lcd-memframe.c */ | ||
36 | static bool lcd_powered = true; | 35 | static bool lcd_powered = true; |
37 | 36 | ||
38 | /* Settings shadow regs */ | 37 | /* Settings shadow regs */ |
@@ -171,6 +170,8 @@ void INIT_ATTR lcd_init_device(void) | |||
171 | IPU_IPU_IMA_ADDR = ((0x1 << 16) | (MAIN_LCD_IDMAC_CHANNEL << 4)) + (1 << 3); | 170 | IPU_IPU_IMA_ADDR = ((0x1 << 16) | (MAIN_LCD_IDMAC_CHANNEL << 4)) + (1 << 3); |
172 | IPU_IPU_IMA_DATA = FRAME_PHYS_ADDR; | 171 | IPU_IPU_IMA_DATA = FRAME_PHYS_ADDR; |
173 | 172 | ||
173 | lcd_on = true; | ||
174 | |||
174 | lcd_enable_interface(true); | 175 | lcd_enable_interface(true); |
175 | lcd_sync_settings(); | 176 | lcd_sync_settings(); |
176 | } | 177 | } |
@@ -188,7 +189,7 @@ void lcd_sleep(void) | |||
188 | 189 | ||
189 | void lcd_enable(bool state) | 190 | void lcd_enable(bool state) |
190 | { | 191 | { |
191 | if (state == lcd_active()) | 192 | if (state == lcd_on) |
192 | return; | 193 | return; |
193 | 194 | ||
194 | if (state) | 195 | if (state) |
@@ -198,13 +199,13 @@ void lcd_enable(bool state) | |||
198 | IPU_IDMAC_CHA_EN |= 1ul << MAIN_LCD_IDMAC_CHANNEL; | 199 | IPU_IDMAC_CHA_EN |= 1ul << MAIN_LCD_IDMAC_CHANNEL; |
199 | lcd_sync_settings(); | 200 | lcd_sync_settings(); |
200 | sleep(HZ/50); | 201 | sleep(HZ/50); |
201 | lcd_set_active(true); | 202 | lcd_on = true; |
202 | lcd_update(); | 203 | lcd_update(); |
203 | send_event(LCD_EVENT_ACTIVATION, NULL); | 204 | send_event(LCD_EVENT_ACTIVATION, NULL); |
204 | } | 205 | } |
205 | else | 206 | else |
206 | { | 207 | { |
207 | lcd_set_active(false); | 208 | lcd_on = false; |
208 | } | 209 | } |
209 | } | 210 | } |
210 | 211 | ||
@@ -213,7 +214,7 @@ void lcd_set_contrast(int val) | |||
213 | { | 214 | { |
214 | reg0x0b = val & 0x3f; | 215 | reg0x0b = val & 0x3f; |
215 | 216 | ||
216 | if (!lcd_active()) | 217 | if (!lcd_on) |
217 | return; | 218 | return; |
218 | 219 | ||
219 | lcd_write_reg(0x0b, reg0x0b); | 220 | lcd_write_reg(0x0b, reg0x0b); |
@@ -230,7 +231,7 @@ void lcd_set_invert_display(bool yesno) | |||
230 | { | 231 | { |
231 | reg0x27 = yesno ? 0x10 : 0x00; | 232 | reg0x27 = yesno ? 0x10 : 0x00; |
232 | 233 | ||
233 | if (!lcd_active()) | 234 | if (!lcd_on) |
234 | return; | 235 | return; |
235 | 236 | ||
236 | lcd_write_reg(0x27, reg0x27); | 237 | lcd_write_reg(0x27, reg0x27); |
@@ -242,7 +243,7 @@ void lcd_set_flip(bool yesno) | |||
242 | { | 243 | { |
243 | reg0x06 = yesno ? 0x02 : 0x04; | 244 | reg0x06 = yesno ? 0x02 : 0x04; |
244 | 245 | ||
245 | if (!lcd_active()) | 246 | if (!lcd_on) |
246 | return; | 247 | return; |
247 | 248 | ||
248 | lcd_write_reg(0x06, reg0x06); | 249 | lcd_write_reg(0x06, reg0x06); |