diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-03-22 22:45:40 +0100 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2023-03-23 14:44:40 +0100 |
commit | 6f57937980142715e927697a6ffd2050f38ed6f6 (patch) | |
tree | 2d9cb4bd7bf36153c36748dbc65c04c711cc928f /drivers/pwm/pwm-hibvt.c | |
parent | fe15c26ee26efa11741a7b632e9f23b01aca4cc6 (diff) | |
download | lwn-6f57937980142715e927697a6ffd2050f38ed6f6.tar.gz lwn-6f57937980142715e927697a6ffd2050f38ed6f6.zip |
pwm: hibvt: Explicitly set .polarity in .get_state()
The driver only both polarities. Complete the implementation of
.get_state() by setting .polarity according to the configured hardware
state.
Fixes: d09f00810850 ("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>
Diffstat (limited to 'drivers/pwm/pwm-hibvt.c')
-rw-r--r-- | drivers/pwm/pwm-hibvt.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pwm/pwm-hibvt.c b/drivers/pwm/pwm-hibvt.c index 12c05c155cab..1b9274c5ad87 100644 --- a/drivers/pwm/pwm-hibvt.c +++ b/drivers/pwm/pwm-hibvt.c @@ -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; } |