Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4df7309a authored by Axel Lin's avatar Axel Lin Committed by Bryan Wu
Browse files

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: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarMilo(Woogyom) Kim <milo.kim@ti.com>
Tested-by: default avatarMilo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: default avatarBryan Wu <bryan.wu@canonical.com>
parent 0d7614f0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;