diff options
author | Mirko Vogt <mirko@openwrt.org> | 2008-12-12 11:58:53 +0000 |
---|---|---|
committer | Mirko Vogt <mirko@openwrt.org> | 2008-12-12 11:58:53 +0000 |
commit | 614683faf8029100802db06a825648d0b6490285 (patch) | |
tree | 7401b135dc7ce24ff0175e67e0f2ce7f96296ff0 /target/linux/s3c24xx/patches-2.6.24/1148-fix-backlight-disable-on-zero-intensity.patch.patch | |
parent | 4a018d2445c5f249179ff82c8fffb0e3b717f738 (diff) | |
download | master-31e0f0ae-614683faf8029100802db06a825648d0b6490285.tar.gz master-31e0f0ae-614683faf8029100802db06a825648d0b6490285.tar.bz2 master-31e0f0ae-614683faf8029100802db06a825648d0b6490285.zip |
changed Makefile and profiles, added patches for kernel 2.6.24 (stable-branch of Openmoko)
SVN-Revision: 13613
Diffstat (limited to 'target/linux/s3c24xx/patches-2.6.24/1148-fix-backlight-disable-on-zero-intensity.patch.patch')
-rw-r--r-- | target/linux/s3c24xx/patches-2.6.24/1148-fix-backlight-disable-on-zero-intensity.patch.patch | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/target/linux/s3c24xx/patches-2.6.24/1148-fix-backlight-disable-on-zero-intensity.patch.patch b/target/linux/s3c24xx/patches-2.6.24/1148-fix-backlight-disable-on-zero-intensity.patch.patch new file mode 100644 index 0000000000..d3e1a5136d --- /dev/null +++ b/target/linux/s3c24xx/patches-2.6.24/1148-fix-backlight-disable-on-zero-intensity.patch.patch @@ -0,0 +1,81 @@ +From c9d44c8b43d29dd500c1dd711e490bdcd47f2830 Mon Sep 17 00:00:00 2001 +From: Andy Green <andy@openmoko.com> +Date: Tue, 13 May 2008 18:53:40 +0100 +Subject: [PATCH] fix-backlight-disable-on-zero-intensity.patch + +It's never right to put 0 intensity into LEDOUT according to datasheet +But having a floor at intensity 2 means backlight isn't properly off +when "dimmed". So change to intensity 0 --> disable backlight. + +Signed-off-by: Andy Green <andy@openmoko.com> +--- + drivers/i2c/chips/pcf50633.c | 34 +++++++++++++++++++++------------- + 1 files changed, 21 insertions(+), 13 deletions(-) + +diff --git a/drivers/i2c/chips/pcf50633.c b/drivers/i2c/chips/pcf50633.c +index dc4ea0a..205f4e3 100644 +--- a/drivers/i2c/chips/pcf50633.c ++++ b/drivers/i2c/chips/pcf50633.c +@@ -1458,6 +1458,9 @@ static int pcf50633bl_get_intensity(struct backlight_device *bd) + struct pcf50633_data *pcf = bl_get_data(bd); + int intensity = reg_read(pcf, PCF50633_REG_LEDOUT); + ++ if (!(reg_read(pcf, PCF50633_REG_LEDOUT) & 1)) ++ intensity = 0; ++ + return intensity & 0x3f; + } + +@@ -1466,31 +1469,36 @@ static int pcf50633bl_set_intensity(struct backlight_device *bd) + struct pcf50633_data *pcf = bl_get_data(bd); + int intensity = bd->props.brightness; + int old_intensity = reg_read(pcf, PCF50633_REG_LEDOUT); +- u_int8_t ledena = 2; + int ret; + +- if (bd->props.power != FB_BLANK_UNBLANK) +- intensity = 0; +- if (bd->props.fb_blank != FB_BLANK_UNBLANK) ++ if (!(reg_read(pcf, PCF50633_REG_LEDOUT) & 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) ++ /* ++ * The PCF50633 cannot handle LEDOUT = 0 (datasheet p60) + * if seen, you have to re-enable the LED unit ++ * we treat intensity 0 as disable + */ + +- if (intensity != 0 && old_intensity == 0) { +- ledena = reg_read(pcf, PCF50633_REG_LEDENA); +- reg_write(pcf, PCF50633_REG_LEDENA, 0x00); ++ if (intensity && !old_intensity) { ++ ret = reg_set_bit_mask(pcf, PCF50633_REG_LEDENA, 0x01, 0x00); ++ if (ret) ++ return ret; + } + + if (!intensity) /* illegal to set LEDOUT to 0 */ +- ret = reg_set_bit_mask(pcf, PCF50633_REG_LEDOUT, 0x3f, 2); +- else ++ ret = reg_set_bit_mask(pcf, PCF50633_REG_LEDENA, 0x01, 0x00); ++ else { + ret = reg_set_bit_mask(pcf, PCF50633_REG_LEDOUT, 0x3f, + intensity); +- +- if (intensity != 0 && old_intensity == 0) +- reg_write(pcf, PCF50633_REG_LEDENA, ledena); ++ if (ret) ++ return ret; ++ ret = reg_set_bit_mask(pcf, PCF50633_REG_LEDENA, 0x01, 0x01); ++ } + + return ret; + } +-- +1.5.6.5 + |