mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-19 15:39:07 +00:00
leds: lp8788: Fix updating scale configuration bits
We need to do left shift (cfg->num + LP8788_ISINK_SCALE_OFFSET) bits for updating scale configuration. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com> Tested-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
This commit is contained in:
parent
0d7614f09c
commit
4df7309af6
@ -63,7 +63,7 @@ static int lp8788_led_init_device(struct lp8788_led *led,
|
||||
/* scale configuration */
|
||||
addr = LP8788_ISINK_CTRL;
|
||||
mask = 1 << (cfg->num + LP8788_ISINK_SCALE_OFFSET);
|
||||
val = cfg->scale << cfg->num;
|
||||
val = cfg->scale << (cfg->num + LP8788_ISINK_SCALE_OFFSET);
|
||||
ret = lp8788_update_bits(led->lp, addr, mask, val);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user