]> www.infradead.org Git - users/dwmw2/linux.git/commit
pwm: imx27: Fix rounding behavior
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 16 Apr 2020 08:02:45 +0000 (10:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:49:01 +0000 (17:49 +0200)
commitaa21778ddc8b39492d266e4a667734e7ce033ae9
treeebeada87d424ecb1c56bf534b60111ac26db910f
parent14eb4eb5c591a7ae0463d5960b3ba2be6a780ee5
pwm: imx27: Fix rounding behavior

[ Upstream commit aef1a3799b5cb3ba4841f6034497b179646ccc70 ]

To not trigger the warnings provided by CONFIG_PWM_DEBUG

 - use up-rounding in .get_state()
 - don't divide by the result of a division
 - don't use the rounded counter value for the period length to calculate
   the counter value for the duty cycle

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pwm/pwm-imx27.c