Skip to content
Commit 50cc7e3e authored by Ondrej Jirman's avatar Ondrej Jirman Committed by Thierry Reding
Browse files

pwm: sun4i: Fix incorrect calculation of duty_cycle/period



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: deb9c462 ("pwm: sun4i: Don't update the state for the caller of pwm_apply_state")
Signed-off-by: default avatarOndrej Jirman <megous@megous.com>
Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 2d3aa06b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment