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:
Axel Lin 2012-08-01 20:40:34 +08:00 committed by Bryan Wu
parent 0d7614f09c
commit 4df7309af6
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ static int lp8788_led_init_device(struct lp8788_led *led,
/* scale configuration */ /* scale configuration */
addr = LP8788_ISINK_CTRL; addr = LP8788_ISINK_CTRL;
mask = 1 << (cfg->num + LP8788_ISINK_SCALE_OFFSET); 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); ret = lp8788_update_bits(led->lp, addr, mask, val);
if (ret) if (ret)
return ret; return ret;