diff options
Diffstat (limited to 'firmware/target/arm/philips')
-rw-r--r-- | firmware/target/arm/philips/hdd1630/backlight-hdd1630.c | 9 | ||||
-rw-r--r-- | firmware/target/arm/philips/hdd1630/lcd-hdd1630.c | 40 |
2 files changed, 49 insertions, 0 deletions
diff --git a/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c b/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c index 00f38bb0f4..95a9ad8b86 100644 --- a/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c +++ b/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "backlight-target.h" | 22 | #include "backlight-target.h" |
23 | #include "system.h" | 23 | #include "system.h" |
24 | #include "backlight.h" | 24 | #include "backlight.h" |
25 | #include "lcd.h" | ||
25 | #include "synaptics-mep.h" | 26 | #include "synaptics-mep.h" |
26 | 27 | ||
27 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS | 28 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS |
@@ -36,6 +37,10 @@ void _backlight_set_brightness(int brightness) | |||
36 | 37 | ||
37 | void _backlight_on(void) | 38 | void _backlight_on(void) |
38 | { | 39 | { |
40 | #ifdef HAVE_LCD_ENABLE | ||
41 | lcd_enable(true); | ||
42 | #endif | ||
43 | |||
39 | GPO32_ENABLE |= 0x400; | 44 | GPO32_ENABLE |= 0x400; |
40 | GPO32_VAL |= 0x400; | 45 | GPO32_VAL |= 0x400; |
41 | } | 46 | } |
@@ -44,6 +49,10 @@ void _backlight_off(void) | |||
44 | { | 49 | { |
45 | GPO32_ENABLE |= 0x400; | 50 | GPO32_ENABLE |= 0x400; |
46 | GPO32_VAL &=~0x400; | 51 | GPO32_VAL &=~0x400; |
52 | |||
53 | #ifdef HAVE_LCD_ENABLE | ||
54 | lcd_enable(false); | ||
55 | #endif | ||
47 | } | 56 | } |
48 | 57 | ||
49 | #ifdef HAVE_BUTTON_LIGHT | 58 | #ifdef HAVE_BUTTON_LIGHT |
diff --git a/firmware/target/arm/philips/hdd1630/lcd-hdd1630.c b/firmware/target/arm/philips/hdd1630/lcd-hdd1630.c index 28bef09463..c26c0bc963 100644 --- a/firmware/target/arm/philips/hdd1630/lcd-hdd1630.c +++ b/firmware/target/arm/philips/hdd1630/lcd-hdd1630.c | |||
@@ -77,6 +77,9 @@ | |||
77 | #define RDEV 0xd4 | 77 | #define RDEV 0xd4 |
78 | #define RDRR 0xd5 | 78 | #define RDRR 0xd5 |
79 | 79 | ||
80 | /* Whether the lcd is currently enabled or not */ | ||
81 | static bool lcd_enabled; | ||
82 | |||
80 | /* Display status */ | 83 | /* Display status */ |
81 | static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; | 84 | static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; |
82 | static unsigned mad_ctrl = 0; | 85 | static unsigned mad_ctrl = 0; |
@@ -239,7 +242,44 @@ void lcd_init_device(void) | |||
239 | 242 | ||
240 | lcd_send_cmd(DISPON); | 243 | lcd_send_cmd(DISPON); |
241 | #endif | 244 | #endif |
245 | lcd_enabled = true; | ||
246 | } | ||
247 | |||
248 | #ifdef HAVE_LCD_ENABLE | ||
249 | /* enable / disable lcd */ | ||
250 | void lcd_enable(bool on) | ||
251 | { | ||
252 | if (on == lcd_enabled) | ||
253 | return; | ||
254 | |||
255 | if (on) /* lcd_display_on() */ | ||
256 | { | ||
257 | /* from the OF */ | ||
258 | lcd_send_cmd(SLPOUT); | ||
259 | sleep(HZ/5); /* 200ms */ | ||
260 | |||
261 | /* Probably out of sync and we don't wanna pepper the code with | ||
262 | lcd_update() calls for this. */ | ||
263 | lcd_update(); | ||
264 | send_event(LCD_EVENT_ACTIVATION, NULL); | ||
265 | |||
266 | lcd_enabled = true; | ||
267 | } | ||
268 | else /* lcd_display_off() */ | ||
269 | { | ||
270 | /* from the OF */ | ||
271 | lcd_send_cmd(SLPIN); | ||
272 | |||
273 | lcd_enabled = false; | ||
274 | } | ||
275 | } | ||
276 | |||
277 | |||
278 | bool lcd_active(void) | ||
279 | { | ||
280 | return lcd_enabled; | ||
242 | } | 281 | } |
282 | #endif /* HAVE_LCD_ENABLE */ | ||
243 | 283 | ||
244 | /*** hardware configuration ***/ | 284 | /*** hardware configuration ***/ |
245 | int lcd_default_contrast(void) | 285 | int lcd_default_contrast(void) |