The patch titled video: backlight: adp8860: fix ambient light zone overwrite handling has been added to the -mm tree. Its filename is video-backlight-adp8860-fix-ambient-light-zone-overwrite-handling.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: video: backlight: adp8860: fix ambient light zone overwrite handling From: Michael Hennerich <michael.hennerich@xxxxxxxxxx> This affects the get/set of the current Ambient Light Zone. Reading should return an integer between 1..3 (1 = Daylight, 2 = office, 3 = dark). Writing a value between 1..3 forces the backlight controller to enter the corresponding Ambient Light Zone. Writing 0 returns to normal operation. Fix valid range checking so we don't write invalid values to the controller, and make sure we subtract 1, since this is what the register definition (CFGR:BLV) requires. Otherwise the values written don't work correctly. Signed-off-by: Michael Hennerich <michael.hennerich@xxxxxxxxxx> Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx> Cc: Richard Purdie <rpurdie@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/video/backlight/adp8860_bl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/video/backlight/adp8860_bl.c~video-backlight-adp8860-fix-ambient-light-zone-overwrite-handling drivers/video/backlight/adp8860_bl.c --- a/drivers/video/backlight/adp8860_bl.c~video-backlight-adp8860-fix-ambient-light-zone-overwrite-handling +++ a/drivers/video/backlight/adp8860_bl.c @@ -614,7 +614,7 @@ static ssize_t adp8860_bl_ambient_light_ if (val == 0) { /* Enable automatic ambient light sensing */ adp8860_set_bits(data->client, ADP8860_MDCR, CMP_AUTOEN); - } else if ((val > 0) && (val < 6)) { + } else if ((val > 0) && (val <= 3)) { /* Disable automatic ambient light sensing */ adp8860_clr_bits(data->client, ADP8860_MDCR, CMP_AUTOEN); @@ -622,7 +622,7 @@ static ssize_t adp8860_bl_ambient_light_ mutex_lock(&data->lock); adp8860_read(data->client, ADP8860_CFGR, ®_val); reg_val &= ~(CFGR_BLV_MASK << CFGR_BLV_SHIFT); - reg_val |= val << CFGR_BLV_SHIFT; + reg_val |= (val - 1) << CFGR_BLV_SHIFT; adp8860_write(data->client, ADP8860_CFGR, reg_val); mutex_unlock(&data->lock); } _ Patches currently in -mm which might be from michael.hennerich@xxxxxxxxxx are drivers-misc-ad525x_dpot-fix-typo-in-spi-write16-and-write24-transfer-counts.patch linux-next.patch video-backlight-adp8860-fix-ambient-light-zone-overwrite-handling.patch drivers-misc-ad525x_dpot-fix-part-name-typos-in-defines.patch drivers-misc-ad525x_dpot-new-features.patch misc-devices-do-not-enable-by-default.patch gpio-adp5588-gpio-support-interrupt-controller.patch gpio-adp5588-gpio-support-interrupt-controller-update.patch gpio-adp5588-gpio-gpio_start-must-be-signed.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html