From: Jeff LaBundy <jeff@labundy.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: thierry.reding@gmail.com, lee.jones@linaro.org,
linux-pwm@vger.kernel.org
Subject: Re: [PATCH v2] pwm: iqs620a: Correct a stale state variable
Date: Sun, 14 Feb 2021 19:19:27 -0600 [thread overview]
Message-ID: <20210215011927.GA15385@labundy.com> (raw)
In-Reply-To: <20210122181239.ut33bmzxlvy2mx5f@pengutronix.de>
Hi Thierry,
Do you have any objection to applying Uwe's patch [1] followed by
this one so that they can land in 5.12?
Hi Uwe,
On Fri, Jan 22, 2021 at 07:12:39PM +0100, Uwe Kleine-König wrote:
> Hello,
>
> On Mon, Jan 18, 2021 at 10:30:29PM -0600, Jeff LaBundy wrote:
> > If duty cycle is first set to a value that is sufficiently high to
> > enable the output (e.g. 10000 ns) but then lowered to a value that
> > is quantized to zero (e.g. 1000 ns), the output is disabled as the
> > device cannot drive a constant zero (as expected).
> >
> > However if the device is later re-initialized due to watchdog bite,
> > the output is re-enabled at the next-to-last duty cycle (10000 ns).
> > This is because the iqs620_pwm->out_en flag unconditionally tracks
> > state->enabled instead of what was actually written to the device.
> >
> > To solve this problem, use one state variable that encodes all 257
> > states of the output (duty_scale) with 0 representing tri-state, 1
> > representing the minimum available duty cycle and 256 representing
> > 100% duty cycle.
> >
> > Signed-off-by: Jeff LaBundy <jeff@labundy.com>
>
> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> > 1 file changed, 37 insertions(+), 51 deletions(-)
>
> Nice cleanup, thanks for picking up this idea.
Thank you for your kind words as well as your assistance throughout
this and other patches.
>
> Best regards
> Uwe
>
> --
> Pengutronix e.K. | Uwe Kleine-König |
> Industrial Linux Solutions | https://www.pengutronix.de/ |
Kind regards,
Jeff LaBundy
next prev parent reply other threads:[~2021-02-15 1:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-19 4:30 [PATCH v2] pwm: iqs620a: Correct a stale state variable Jeff LaBundy
2021-01-22 18:12 ` Uwe Kleine-König
2021-02-15 1:19 ` Jeff LaBundy [this message]
2021-02-26 9:47 ` Uwe Kleine-König
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=20210215011927.GA15385@labundy.com \
--to=jeff@labundy.com \
--cc=lee.jones@linaro.org \
--cc=linux-pwm@vger.kernel.org \
--cc=thierry.reding@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
/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