Skip to content

Commit 6f57937

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
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: d09f008 ("pwm: Add PWM driver for HiSilicon BVT SOCs") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent fe15c26 commit 6f57937

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/pwm/pwm-hibvt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ static int hibvt_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
146146

147147
value = readl(base + PWM_CTRL_ADDR(pwm->hwpwm));
148148
state->enabled = (PWM_ENABLE_MASK & value);
149+
state->polarity = (PWM_POLARITY_MASK & value) ? PWM_POLARITY_INVERSED : PWM_POLARITY_NORMAL;
149150

150151
return 0;
151152
}

0 commit comments

Comments
 (0)