summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Dziok <b0hoon@o2.pl>2014-01-13 23:50:40 +0100
committerSzymon Dziok <b0hoon@o2.pl>2014-01-13 23:50:40 +0100
commit518d9ecb35708d0995556b03466b79459d974ade (patch)
treecb3529f06777a6f9d8182a176f3998f10a060afc
parentb25cd9792fe3f0f2299560412111607da3baea18 (diff)
downloadrockbox-518d9ec.tar.gz
rockbox-518d9ec.tar.bz2
rockbox-518d9ec.zip
HDD1630: implement lcd_enable (display on/off).
Change-Id: I8b72a9c333d8a9dbcb62c366a9af298f1dd9b2f7
-rw-r--r--firmware/export/config/gogearhdd1630.h2
-rw-r--r--firmware/target/arm/philips/hdd1630/backlight-hdd1630.c9
-rw-r--r--firmware/target/arm/philips/hdd1630/lcd-hdd1630.c40
3 files changed, 50 insertions, 1 deletions
diff --git a/firmware/export/config/gogearhdd1630.h b/firmware/export/config/gogearhdd1630.h
index 6379c26801..9abf90acb9 100644
--- a/firmware/export/config/gogearhdd1630.h
+++ b/firmware/export/config/gogearhdd1630.h
@@ -56,7 +56,7 @@
#ifndef BOOTLOADER
/* Define this if your LCD can be enabled/disabled */
-/* #define HAVE_LCD_ENABLE */
+#define HAVE_LCD_ENABLE
/* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE
* should be defined as well.
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 @@
#include "backlight-target.h"
#include "system.h"
#include "backlight.h"
+#include "lcd.h"
#include "synaptics-mep.h"
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
@@ -36,6 +37,10 @@ void _backlight_set_brightness(int brightness)
void _backlight_on(void)
{
+#ifdef HAVE_LCD_ENABLE
+ lcd_enable(true);
+#endif
+
GPO32_ENABLE |= 0x400;
GPO32_VAL |= 0x400;
}
@@ -44,6 +49,10 @@ void _backlight_off(void)
{
GPO32_ENABLE |= 0x400;
GPO32_VAL &=~0x400;
+
+#ifdef HAVE_LCD_ENABLE
+ lcd_enable(false);
+#endif
}
#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 @@
#define RDEV 0xd4
#define RDRR 0xd5
+/* Whether the lcd is currently enabled or not */
+static bool lcd_enabled;
+
/* Display status */
static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0;
static unsigned mad_ctrl = 0;
@@ -239,7 +242,44 @@ void lcd_init_device(void)
lcd_send_cmd(DISPON);
#endif
+ lcd_enabled = true;
+}
+
+#ifdef HAVE_LCD_ENABLE
+/* enable / disable lcd */
+void lcd_enable(bool on)
+{
+ if (on == lcd_enabled)
+ return;
+
+ if (on) /* lcd_display_on() */
+ {
+ /* from the OF */
+ lcd_send_cmd(SLPOUT);
+ sleep(HZ/5); /* 200ms */
+
+ /* Probably out of sync and we don't wanna pepper the code with
+ lcd_update() calls for this. */
+ lcd_update();
+ send_event(LCD_EVENT_ACTIVATION, NULL);
+
+ lcd_enabled = true;
+ }
+ else /* lcd_display_off() */
+ {
+ /* from the OF */
+ lcd_send_cmd(SLPIN);
+
+ lcd_enabled = false;
+ }
+}
+
+
+bool lcd_active(void)
+{
+ return lcd_enabled;
}
+#endif /* HAVE_LCD_ENABLE */
/*** hardware configuration ***/
int lcd_default_contrast(void)