diff options
Diffstat (limited to 'firmware/target/arm/s3c2440/lcd-s3c2440.c')
-rw-r--r-- | firmware/target/arm/s3c2440/lcd-s3c2440.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/firmware/target/arm/s3c2440/lcd-s3c2440.c b/firmware/target/arm/s3c2440/lcd-s3c2440.c index 06b67c7535..1631e350f3 100644 --- a/firmware/target/arm/s3c2440/lcd-s3c2440.c +++ b/firmware/target/arm/s3c2440/lcd-s3c2440.c | |||
@@ -24,8 +24,7 @@ | |||
24 | #include "lcd.h" | 24 | #include "lcd.h" |
25 | #include "lcd-target.h" | 25 | #include "lcd-target.h" |
26 | 26 | ||
27 | extern bool lcd_active(void); | 27 | extern bool lcd_on; /* lcd-memframe.c */ |
28 | extern void lcd_set_active(bool active); | ||
29 | 28 | ||
30 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) | 29 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) |
31 | static bool lcd_powered = true; | 30 | static bool lcd_powered = true; |
@@ -242,6 +241,8 @@ void lcd_init_device(void) | |||
242 | #else | 241 | #else |
243 | LCD_CTRL_clock(true); | 242 | LCD_CTRL_clock(true); |
244 | #endif | 243 | #endif |
244 | |||
245 | lcd_on = true; | ||
245 | } | 246 | } |
246 | 247 | ||
247 | #if defined(HAVE_LCD_SLEEP) | 248 | #if defined(HAVE_LCD_SLEEP) |
@@ -262,9 +263,7 @@ void lcd_sleep(void) | |||
262 | if (lcd_powered) | 263 | if (lcd_powered) |
263 | { | 264 | { |
264 | /* "not powered" implies "disabled" */ | 265 | /* "not powered" implies "disabled" */ |
265 | if (!lcd_active()) | 266 | lcd_enable(false); |
266 | lcd_enable(false); | ||
267 | |||
268 | LCD_SPI_powerdown(); | 267 | LCD_SPI_powerdown(); |
269 | } | 268 | } |
270 | } | 269 | } |
@@ -284,7 +283,7 @@ static void LCD_SPI_powerup(void) | |||
284 | 283 | ||
285 | void lcd_enable(bool state) | 284 | void lcd_enable(bool state) |
286 | { | 285 | { |
287 | if (state == lcd_active()) | 286 | if (state == lcd_on) |
288 | return; | 287 | return; |
289 | 288 | ||
290 | if(state) | 289 | if(state) |
@@ -298,20 +297,21 @@ void lcd_enable(bool state) | |||
298 | sleep(HZ/5); | 297 | sleep(HZ/5); |
299 | } | 298 | } |
300 | 299 | ||
301 | lcd_set_active(true); | 300 | lcd_on = true; |
302 | lcd_update(); | 301 | lcd_update(); |
303 | send_event(LCD_EVENT_ACTIVATION, NULL); | 302 | send_event(LCD_EVENT_ACTIVATION, NULL); |
304 | } | 303 | } |
305 | else | 304 | else |
306 | { | 305 | { |
307 | lcd_set_active(false); | 306 | lcd_on = false; |
308 | } | 307 | } |
309 | } | 308 | } |
310 | #endif | 309 | #endif |
311 | 310 | ||
312 | #ifdef GIGABEAT_F | 311 | #ifdef GIGABEAT_F |
313 | void lcd_set_flip(bool yesno) { | 312 | void lcd_set_flip(bool yesno) |
314 | if (!lcd_active()) | 313 | { |
314 | if (!lcd_on) | ||
315 | return; | 315 | return; |
316 | 316 | ||
317 | LCD_SPI_start(); | 317 | LCD_SPI_start(); |
@@ -331,8 +331,9 @@ int lcd_default_contrast(void) | |||
331 | return DEFAULT_CONTRAST_SETTING; | 331 | return DEFAULT_CONTRAST_SETTING; |
332 | } | 332 | } |
333 | 333 | ||
334 | void lcd_set_contrast(int val) { | 334 | void lcd_set_contrast(int val) |
335 | if (!lcd_active()) | 335 | { |
336 | if (!lcd_on) | ||
336 | return; | 337 | return; |
337 | 338 | ||
338 | LCD_SPI_start(); | 339 | LCD_SPI_start(); |
@@ -340,8 +341,9 @@ void lcd_set_contrast(int val) { | |||
340 | LCD_SPI_stop(); | 341 | LCD_SPI_stop(); |
341 | } | 342 | } |
342 | 343 | ||
343 | void lcd_set_invert_display(bool yesno) { | 344 | void lcd_set_invert_display(bool yesno) |
344 | if (!lcd_active()) | 345 | { |
346 | if (!lcd_on) | ||
345 | return; | 347 | return; |
346 | 348 | ||
347 | LCD_SPI_start(); | 349 | LCD_SPI_start(); |