backlight: lm3630a: Bump REG_MAX value to 0x50 instead of 0x1F
authorBhushan Shah <bshah@kde.org>
Fri, 23 Jun 2017 03:54:33 +0000 (09:24 +0530)
committerLee Jones <lee.jones@linaro.org>
Mon, 17 Jul 2017 12:27:06 +0000 (13:27 +0100)
commit06168a64b1ae346816fcd0a0c3ea5276c778408b
tree55ba1964d3d545166a129b31a22d60f46b9a06fc
parent5771a8c08880cdca3bfb4a3fc6d309d6bba20877
backlight: lm3630a: Bump REG_MAX value to 0x50 instead of 0x1F

In the lm3630a_chip_init we try to write to 0x50 register, which is
higher value then the max_register value, this resulted in regmap_write
return -EIO.

Fix this by bumping REG_MAX value to 0x50.

This code was introduced with the chip revision in commit 28e64a68a2ef,
however setting filter strength was failing silently because it used
unsigned int for storing and comparing the return values. Bug related to
signedness was fixed in 2a0c316bf3cc, which made it error out correctly
instead of failing silently.

I found this issue by using this driver on LGE Nexus 5 (hammerhead).
After this commit lm3630a_chip_init succeeds instead of failing with
-EIO.

Fixes: 28e64a68a2ef ("backlight: lm3630: apply chip revision")
Fixes: 2a0c316bf3cc ("drivers/video/backlight/lm3630a_bl.c: fix
signedness bug in lm3630a_chip_init()")

Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bhushan Shah <bshah@kde.org>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/video/backlight/lm3630a_bl.c