diff options
author | Andy Green <andy@openmoko.com> | 2008-11-21 11:56:56 +0000 |
---|---|---|
committer | Andy Green <agreen@pads.home.warmcat.com> | 2008-11-21 11:56:56 +0000 |
commit | 3c633bc8b16ba3772217262758b8c514f3be8f93 (patch) | |
tree | 9d9991e748c726a207eab39016ca8d579fd30110 /arch | |
parent | 6572257d92c889459fc36160db300f1016694a27 (diff) |
fix-balaji-backlight-never-goes-off.patch
Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-s3c2440/mach-gta02.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c index 112f3150302..e9a32b5874b 100644 --- a/arch/arm/mach-s3c2440/mach-gta02.c +++ b/arch/arm/mach-s3c2440/mach-gta02.c @@ -1018,15 +1018,21 @@ static struct s3c2410_ts_mach_info gta02_ts_cfg = { }, }; -/* Backlight control */ static void gta02_bl_set_intensity(int intensity) { struct pcf50633 *pcf = gta02_pcf_pdata.pcf; - int old_intensity = pcf50633_reg_read(pcf, PCF50633_REG_LEDOUT); int ret; + intensity >>= 2; + + if (intensity == old_intensity) + return; + + /* We can't do this anywhere else */ + pcf50633_reg_write(pcf, PCF50633_REG_LEDDIM, 5); + if (!(pcf50633_reg_read(pcf, PCF50633_REG_LEDENA) & 3)) old_intensity = 0; @@ -1038,13 +1044,15 @@ static void gta02_bl_set_intensity(int intensity) pcf50633_reg_write(pcf, PCF50633_REG_LEDENA, 0); if (!intensity) /* illegal to set LEDOUT to 0 */ - ret = pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_LEDOUT, 0x3f, 2); + ret = pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_LEDOUT, 0x3f, + 2); else ret = pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_LEDOUT, 0x3f, intensity); if (intensity) pcf50633_reg_write(pcf, PCF50633_REG_LEDENA, 2); + } static struct generic_bl_info gta02_bl_info = { |