Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[PATCH RFT] leds: lp8788: Fix updating scale configuration bits

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


axel.lin at gmail

Aug 1, 2012, 5:40 AM

Post #1 of 5 (119 views)
Permalink
[PATCH RFT] 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 [at] gmail>
---
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



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


bryan.wu at canonical

Aug 6, 2012, 7:07 PM

Post #2 of 5 (106 views)
Permalink
Re: [PATCH RFT] leds: lp8788: Fix updating scale configuration bits [In reply to]

On Wed, Aug 1, 2012 at 8:40 PM, Axel Lin <axel.lin [at] gmail> 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 [at] gmail>
> ---
> 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 [at] canonical>
Kernel Developer +86.186-168-78255 Mobile
Canonical Ltd. www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


Milo.Kim at ti

Aug 7, 2012, 1:03 AM

Post #3 of 5 (106 views)
Permalink
RE: [PATCH RFT] leds: lp8788: Fix updating scale configuration bits [In reply to]

> We need to do left shift (cfg->num + LP8788_ISINK_SCALE_OFFSET) bits
> for
> updating scale configuration.
>
> Signed-off-by: Axel Lin <axel.lin [at] gmail>
> ---
> 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++%lzwmb맲rzXw{ayʇڙ,jfhzw j:+vwjmzZ+ݢj"!iOzv^m nƊY&


Milo.Kim at ti

Aug 7, 2012, 1:09 AM

Post #4 of 5 (105 views)
Permalink
RE: [PATCH RFT] leds: lp8788: Fix updating scale configuration bits [In reply to]

> > We need to do left shift (cfg->num + LP8788_ISINK_SCALE_OFFSET) bits
> for
> > updating scale configuration.
> >
> > Signed-off-by: Axel Lin <axel.lin [at] gmail>
> > ---
>
> 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 [at] ti>
Tested-by: Milo(Woogyom) Kim <milo.kim [at] ti>

Thanks,
Milo -
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


bryan.wu at canonical

Aug 7, 2012, 6:42 PM

Post #5 of 5 (101 views)
Permalink
Re: [PATCH RFT] leds: lp8788: Fix updating scale configuration bits [In reply to]

On Tue, Aug 7, 2012 at 4:09 PM, Kim, Milo <Milo.Kim [at] ti> 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 [at] gmail>
>> > ---
>>
>> 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 [at] ti>
> Tested-by: Milo(Woogyom) Kim <milo.kim [at] ti>
>
> Thanks,
> Milo -

Great, Applied

Thanks,
--
Bryan Wu <bryan.wu [at] canonical>
Kernel Developer +86.186-168-78255 Mobile
Canonical Ltd. www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.