Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757199Ab2HGCHu (ORCPT ); Mon, 6 Aug 2012 22:07:50 -0400 Received: from mail-ee0-f46.google.com ([74.125.83.46]:34924 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756810Ab2HGCHt (ORCPT ); Mon, 6 Aug 2012 22:07:49 -0400 MIME-Version: 1.0 In-Reply-To: <1343824834.3859.2.camel@phoenix> References: <1343824834.3859.2.camel@phoenix> From: Bryan Wu Date: Tue, 7 Aug 2012 10:07:27 +0800 X-Google-Sender-Auth: ktUp9aBYRnYziWiwUYyMJL38kgI Message-ID: Subject: Re: [PATCH RFT] leds: lp8788: Fix updating scale configuration bits To: "Milo(Woogyom) Kim" , Axel Lin Cc: Richard Purdie , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1663 Lines: 53 On Wed, Aug 1, 2012 at 8:40 PM, Axel Lin wrote: > We need to do left shift (cfg->num + LP8788_ISINK_SCALE_OFFSET) bits for > updating scale configuration. > > Signed-off-by: Axel Lin > --- > 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 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/