diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-08-01 08:40:34 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@canonical.com> | 2012-08-07 21:49:53 -0400 |
commit | 4df7309af6f7988da15fc9a0175fc60b997cc0d7 (patch) | |
tree | 545f60503629b951e41091af11079ee15e953c0a /drivers/leds/leds-lp8788.c | |
parent | 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff) |
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>
Diffstat (limited to 'drivers/leds/leds-lp8788.c')
-rw-r--r-- | drivers/leds/leds-lp8788.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/leds/leds-lp8788.c b/drivers/leds/leds-lp8788.c index 53bd136f1ef0..0ade6ebfc914 100644 --- a/drivers/leds/leds-lp8788.c +++ b/drivers/leds/leds-lp8788.c | |||
@@ -63,7 +63,7 @@ static int lp8788_led_init_device(struct lp8788_led *led, | |||
63 | /* scale configuration */ | 63 | /* scale configuration */ |
64 | addr = LP8788_ISINK_CTRL; | 64 | addr = LP8788_ISINK_CTRL; |
65 | mask = 1 << (cfg->num + LP8788_ISINK_SCALE_OFFSET); | 65 | mask = 1 << (cfg->num + LP8788_ISINK_SCALE_OFFSET); |
66 | val = cfg->scale << cfg->num; | 66 | val = cfg->scale << (cfg->num + LP8788_ISINK_SCALE_OFFSET); |
67 | ret = lp8788_update_bits(led->lp, addr, mask, val); | 67 | ret = lp8788_update_bits(led->lp, addr, mask, val); |
68 | if (ret) | 68 | if (ret) |
69 | return ret; | 69 | return ret; |