aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2008-11-19 17:11:25 +0000
committerAndy Green <andy@openmoko.com>2008-11-19 17:11:25 +0000
commit94447a8f14ff2e5c5910d55a84cf5040f2671e4e (patch)
tree80bdc73197072beb3180ee94de0f683daec0120e /drivers/i2c
parent107b2462fc4872eec18e7fa4a8f498f6f5c5e75d (diff)
fix-pcf50633-backlight-never-down.patch
This solves the problem that the backlight never turns off in stable-tracking Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/chips/pcf50633.c13
1 files changed, 5 insertions, 8 deletions
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;
}