Re: [PATCH] pwm: tegra: fix doubled output frequency due to divider truncation

From: Uwe Kleine-König

Date: Tue Jul 14 2026 - 08:13:41 EST


Hello again,

On Tue, Jul 14, 2026 at 11:14:58AM +0200, Uwe Kleine-König wrote:
> The usual behaviour for .apply() is to pick the largest possible period
> not larger than the requested period (and similar for duty_cycle). The
> tegra PWM driver doesn't do that and instead trys to pick a nearest
> match. If you change how the configuration happens, the only acceptable
> way is to migrate to the usual behaviour, still better, convert to the
> waveform callbacks.
>
> The driver also lacks a .get_state() callback and should not use
> pwm_is_enabled(). Also calling tegra_pwm_config() discards bits from
> state->duty_cycle and state->period if they are bigger than INT_MAX.
>
> So there are some things to work on in that driver, but don't make the
> clock selection not more complicated as it already is and as is
> necessary.

I started on that, but failed to Cc: you. Please see
https://lore.kernel.org/linux-pwm/cover.1784030076.git.ukleinek@xxxxxxxxxx

Best regards
Uwe

Attachment: signature.asc
Description: PGP signature