Re: [PATCH 1/6] pwm: Let pwm_set_waveform() succeed even if lowlevel driver rounded up

From: Trevor Gamblin
Date: Mon Apr 07 2025 - 08:53:40 EST



On 2025-04-05 05:27, Uwe Kleine-König wrote:
Waveform parameters are supposed to be rounded down to the next value
possible for the hardware. However when a requested value is too small,
.round_waveform_tohw() is supposed to pick the next bigger value and
return 1. Let pwm_set_waveform() behave in the same way.

This creates consistency between pwm_set_waveform_might_sleep() with
exact=false and pwm_round_waveform_might_sleep() +
pwm_set_waveform_might_sleep() with exact=true.

The PWM_DEBUG rounding check has to be adapted to only trigger if no
uprounding happend.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxx>
Tested-by: Trevor Gamblin <tgamblin@xxxxxxxxxxxx>