* [PATCH RFC] leds: lm3530: Fix setting pltfm->als_vmax
@ 2012-02-07 6:23 Axel Lin
2012-02-07 10:06 ` Kim, Milo
0 siblings, 1 reply; 4+ messages in thread
From: Axel Lin @ 2012-02-07 6:23 UTC (permalink / raw)
To: linux-kernel
Cc: Shreshtha Kumar Sahu, Milo(Woogyom) Kim, Richard Purdie,
Andrew Morton
In current code, pltfm->als_vmin is set to LM3530_ALS_WINDOW_mV and
pltfm->als_vmax is 0. This looks does not make sense.
I think what we want here is setting pltfm->als_vmax to LM3530_ALS_WINDOW_mV.
Both als_vmin and als_vmax local variables will be set to pltfm->als_vmin and
pltfm->als_vmax by a few lines latter.
Thus also remove a redundant assignment for als_vmin and als_vmax in this patch.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
Hi Kim,
I don't have this hardware, I'd appreciate if you can review and test this patch.
Thanks,
Axel
drivers/leds/leds-lm3530.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/leds/leds-lm3530.c b/drivers/leds/leds-lm3530.c
index 45e6878..e59c166 100644
--- a/drivers/leds/leds-lm3530.c
+++ b/drivers/leds/leds-lm3530.c
@@ -164,8 +164,8 @@ static int lm3530_init_registers(struct lm3530_data *drvdata)
if (drvdata->mode == LM3530_BL_MODE_ALS) {
if (pltfm->als_vmax == 0) {
- pltfm->als_vmin = als_vmin = 0;
- pltfm->als_vmin = als_vmax = LM3530_ALS_WINDOW_mV;
+ pltfm->als_vmin = 0;
+ pltfm->als_vmax = LM3530_ALS_WINDOW_mV;
}
als_vmin = pltfm->als_vmin;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* RE: [PATCH RFC] leds: lm3530: Fix setting pltfm->als_vmax
2012-02-07 6:23 [PATCH RFC] leds: lm3530: Fix setting pltfm->als_vmax Axel Lin
@ 2012-02-07 10:06 ` Kim, Milo
2012-02-07 11:12 ` Axel Lin
0 siblings, 1 reply; 4+ messages in thread
From: Kim, Milo @ 2012-02-07 10:06 UTC (permalink / raw)
To: Axel Lin
Cc: Shreshtha Kumar Sahu, Richard Purdie, Andrew Morton,
linux-kernel@vger.kernel.org
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 1256 bytes --]
> -----Original Message-----
> From: Axel Lin [mailto:axel.lin@gmail.com]
> Sent: Tuesday, February 07, 2012 3:23 PM
> To: linux-kernel@vger.kernel.org
> Cc: Shreshtha Kumar Sahu; Kim, Milo; Richard Purdie; Andrew Morton
> Subject: [PATCH RFC] leds: lm3530: Fix setting pltfm->als_vmax
>
> In current code, pltfm->als_vmin is set to LM3530_ALS_WINDOW_mV and
> pltfm->als_vmax is 0. This looks does not make sense.
> I think what we want here is setting pltfm->als_vmax to
> LM3530_ALS_WINDOW_mV.
>
> Both als_vmin and als_vmax local variables will be set to pltfm-
> >als_vmin and
> pltfm->als_vmax by a few lines latter.
> Thus also remove a redundant assignment for als_vmin and als_vmax in
> this patch.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
This patch makes sense and fixes wrong range of the ALS input voltage.
It works well on the real board.
Thanks.
Acked-and-tested-by: Milo(Woogyom) Kim <milo.kim@ti.com>
BTW, I'd suggest that 'pltfm' is replaced with 'pdata' if below patch has been updated.
[PATCH v4 5/5] leds-lm3530: replace pltfm with pdata.
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] 4+ messages in thread* Re: [PATCH RFC] leds: lm3530: Fix setting pltfm->als_vmax
2012-02-07 10:06 ` Kim, Milo
@ 2012-02-07 11:12 ` Axel Lin
2012-02-07 20:59 ` Andrew Morton
0 siblings, 1 reply; 4+ messages in thread
From: Axel Lin @ 2012-02-07 11:12 UTC (permalink / raw)
To: Kim, Milo
Cc: Shreshtha Kumar Sahu, Richard Purdie, Andrew Morton,
linux-kernel@vger.kernel.org
> This patch makes sense and fixes wrong range of the ALS input voltage.
> It works well on the real board.
> Thanks.
>
> Acked-and-tested-by: Milo(Woogyom) Kim <milo.kim@ti.com>
>
> BTW, I'd suggest that 'pltfm' is replaced with 'pdata' if below patch has been updated.
> [PATCH v4 5/5] leds-lm3530: replace pltfm with pdata.
Well, I will redo the patch if Andrew takes your patch serial first.
But I guess Andrew may take this one first for 3.3.
Regards,
Axel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH RFC] leds: lm3530: Fix setting pltfm->als_vmax
2012-02-07 11:12 ` Axel Lin
@ 2012-02-07 20:59 ` Andrew Morton
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2012-02-07 20:59 UTC (permalink / raw)
To: axel.lin
Cc: Kim, Milo, Shreshtha Kumar Sahu, Richard Purdie,
linux-kernel@vger.kernel.org
On Tue, 7 Feb 2012 19:12:41 +0800
Axel Lin <axel.lin@gmail.com> wrote:
> > This patch makes sense and fixes wrong range of the ALS input voltage.
> > It works well on the real board.
> > Thanks.
> >
> > Acked-and-tested-by: Milo(Woogyom) Kim <milo.kim@ti.com>
> >
> > BTW, I'd suggest that 'pltfm' is replaced with 'pdata' if below patch has been updated.
> > [PATCH v4 5/5] leds-lm3530: replace pltfm with pdata.
>
> Well, I will redo the patch if Andrew takes your patch serial first.
> But I guess Andrew may take this one first for 3.3.
>
I applied "leds: lm3530: Fix setting pltfm->als_vmax" as-is for 3.3 and
fixed up my copy of "leds-lm3530: replace pltfm with pdata".
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-07 20:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-07 6:23 [PATCH RFC] leds: lm3530: Fix setting pltfm->als_vmax Axel Lin
2012-02-07 10:06 ` Kim, Milo
2012-02-07 11:12 ` Axel Lin
2012-02-07 20:59 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox