diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-08-01 16:40:34 +0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@canonical.com> | 2012-08-08 05:49:53 +0400 |
commit | 4df7309af6f7988da15fc9a0175fc60b997cc0d7 (patch) | |
tree | 545f60503629b951e41091af11079ee15e953c0a /drivers | |
parent | 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff) | |
download | linux-4df7309af6f7988da15fc9a0175fc60b997cc0d7.tar.xz |
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')
-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, /* 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; |