leds: is31fl319x: Fix setting current limit for is31fl319{0,1,3}
authorLuca Weiss <luca@z3ntu.xyz>
Tue, 29 Nov 2022 21:29:01 +0000 (22:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:45 +0000 (13:32 +0100)
commit75f7820de9339cd18564336cfc2ed74dceeaeeb9
tree0f3340b576485cc1e13992bc2df4ad180ca4f9a7
parent308eef3e16fd890e7170ab57baa03430fc0799af
leds: is31fl319x: Fix setting current limit for is31fl319{0,1,3}

[ Upstream commit 135780f1048b3f956f5b10bb23dec9c2d2c4ef6d ]

The current setting lives in bits 4:2 (as also defined by the mask) but
the current limit defines in the driver use bits 2:0 which should be
shifted over so they don't get masked out completely (except for 17.5mA
which became 10mA).

Now checking /sys/kernel/debug/regmap/1-0068/registers shows that the
current limit is applied correctly and doesn't take the default b000 =
42mA.

Fixes: fa877cf1abb9 ("leds: is31fl319x: Add support for is31fl319{0,1,3} chips")
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Reviewed-by: Vincent Knecht <vincent.knecht@mailoo.org>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/leds/leds-is31fl319x.c