diff options
author | Sebastian Leonhardt <sebastian.leonhardt@web.de> | 2016-06-25 15:25:30 +0200 |
---|---|---|
committer | Sebastian Leonhardt <sebastian.leonhardt@web.de> | 2019-02-07 20:04:19 +0100 |
commit | 03e63da3165fa2ea02286a4497d2e9cf0bdc6ea6 (patch) | |
tree | 81a7a555bdf07e4bc868d00d7aaa2a32d0f1c079 /firmware/target/arm/samsung/yh820/lcd-yh820.c | |
parent | 60f60d9a12977cea8329b0b1c68981a2ad87b392 (diff) | |
download | rockbox-03e63da3165fa2ea02286a4497d2e9cf0bdc6ea6.tar.gz rockbox-03e63da3165fa2ea02286a4497d2e9cf0bdc6ea6.zip |
YH820: implement LCD sleep
use sleep setting to keep transflective LCD active without backlight
Change-Id: Iccd97e956d5e4a2a22abc90d15e9123782126ecb
Diffstat (limited to 'firmware/target/arm/samsung/yh820/lcd-yh820.c')
-rw-r--r-- | firmware/target/arm/samsung/yh820/lcd-yh820.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/firmware/target/arm/samsung/yh820/lcd-yh820.c b/firmware/target/arm/samsung/yh820/lcd-yh820.c index d6bb2a196b..f4b55ab917 100644 --- a/firmware/target/arm/samsung/yh820/lcd-yh820.c +++ b/firmware/target/arm/samsung/yh820/lcd-yh820.c | |||
@@ -25,6 +25,9 @@ | |||
25 | #include "lcd.h" | 25 | #include "lcd.h" |
26 | #include "kernel.h" | 26 | #include "kernel.h" |
27 | #include "system.h" | 27 | #include "system.h" |
28 | #ifdef HAVE_LCD_SHUTDOWN | ||
29 | #include "backlight-target.h" /* included for backlight_hw_off() prototype */ | ||
30 | #endif | ||
28 | 31 | ||
29 | /* Display status */ | 32 | /* Display status */ |
30 | static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; | 33 | static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; |
@@ -235,6 +238,28 @@ void lcd_enable(bool yesno) | |||
235 | } | 238 | } |
236 | #endif | 239 | #endif |
237 | 240 | ||
241 | #ifdef HAVE_LCD_SLEEP | ||
242 | void lcd_sleep(void) | ||
243 | { | ||
244 | if (is_lcd_enabled) | ||
245 | { | ||
246 | is_lcd_enabled = false; | ||
247 | lcd_send_command(R_STANDBY_ON); | ||
248 | } | ||
249 | } | ||
250 | |||
251 | void lcd_awake(void) | ||
252 | { | ||
253 | if (!is_lcd_enabled) | ||
254 | { | ||
255 | is_lcd_enabled = true; | ||
256 | lcd_send_command(R_STANDBY_OFF); | ||
257 | lcd_send_command(R_DISPLAY_ON); | ||
258 | send_event(LCD_EVENT_ACTIVATION, NULL); | ||
259 | } | ||
260 | } | ||
261 | #endif | ||
262 | |||
238 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) | 263 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) |
239 | bool lcd_active(void) | 264 | bool lcd_active(void) |
240 | { | 265 | { |
@@ -242,6 +267,17 @@ bool lcd_active(void) | |||
242 | } | 267 | } |
243 | #endif | 268 | #endif |
244 | 269 | ||
270 | #if defined(HAVE_LCD_SHUTDOWN) | ||
271 | void lcd_shutdown(void) | ||
272 | { | ||
273 | backlight_hw_off(); | ||
274 | #ifndef HAVE_LCD_ENABLE | ||
275 | /* already done by backlight_hw_off() */ | ||
276 | lcd_send_command(R_STANDBY_ON); | ||
277 | #endif | ||
278 | } | ||
279 | #endif | ||
280 | |||
245 | #ifdef HAVE_LCD_FLIP | 281 | #ifdef HAVE_LCD_FLIP |
246 | /* turn the display upside down (call lcd_update() afterwards) */ | 282 | /* turn the display upside down (call lcd_update() afterwards) */ |
247 | /* Note: since the lcd is rotated, this will flip horiz instead of vert */ | 283 | /* Note: since the lcd is rotated, this will flip horiz instead of vert */ |
@@ -338,6 +374,11 @@ void lcd_update(void) | |||
338 | void lcd_update_rect(int x, int y, int width, int height) | 374 | void lcd_update_rect(int x, int y, int width, int height) |
339 | { | 375 | { |
340 | const fb_data *addr; | 376 | const fb_data *addr; |
377 | |||
378 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) | ||
379 | if (!is_lcd_enabled) | ||
380 | return; | ||
381 | #endif | ||
341 | 382 | ||
342 | if (x + width >= LCD_WIDTH) | 383 | if (x + width >= LCD_WIDTH) |
343 | width = LCD_WIDTH - x; | 384 | width = LCD_WIDTH - x; |