From: Bhushan Shah <bshah@kde.org>
To: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>,
Jingoo Han <jingoohan1@gmail.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Bhushan Shah <bshah@kde.org>,
linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] backlight: lm3630a: bump REG_MAX value to 0x50 instead of 0x1F
Date: Wed, 21 Jun 2017 11:04:30 +0000 [thread overview]
Message-ID: <20170621105230.GA13390@archbox> (raw)
In-Reply-To: <1eda1c22-5a40-74f0-3a79-41e827828a32@linaro.org>
In-Reply-To: <20170621053152.3008-1-bshah@kde.org>
[-- Attachment #1: Type: text/plain, Size: 2717 bytes --]
On Wed, Jun 21, 2017 at 10:37:43AM +0100, Daniel Thompson wrote:
> On 21/06/17 06:31, Bhushan Shah wrote:
> > In the lm3630a_chip_init we try to write to 0x50 register, which is
> > higher value then the max_register value, this resulted in regmap_write
> > return -EIO.
> >
> > Fix this by bumping REG_MAX value to 0x50. >
> > Signed-off-by: Bhushan Shah <bshah@kde.org>
> > Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
>
> Can we get a "Fixes" on this? It looks to me like it has been broken since
> 2a0c316bf3cc ("fix signedness bug in lm3630a_chip_init()").
I don't think 2a0c316bf3cc is the right commit to mention in Fixes tag?
Because it was broken since the introduction of chip revision in commit
28e64a68a2ef ("backlight: lm3630: apply chip revision").
commit 2a0c316bf3cc just made it error out correctly instead of failing
silently.
What do you think?
>
> Also I assume you find this by trying to use the driver on real hardware? If
> so can you confirm what you tested on in the patch description. As far as I
> can tell the code to set the filter strength has never worked, so you'll be
> the first user of it!
Yes I hit this problem by trying it on LGE Nexus 5 (hammerhead). I will
mention this in the v3 revision of patch.
>
> > ---
> >
> > Changes since v1:
> > - Fix the lm3630a_write call to use proper value (sent worng patch earlier)
> >
> > drivers/video/backlight/lm3630a_bl.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c
> > index 60d6c2ac87aa..b641f706dbc9 100644
> > --- a/drivers/video/backlight/lm3630a_bl.c
> > +++ b/drivers/video/backlight/lm3630a_bl.c
> > @@ -31,7 +31,8 @@
> > #define REG_FAULT 0x0B
> > #define REG_PWM_OUTLOW 0x12
> > #define REG_PWM_OUTHIGH 0x13
> > -#define REG_MAX 0x1F
> > +#define REG_FLTR_STR 0x50
>
> Can we expand this to REG_FILTER_STRENGTH?
Sure, will include in Patch v3.
>
> Daniel.
>
> > +#define REG_MAX 0x50
> > #define INT_DEBOUNCE_MSEC 10
> > struct lm3630a_chip {
> > @@ -80,7 +81,7 @@ static int lm3630a_chip_init(struct lm3630a_chip *pchip)
> > usleep_range(1000, 2000);
> > /* set Filter Strength Register */
> > - rval = lm3630a_write(pchip, 0x50, 0x03);
> > + rval = lm3630a_write(pchip, REG_FLTR_STR, 0x03);
> > /* set Cofig. register */
> > rval |= lm3630a_update(pchip, REG_CONFIG, 0x07, pdata->pwm_ctrl);
> > /* set boost control */
> >
>
--
Bhushan Shah
http://blog.bshah.in
IRC Nick : bshah on Freenode
GPG key fingerprint : 0AAC 775B B643 7A8D 9AF7 A3AC FE07 8411 7FBC E11D
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2017-06-21 11:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-21 5:36 [PATCH] backlight: lm3630a: bump REG_MAX value to 0x50 instead of 0x1F Bhushan Shah
2017-06-21 5:43 ` [PATCH v2] " Bhushan Shah
2017-06-21 9:37 ` Daniel Thompson
2017-06-21 11:04 ` Bhushan Shah [this message]
2017-06-21 11:03 ` Daniel Thompson
2017-06-22 0:46 ` [PATCH] " kbuild test robot
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=20170621105230.GA13390@archbox \
--to=bshah@kde.org \
--cc=b.zolnierkie@samsung.com \
--cc=daniel.thompson@linaro.org \
--cc=jingoohan1@gmail.com \
--cc=lee.jones@linaro.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).