Title: [9179] trunk/drivers/video/backlight/adp8870_bl.c: video: backlight: adp8870: Fix ambient light zone overwrite handling
Revision
9179
Author
hennerich
Date
2010-09-29 04:46:24 -0400 (Wed, 29 Sep 2010)

Log Message

video: backlight: adp8870: Fix ambient light zone overwrite handling

Get/Set current Ambient Light Zone. Reading returns integer between 1..5
1 = Daylight, 2 = bright, ?\226?\128?\166, 5 = dark). Writing a value between 1..5
forces the Backlight controller to enter the corresponding Ambient Light Zone.
Writing 0 returns to normal operation.
Make sure we subtract 1, the register definition (CFGR:BLV) requires it.

Modified Paths

Diff

Modified: trunk/drivers/video/backlight/adp8870_bl.c (9178 => 9179)


--- trunk/drivers/video/backlight/adp8870_bl.c	2010-09-29 08:43:16 UTC (rev 9178)
+++ trunk/drivers/video/backlight/adp8870_bl.c	2010-09-29 08:46:24 UTC (rev 9179)
@@ -714,7 +714,7 @@
 		mutex_lock(&data->lock);
 		adp8870_read(data->client, ADP8870_CFGR, &reg_val);
 		reg_val &= ~(CFGR_BLV_MASK << CFGR_BLV_SHIFT);
-		reg_val |= val << CFGR_BLV_SHIFT;
+		reg_val |= (val - 1) << CFGR_BLV_SHIFT;
 		adp8870_write(data->client, ADP8870_CFGR, reg_val);
 		mutex_unlock(&data->lock);
 	}
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to