Ondrej Jirman e70290bb1f pwm: sun4i: Fix incorrect calculation of duty_cycle/period
[ Upstream commit 50cc7e3e4f26e3bf5ed74a8d061195c4d2161b8b ]

Since 5.4-rc1, pwm_apply_state calls ->get_state after ->apply
if available, and this revealed an issue with integer precision
when calculating duty_cycle and period for the currently set
state in ->get_state callback.

This issue manifested in broken backlight on several Allwinner
based devices.

Previously this worked, because ->apply updated the passed state
directly.

Fixes: deb9c462f4e53 ("pwm: sun4i: Don't update the state for the caller of pwm_apply_state")
Signed-off-by: Ondrej Jirman <megous@megous.com>
Acked-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>
2020-01-26 10:01:04 +01:00
..
2019-09-27 12:19:47 -07:00
2019-09-21 01:15:48 +02:00
2019-05-09 17:09:54 +02:00
2019-09-27 12:19:47 -07:00
2019-01-16 08:45:33 +01:00
2019-07-09 08:57:45 -07:00