summaryrefslogtreecommitdiff
path: root/target/linux/s3c24xx/patches-2.6.24/1232-change-backlight-level-not-forced-up-on-resume.patch.patch
diff options
context:
space:
mode:
authormirko <mirko@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-12-12 11:58:53 +0000
committermirko <mirko@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-12-12 11:58:53 +0000
commitfc54b9bf158eea9cae647ce2c58f7d9989af173a (patch)
tree54644c1229434d7ee13c5872bda4129e34337fc0 /target/linux/s3c24xx/patches-2.6.24/1232-change-backlight-level-not-forced-up-on-resume.patch.patch
parentd9f49b62b28ebd245587854efa484974d90debbf (diff)
changed Makefile and profiles, added patches for kernel 2.6.24
(stable-branch of Openmoko) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13613 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/s3c24xx/patches-2.6.24/1232-change-backlight-level-not-forced-up-on-resume.patch.patch')
-rw-r--r--target/linux/s3c24xx/patches-2.6.24/1232-change-backlight-level-not-forced-up-on-resume.patch.patch86
1 files changed, 86 insertions, 0 deletions
diff --git a/target/linux/s3c24xx/patches-2.6.24/1232-change-backlight-level-not-forced-up-on-resume.patch.patch b/target/linux/s3c24xx/patches-2.6.24/1232-change-backlight-level-not-forced-up-on-resume.patch.patch
new file mode 100644
index 0000000000..ea05e90794
--- /dev/null
+++ b/target/linux/s3c24xx/patches-2.6.24/1232-change-backlight-level-not-forced-up-on-resume.patch.patch
@@ -0,0 +1,86 @@
+From db07519c1dfe916bcf9644bfdc4d7c03707a979e Mon Sep 17 00:00:00 2001
+From: Andy Green <andy@openmoko.com>
+Date: Tue, 15 Jul 2008 09:04:05 +0100
+Subject: [PATCH] change-backlight-level-not-forced-up-on-resume.patch
+
+We at least always enabled backlight on resume, this patch
+changes us to set backlight back to last requested backlight
+brightness level on resume. Note it means that you can
+resume with screen blanked, but it should come back if that
+happened with touchscreen action as usual.
+
+/sys/class/backlight/pcf50633-bl/actual_brightness
+and
+/sys/class/backlight/pcf50633-bl/brightness
+
+seem to agree after resume when reportedly they didn't before.
+
+Signed-off-by: Andy Green <andy@openmoko.com>
+---
+ drivers/i2c/chips/pcf50633.c | 29 +++++++++++++++--------------
+ 1 files changed, 15 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/i2c/chips/pcf50633.c b/drivers/i2c/chips/pcf50633.c
+index 9f98ba1..f461378 100644
+--- a/drivers/i2c/chips/pcf50633.c
++++ b/drivers/i2c/chips/pcf50633.c
+@@ -1878,22 +1878,14 @@ static int pcf50633bl_get_intensity(struct backlight_device *bd)
+ return intensity & 0x3f;
+ }
+
+-static int pcf50633bl_set_intensity(struct backlight_device *bd)
++static int __pcf50633bl_set_intensity(struct pcf50633_data *pcf, int intensity)
+ {
+- struct pcf50633_data *pcf = bl_get_data(bd);
+- int intensity = bd->props.brightness;
+ int old_intensity = reg_read(pcf, PCF50633_REG_LEDOUT);
+ int ret;
+
+- dev_info(&pcf->client.dev, "pcf50633bl_set_intensity\n");
+-
+ if (!(reg_read(pcf, PCF50633_REG_LEDENA) & 1))
+ old_intensity = 0;
+
+- if ((bd->props.power != FB_BLANK_UNBLANK) ||
+- (bd->props.fb_blank != FB_BLANK_UNBLANK))
+- intensity = 0;
+-
+ /*
+ * The PCF50633 cannot handle LEDOUT = 0 (datasheet p60)
+ * if seen, you have to re-enable the LED unit
+@@ -1919,6 +1911,18 @@ static int pcf50633bl_set_intensity(struct backlight_device *bd)
+ return ret;
+ }
+
++static int pcf50633bl_set_intensity(struct backlight_device *bd)
++{
++ struct pcf50633_data *pcf = bl_get_data(bd);
++ int intensity = bd->props.brightness;
++
++ if ((bd->props.power != FB_BLANK_UNBLANK) ||
++ (bd->props.fb_blank != FB_BLANK_UNBLANK))
++ intensity = 0;
++
++ return __pcf50633bl_set_intensity(pcf, intensity);
++}
++
+ static struct backlight_ops pcf50633bl_ops = {
+ .get_brightness = pcf50633bl_get_intensity,
+ .update_status = pcf50633bl_set_intensity,
+@@ -2508,11 +2512,8 @@ void pcf50633_backlight_resume(struct pcf50633_data *pcf)
+ /* platform defines resume ramp speed */
+ reg_write(pcf, PCF50633_REG_LEDDIM,
+ pcf->pdata->resume_backlight_ramp_speed);
+- reg_write(pcf, PCF50633_REG_LEDOUT, pcf->standby_regs.misc[
+- PCF50633_REG_LEDOUT - PCF50633_REG_AUTOOUT]);
+- /* we force the backlight on in fact */
+- reg_write(pcf, PCF50633_REG_LEDENA, pcf->standby_regs.misc[
+- PCF50633_REG_LEDENA - PCF50633_REG_AUTOOUT] | 1);
++
++ __pcf50633bl_set_intensity(pcf, pcf->backlight->props.brightness);
+ }
+ EXPORT_SYMBOL_GPL(pcf50633_backlight_resume);
+
+--
+1.5.6.5
+