summaryrefslogtreecommitdiff
path: root/drivers/leds
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-08-01 20:40:34 +0800
committerBryan Wu <bryan.wu@canonical.com>2012-08-08 09:49:53 +0800
commit4df7309af6f7988da15fc9a0175fc60b997cc0d7 (patch)
tree545f60503629b951e41091af11079ee15e953c0a /drivers/leds
parent0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff)
downloadlinux-3.10-4df7309af6f7988da15fc9a0175fc60b997cc0d7.tar.gz
linux-3.10-4df7309af6f7988da15fc9a0175fc60b997cc0d7.tar.bz2
linux-3.10-4df7309af6f7988da15fc9a0175fc60b997cc0d7.zip
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/leds/leds-lp8788.c b/drivers/leds/leds-lp8788.c
index 53bd136f1ef..0ade6ebfc91 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;