diff options
Diffstat (limited to 'firmware/target/arm/philips/hdd1630/lcd-hdd1630.c')
-rw-r--r-- | firmware/target/arm/philips/hdd1630/lcd-hdd1630.c | 40 |
1 files changed, 40 insertions, 0 deletions
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) |