diff options
| author | Alexandre Mergnat <amergnat@baylibre.com> | 2026-07-17 21:18:17 +0200 |
|---|---|---|
| committer | Uwe Kleine-König <ukleinek@kernel.org> | 2026-11-02 11:51:57 +0100 |
| commit | 39c58af419d9f6b0356cd7e10ff5abb3e60dcffb (patch) | |
| tree | 832e3401420b82a64ddd4f1b32fc4a0428ed9db4 /scripts/Makefile.thinlto | |
| parent | 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4 (diff) | |
| download | linux-next-39c58af419d9f6b0356cd7e10ff5abb3e60dcffb.tar.gz linux-next-39c58af419d9f6b0356cd7e10ff5abb3e60dcffb.zip | |
pwm: meson: Convert to waveform API
The PWM subsystem introduced a new waveform abstraction that
describes a PWM signal by period length, duty length and duty offset
instead of period, duty cycle and polarity. The meson driver still
uses the legacy .apply() and .get_state() callbacks and does not
implement the waveform callbacks, so consumers cannot use the
pwm_*_waveform() helper functions with it.
Adopt the new API by implementing .round_waveform_tohw(),
.round_waveform_fromhw(), .read_waveform() and .write_waveform()
with a private meson_pwm_waveform struct holding the hardware
representation. The cached channel state fields (rate, hi, lo,
constant, inverted) are removed; counter values are now computed in
.round_waveform_tohw() via clk_round_rate() without register writes,
then committed in .write_waveform().
The hardware invert bit places the duty active phase at the end of the
period on revisions that have it. Input clock rates are kept at or
below 1 GHz so each counter cycle remains representable in nanoseconds
by .round_waveform_fromhw(). Requests for which clk_round_rate() cannot
provide such a rate are rejected. Otherwise, period counts above the
16-bit range are clamped, while a zero count is rounded up to one and
signalled by .round_waveform_tohw() returning 1.
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://patch.msgid.link/20260717-pwm_meson_convert_to_waveform_api-v1-1-d7dbdae1318d@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
