From: "Rafael V. Volkmer" <rafael.v.volkmer@gmail.com>
To: ukleinek@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org,
rafael.v.volkmer@gmail.com
Subject: Re: [PATCH v6 4/6] pwm: tiehrpwm: implement .get_state callback
Date: Tue, 25 Nov 2025 00:48:30 -0300 [thread overview]
Message-ID: <20251125034830.1512-1-rafael.v.volkmer@gmail.com> (raw)
In-Reply-To: <4zdh44geiodumnqsfmwbxcfhishs7xeg5qsb6o3zb3nog7yfu6@wvqwqwltlip5>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1803 bytes --]
Hi Uwe,
On Mon, 24 Nov 2025 17:51:47 +0100, Uwe Kleine-König wrote:
> Note this is wrong as pwm_get_state() only yields the last request but
> not the actual hardware setting.
You’re right about the misleading wording in the commit log:
pwm_get_state() returns the last requested state, not a live snapshot of
the hardware. In the next revision I’ll rephrase the description so it’s
clear that ehrpwm_get_state() is only used to initialize pwm->state from
the current eHRPWM registers when the PWM is first requested.
I’ll also address the other points you mentioned in this series.
> A superior improvement over implementing .get_state() is implementing the
> new callbacks round_waveform_tohw, round_waveform_fromhw, read_waveform
> and write_waveform. And bonus points if you also implement offset
> support.
I like this suggestion and would be interested in doing it for tiehrpwm,
but for now I’d prefer to keep this series limited to the smaller
cleanups, the get_state() implementation and the probe changes, so the
scope stays manageable. My current plan would be to first send a new
revision with those pieces, and then follow up with a separate series
that converts tiehrpwm to round_waveform_tohw / round_waveform_fromhw
plus read_waveform / write_waveform and adds offset support.
From my reading of the PWM core, it seems acceptable for a driver to
provide both the legacy apply/get_state callbacks and the waveform
callbacks, with the logic factored so that they share
the same hardware decoding. If you’d strongly prefer that tiehrpwm is
converted directly to waveform without an intermediate get_state()
series, I can rework the patches in that direction instead.
Best regards,
Rafael V. Volkmer
next prev parent reply other threads:[~2025-11-25 3:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-23 23:20 [PATCH v6 0/6] pwm: tiehrpwm: add .get_state and tidy register handling Rafael V. Volkmer
2025-11-23 23:25 ` [PATCH v6 1/6] pwm: tiehrpwm: use GENMASK() and FIELD_PREP() for register fields Rafael V. Volkmer
2025-11-23 23:27 ` [PATCH v6 2/6] pwm: tiehrpwm: use GENMASK() and FIELD_PREP() for prescalers Rafael V. Volkmer
2025-11-23 23:29 ` [PATCH v6 3/6] pwm: tiehrpwm: refactor AQCTL polarity macros Rafael V. Volkmer
2025-11-23 23:31 ` [PATCH v6 4/6] pwm: tiehrpwm: implement .get_state callback Rafael V. Volkmer
2025-11-23 23:33 ` [PATCH v6 5/6] pwm: tiehrpwm: handle already-running channels at probe Rafael V. Volkmer
2025-11-23 23:35 ` [PATCH v6 6/6] pwm: tiehrpwm: tidy period conflict check Rafael V. Volkmer
2025-11-24 16:51 ` [PATCH v6 4/6] pwm: tiehrpwm: implement .get_state callback Uwe Kleine-König
2025-11-25 3:48 ` Rafael V. Volkmer [this message]
2025-11-25 7:52 ` Uwe Kleine-König
2025-11-25 20:39 ` Rafael V. Volkmer
2025-11-26 7:48 ` Uwe Kleine-König
2025-11-24 10:36 ` [PATCH v6 1/6] pwm: tiehrpwm: use GENMASK() and FIELD_PREP() for register fields 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=20251125034830.1512-1-rafael.v.volkmer@gmail.com \
--to=rafael.v.volkmer@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=ukleinek@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
all inboxes | Powered by JetHome®