From 94447a8f14ff2e5c5910d55a84cf5040f2671e4e Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 19 Nov 2008 17:11:25 +0000 Subject: fix-pcf50633-backlight-never-down.patch This solves the problem that the backlight never turns off in stable-tracking Signed-off-by: Andy Green --- drivers/i2c/chips/pcf50633.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'drivers') diff --git a/drivers/i2c/chips/pcf50633.c b/drivers/i2c/chips/pcf50633.c index 21788306057..11a5f5a5b3a 100644 --- a/drivers/i2c/chips/pcf50633.c +++ b/drivers/i2c/chips/pcf50633.c @@ -1905,10 +1905,9 @@ static int pcf50633bl_get_intensity(struct backlight_device *bd) static int __pcf50633bl_set_intensity(struct pcf50633_data *pcf, int intensity) { int old_intensity = reg_read(pcf, PCF50633_REG_LEDOUT); - u_int8_t ledena = 2; int ret; - if (!(reg_read(pcf, PCF50633_REG_LEDENA) & 1)) + if (!(reg_read(pcf, PCF50633_REG_LEDENA) & 3)) old_intensity = 0; if ((pcf->backlight->props.power != FB_BLANK_UNBLANK) || @@ -1920,10 +1919,8 @@ static int __pcf50633bl_set_intensity(struct pcf50633_data *pcf, int intensity) * if seen, you have to re-enable the LED unit */ - if (intensity != 0 && old_intensity == 0) { - ledena = reg_read(pcf, PCF50633_REG_LEDENA); - reg_write(pcf, PCF50633_REG_LEDENA, 0x00); - } + if (!intensity || !old_intensity) + reg_write(pcf, PCF50633_REG_LEDENA, 0); if (!intensity) /* illegal to set LEDOUT to 0 */ ret = reg_set_bit_mask(pcf, PCF50633_REG_LEDOUT, 0x3f, 2); @@ -1931,8 +1928,8 @@ static int __pcf50633bl_set_intensity(struct pcf50633_data *pcf, int intensity) 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 (intensity) + reg_write(pcf, PCF50633_REG_LEDENA, 2); return ret; } -- cgit v1.2.3