* [PATCH RFT] leds: lp8788: Fix updating scale configuration bits
@ 2012-08-01 12:40 Axel Lin
2012-08-07 2:07 ` Bryan Wu
2012-08-07 8:03 ` Kim, Milo
0 siblings, 2 replies; 5+ messages in thread
From: Axel Lin @ 2012-08-01 12:40 UTC (permalink / raw)
To: Bryan Wu; +Cc: Milo(Woogyom) Kim, Richard Purdie, linux-leds, linux-kernel
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH RFT] leds: lp8788: Fix updating scale configuration bits
2012-08-01 12:40 [PATCH RFT] leds: lp8788: Fix updating scale configuration bits Axel Lin
@ 2012-08-07 2:07 ` Bryan Wu
2012-08-07 8:09 ` Kim, Milo
2012-08-07 8:03 ` Kim, Milo
1 sibling, 1 reply; 5+ messages in thread
From: Bryan Wu @ 2012-08-07 2:07 UTC (permalink / raw)
To: Milo(Woogyom) Kim, Axel Lin; +Cc: Richard Purdie, linux-leds, linux-kernel
On Wed, Aug 1, 2012 at 8:40 PM, Axel Lin <axel.lin@gmail.com> wrote:
> 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?
>
Milo, I think this patch from Axel is reasonable. could you please
take a look at this?
-Bryan
> 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
>
>
>
--
Bryan Wu <bryan.wu@canonical.com>
Kernel Developer +86.186-168-78255 Mobile
Canonical Ltd. www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH RFT] leds: lp8788: Fix updating scale configuration bits
2012-08-01 12:40 [PATCH RFT] leds: lp8788: Fix updating scale configuration bits Axel Lin
2012-08-07 2:07 ` Bryan Wu
@ 2012-08-07 8:03 ` Kim, Milo
1 sibling, 0 replies; 5+ messages in thread
From: Kim, Milo @ 2012-08-07 8:03 UTC (permalink / raw)
To: Axel Lin, Bryan Wu; +Cc: Richard Purdie, linux-leds, linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 657 bytes --]
> 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,
The scale bits can be never updated without this patch.
This patch should be applied.
Thanks for fixing this bug !
Best Regards,
Milo
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH RFT] leds: lp8788: Fix updating scale configuration bits
2012-08-07 2:07 ` Bryan Wu
@ 2012-08-07 8:09 ` Kim, Milo
2012-08-08 1:42 ` Bryan Wu
0 siblings, 1 reply; 5+ messages in thread
From: Kim, Milo @ 2012-08-07 8:09 UTC (permalink / raw)
To: Axel Lin, Bryan Wu; +Cc: Richard Purdie, linux-leds, linux-kernel
> > 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>
> > ---
>
> Milo, I think this patch from Axel is reasonable. could you please
> take a look at this?
>
> -Bryan
Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Tested-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Thanks,
Milo -
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RFT] leds: lp8788: Fix updating scale configuration bits
2012-08-07 8:09 ` Kim, Milo
@ 2012-08-08 1:42 ` Bryan Wu
0 siblings, 0 replies; 5+ messages in thread
From: Bryan Wu @ 2012-08-08 1:42 UTC (permalink / raw)
To: Kim, Milo; +Cc: Axel Lin, Richard Purdie, linux-leds, linux-kernel
On Tue, Aug 7, 2012 at 4:09 PM, Kim, Milo <Milo.Kim@ti.com> wrote:
>> > 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>
>> > ---
>>
>> Milo, I think this patch from Axel is reasonable. could you please
>> take a look at this?
>>
>> -Bryan
>
> Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com>
> Tested-by: Milo(Woogyom) Kim <milo.kim@ti.com>
>
> Thanks,
> Milo -
Great, Applied
Thanks,
--
Bryan Wu <bryan.wu@canonical.com>
Kernel Developer +86.186-168-78255 Mobile
Canonical Ltd. www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-08-08 1:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-01 12:40 [PATCH RFT] leds: lp8788: Fix updating scale configuration bits Axel Lin
2012-08-07 2:07 ` Bryan Wu
2012-08-07 8:09 ` Kim, Milo
2012-08-08 1:42 ` Bryan Wu
2012-08-07 8:03 ` Kim, Milo
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.