mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 03:50:24 +09:00
pwm: hibvt: Explicitly set .polarity in .get_state()
[ Upstream commit6f57937980] The driver only both polarities. Complete the implementation of .get_state() by setting .polarity according to the configured hardware state. Fixes:d09f008108("pwm: Add PWM driver for HiSilicon BVT SOCs") Link: https://lore.kernel.org/r/20230228135508.1798428-2-u.kleine-koenig@pengutronix.de 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
547cc8dae2
commit
98ba763cc9
@@ -146,6 +146,7 @@ static int hibvt_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
|
||||
|
||||
value = readl(base + PWM_CTRL_ADDR(pwm->hwpwm));
|
||||
state->enabled = (PWM_ENABLE_MASK & value);
|
||||
state->polarity = (PWM_POLARITY_MASK & value) ? PWM_POLARITY_INVERSED : PWM_POLARITY_NORMAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user