From: Mikko Perttunen <mperttunen@nvidia.com>
To: "Uwe Kleine-König" <ukleinek@kernel.org>
Cc: Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
linux-pwm@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org, Yi-Wei Wang <yiweiw@nvidia.com>
Subject: Re: [PATCH 0/5] Tegra264 PWM support
Date: Wed, 25 Mar 2026 08:55:03 +0900 [thread overview]
Message-ID: <5526134.GXAFRqVoOG@senjougahara> (raw)
In-Reply-To: <acKi4_RPGZnkHFZU@monoceros>
On Wednesday, March 25, 2026 1:45 AM Uwe Kleine-König wrote:
> Hello Mikko,
>
> On Mon, Mar 23, 2026 at 11:36:36AM +0900, Mikko Perttunen wrote:
> > this adds support for the PWM controller on Tegra264. The controller
> > is similar to previous generations, but the register fields are
> > widened, the depth is made configurable, and the enable bit moves
> > to a different spot.
>
> looking at the driver it would be great if you could provide a
> get_state() callback (or even convert to the waveform callbacks) and
> fix:
>
> static int tegra_pwm_config(struct pwm_chip *chip, struct pwm_device
*pwm,
> int duty_ns, int period_ns)
> {
> ...
> }
>
> static int tegra_pwm_apply(struct pwm_chip *chip, struct pwm_device
*pwm,
> const struct pwm_state *state)
> {
> ...
> err = tegra_pwm_config(chip, pwm, state->duty_cycle, state-
>period);
> ...
> }
>
> where state->duty_cycle and state->period are u64 and thus big values
> are not passed correctly to tegra_pwm_config().
>
> The former helps a lot for testing the driver, and the latter for fixing
> the fallout that you then will probably notice :-)
I agree, there are certainly some improvements to be done here. I was planning
to do some refactoring as part of the followup (adding support for the
configurable depth value), so if you're OK with it I'll fix those then. For
now this basic support is needed to make it possible to keep the board with
its fan/jet engine in the same room.. :)
FWIW, I'm also considering adding some KUnit tests for the duty/scale/depth
configuration. Please let me know if you have any thoughts on that.
Thank you
Mikko
>
> Best regards
> Uwe
prev parent reply other threads:[~2026-03-24 23:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 2:36 [PATCH 0/5] Tegra264 PWM support Mikko Perttunen
2026-03-23 2:36 ` [PATCH 1/5] pwm: tegra: Avoid hard-coded max clock frequency Mikko Perttunen
2026-03-24 16:45 ` Uwe Kleine-König
2026-03-25 0:34 ` Mikko Perttunen
2026-03-25 6:12 ` Uwe Kleine-König
2026-03-25 6:42 ` Viresh Kumar
2026-03-23 2:36 ` [PATCH 2/5] pwm: tegra: Modify read/write accessors for multi-register channel Mikko Perttunen
2026-03-23 2:36 ` [PATCH 3/5] pwm: tegra: Parametrize enable register offset Mikko Perttunen
2026-03-23 2:36 ` [PATCH 4/5] pwm: tegra: Parametrize duty and scale field widths Mikko Perttunen
2026-03-23 2:36 ` [PATCH 5/5] pwm: tegra: Add support for Tegra264 Mikko Perttunen
2026-03-23 7:24 ` Krzysztof Kozlowski
2026-03-24 4:46 ` Mikko Perttunen
2026-03-23 7:24 ` [PATCH 0/5] Tegra264 PWM support Krzysztof Kozlowski
2026-03-24 4:46 ` Mikko Perttunen
2026-03-24 16:45 ` Uwe Kleine-König
2026-03-24 23:55 ` Mikko Perttunen [this message]
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=5526134.GXAFRqVoOG@senjougahara \
--to=mperttunen@nvidia.com \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@gmail.com \
--cc=ukleinek@kernel.org \
--cc=yiweiw@nvidia.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