diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-08-01 20:40:34 +0800 |
---|---|---|
committer | Bryan Wu <bryan.wu@canonical.com> | 2012-08-08 09:49:53 +0800 |
commit | 4df7309af6f7988da15fc9a0175fc60b997cc0d7 (patch) | |
tree | 545f60503629b951e41091af11079ee15e953c0a /drivers/leds | |
parent | 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff) | |
download | op-kernel-dev-4df7309af6f7988da15fc9a0175fc60b997cc0d7.zip op-kernel-dev-4df7309af6f7988da15fc9a0175fc60b997cc0d7.tar.gz |
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')
-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 53bd136..0ade6eb 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; |