From: Dimitri Fedrau <dima.fedrau@gmail.com>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-pwm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/2] pwm: add support for NXPs high-side switch MC33XS2410
Date: Sun, 3 Nov 2024 21:52:15 +0100 [thread overview]
Message-ID: <20241103205215.GA509903@debian> (raw)
In-Reply-To: <atkj7wnhl4n6frl5swjwrto6r6dhofjtnqisqrn5z6w3cmfl3h@dgqgdxovrqb4>
Hello Uwe,
Am Sun, Nov 03, 2024 at 09:19:36PM +0100 schrieb Uwe Kleine-König:
> Hello Dimitri,
>
> On Sun, Nov 03, 2024 at 08:07:09PM +0100, Dimitri Fedrau wrote:
> > Am Thu, Oct 24, 2024 at 11:19:16PM +0200 schrieb Uwe Kleine-König:
> > > What breaks if you drop the check for state->enabled?
> > >
> > The device is unable to generate a 0% duty cycle, to support this you
> > proposed in an earlier review to disable the output. Without checking if
> > the output is disabled, the mc33xs2410_pwm_get_state function returns the
> > wrong duty cycle for a previously setted 0% duty cycle. A "0" value in the
> > MC33XS2410_PWM_DC register means that the relative duty cylce is 1/256. As
> > a result there are complaints if PWM_DEBUG is enabled.
>
> I fail to follow. If .enabled=true + .duty_cycle=0 is requested you
> disable. That's fine. However it shouldn't be necessary to use
> state->enabled in .get_state(). I didn't look at the actual code, but if
> you provide a sequence of writes to /sys that trigger a PWM_DEBUG
> output, I'll take another look.
>
Apply 0% duty cycle: .enabled=false + .duty_cycle=0
Below some writes triggering PWM_DEBUG output:
# echo 488282 > /sys/class/pwm/pwmchip3/pwm0/period
# echo 244140 > /sys/class/pwm/pwmchip3/pwm0/duty_cycle
# echo 0 > /sys/class/pwm/pwmchip3/pwm0/duty_cycle
[ 91.813513] mc33xs2410-pwm spi0.0: .apply is supposed to round down duty_cycle (requested: 0/488282, applied: 1908/488282)
Best regards,
Dimitri
next prev parent reply other threads:[~2024-11-03 20:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-27 12:57 [PATCH v6 0/2] pwm: add support for NXPs high-side switch MC33XS2410 Dimitri Fedrau
2024-09-27 12:57 ` [PATCH v6 1/2] dt-bindings: pwm: add support for MC33XS2410 Dimitri Fedrau
2024-09-27 12:57 ` [PATCH v6 2/2] pwm: add support for NXPs high-side switch MC33XS2410 Dimitri Fedrau
2024-10-22 7:54 ` Uwe Kleine-König
2024-10-23 12:52 ` Dimitri Fedrau
2024-10-24 21:19 ` Uwe Kleine-König
2024-11-03 19:07 ` Dimitri Fedrau
2024-11-03 20:19 ` Uwe Kleine-König
2024-11-03 20:52 ` Dimitri Fedrau [this message]
2024-11-04 8:52 ` Uwe Kleine-König
2024-11-04 13:07 ` Dimitri Fedrau
2024-11-06 8:13 ` 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=20241103205215.GA509903@debian \
--to=dima.fedrau@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=u.kleine-koenig@baylibre.com \
/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).