From: Axel Lin <axel.lin@gmail.com>
To: Bryan Wu <bryan.wu@canonical.com>
Cc: "Milo(Woogyom) Kim" <milo.kim@ti.com>,
Richard Purdie <rpurdie@rpsys.net>,
linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH RFT] leds: lp8788: Fix updating scale configuration bits
Date: Wed, 01 Aug 2012 20:40:34 +0800 [thread overview]
Message-ID: <1343824834.3859.2.camel@phoenix> (raw)
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>
---
Hi Milo,
Current code of updating scale configuration bits looks wrong to me
because the mask does not match the val.
I don't have this hardware, can you test this patch?
Thanks,
Axel
drivers/leds/leds-lp8788.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
1.7.9.5
next reply other threads:[~2012-08-01 12:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-01 12:40 Axel Lin [this message]
2012-08-07 2:07 ` [PATCH RFT] leds: lp8788: Fix updating scale configuration bits Bryan Wu
2012-08-07 8:09 ` Kim, Milo
2012-08-08 1:42 ` Bryan Wu
2012-08-07 8:03 ` Kim, Milo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1343824834.3859.2.camel@phoenix \
--to=axel.lin@gmail.com \
--cc=bryan.wu@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=milo.kim@ti.com \
--cc=rpurdie@rpsys.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.