From 3c633bc8b16ba3772217262758b8c514f3be8f93 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 21 Nov 2008 11:56:56 +0000 Subject: fix-balaji-backlight-never-goes-off.patch Signed-off-by: Andy Green --- arch/arm/mach-s3c2440/mach-gta02.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-s3c2440') 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 = { -- cgit v1.2.3