summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorSebastian Leonhardt <sebastian.leonhardt@web.de>2016-06-25 15:25:30 +0200
committerSebastian Leonhardt <sebastian.leonhardt@web.de>2019-02-07 20:04:19 +0100
commit03e63da3165fa2ea02286a4497d2e9cf0bdc6ea6 (patch)
tree81a7a555bdf07e4bc868d00d7aaa2a32d0f1c079 /firmware/target/arm
parent60f60d9a12977cea8329b0b1c68981a2ad87b392 (diff)
downloadrockbox-03e63da3165fa2ea02286a4497d2e9cf0bdc6ea6.tar.gz
rockbox-03e63da3165fa2ea02286a4497d2e9cf0bdc6ea6.tar.bz2
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')
-rw-r--r--firmware/target/arm/samsung/yh820/backlight-yh820.c5
-rw-r--r--firmware/target/arm/samsung/yh820/lcd-yh820.c41
2 files changed, 42 insertions, 4 deletions
diff --git a/firmware/target/arm/samsung/yh820/backlight-yh820.c b/firmware/target/arm/samsung/yh820/backlight-yh820.c
index b24f8128c4..c9309eebbe 100644
--- a/firmware/target/arm/samsung/yh820/backlight-yh820.c
+++ b/firmware/target/arm/samsung/yh820/backlight-yh820.c
@@ -28,7 +28,7 @@
void backlight_hw_on(void)
{
#ifdef HAVE_LCD_SLEEP
- backlight_lcd_sleep_countdown(false); /* stop counter */
+ lcd_awake(); /* power on lcd + visible display */
#endif
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */
@@ -42,7 +42,4 @@ void backlight_hw_off(void)
#ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */
#endif
-#ifdef HAVE_LCD_SLEEP
- backlight_lcd_sleep_countdown(true); /* start countdown */
-#endif
}
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 @@
#include "lcd.h"
#include "kernel.h"
#include "system.h"
+#ifdef HAVE_LCD_SHUTDOWN
+#include "backlight-target.h" /* included for backlight_hw_off() prototype */
+#endif
/* Display status */
static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0;
@@ -235,6 +238,28 @@ void lcd_enable(bool yesno)
}
#endif
+#ifdef HAVE_LCD_SLEEP
+void lcd_sleep(void)
+{
+ if (is_lcd_enabled)
+ {
+ is_lcd_enabled = false;
+ lcd_send_command(R_STANDBY_ON);
+ }
+}
+
+void lcd_awake(void)
+{
+ if (!is_lcd_enabled)
+ {
+ is_lcd_enabled = true;
+ lcd_send_command(R_STANDBY_OFF);
+ lcd_send_command(R_DISPLAY_ON);
+ send_event(LCD_EVENT_ACTIVATION, NULL);
+ }
+}
+#endif
+
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
bool lcd_active(void)
{
@@ -242,6 +267,17 @@ bool lcd_active(void)
}
#endif
+#if defined(HAVE_LCD_SHUTDOWN)
+void lcd_shutdown(void)
+{
+ backlight_hw_off();
+#ifndef HAVE_LCD_ENABLE
+ /* already done by backlight_hw_off() */
+ lcd_send_command(R_STANDBY_ON);
+#endif
+}
+#endif
+
#ifdef HAVE_LCD_FLIP
/* turn the display upside down (call lcd_update() afterwards) */
/* Note: since the lcd is rotated, this will flip horiz instead of vert */
@@ -338,6 +374,11 @@ void lcd_update(void)
void lcd_update_rect(int x, int y, int width, int height)
{
const fb_data *addr;
+
+#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
+ if (!is_lcd_enabled)
+ return;
+#endif
if (x + width >= LCD_WIDTH)
width = LCD_WIDTH - x;