diff options
| author | Uwe Kleine-König <u.kleine-koenig@baylibre.com> | 2025-08-11 18:01:02 +0200 |
|---|---|---|
| committer | Uwe Kleine-König <ukleinek@kernel.org> | 2025-09-15 11:39:43 +0200 |
| commit | 00f83f0e07e44e2f1fb94b223e77ab7b18ee2d7d (patch) | |
| tree | f19be721cccffc2aa15ba024d483d75b48ce997a /rust/helpers/xarray.c | |
| parent | bc7ce5bfc504eea9eac0eb0215017b9fcfc62c59 (diff) | |
pwm: tiehrpwm: Fix corner case in clock divisor calculation
The function set_prescale_div() is responsible for calculating the clock
divisor settings such that the input clock rate is divided down such that
the required period length is at most 0x10000 clock ticks. If period_cycles
is an integer multiple of 0x10000, the divisor period_cycles / 0x10000 is
good enough. So round up in the calculation of the required divisor and
compare it using >= instead of >.
Fixes: 19891b20e7c2 ("pwm: pwm-tiehrpwm: PWM driver support for EHRPWM")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/85488616d7bfcd9c32717651d0be7e330e761b9c.1754927682.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
Diffstat (limited to 'rust/helpers/xarray.c')
0 files changed, 0 insertions, 0 deletions
