Commit 40a6b9a0 authored by Thierry Reding's avatar Thierry Reding

Revert "pwm: Let pwm_get_state() return the last implemented state"

It turns out that commit 01ccf903 ("pwm: Let pwm_get_state() return
the last implemented state") causes backlight failures on a number of
boards. The reason is that some of the drivers do not write the full
state through to the hardware registers, which means that ->get_state()
subsequently does not return the correct state. Consumers which rely on
pwm_get_state() returning the current state will therefore get confused
and subsequently try to program a bad state.

Before this change can be made, existing drivers need to be more
carefully audited and fixed to behave as the framework expects. Until
then, keep the original behaviour of returning the software state that
was applied rather than reading the state back from hardware.
Reviewed-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tested-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
Tested-by: default avatarMichal Vokáč <michal.vokac@ysoft.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 54ecb8f7
......@@ -472,13 +472,6 @@ int pwm_apply_state(struct pwm_device *pwm, const struct pwm_state *state)
if (err)
return err;
/*
* .apply might have to round some values in *state, if possible
* read the actually implemented value back.
*/
if (chip->ops->get_state)
chip->ops->get_state(chip, pwm, &pwm->state);
else
pwm->state = *state;
} else {
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment