pwm: tiehrpwm: Fix corner case in clock divisor calculation
[ Upstream commit 00f83f0e ] 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: 19891b20 ("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> Signed-off-by:
Sasha Levin <sashal@kernel.org>
Loading
Please sign in to comment