Skip to content

Commit 2be4dcf

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: sprd: Explicitly set .polarity in .get_state()
The driver only supports normal polarity. Complete the implementation of .get_state() by setting .polarity accordingly. Fixes: 8aae4b0 ("pwm: sprd: Add Spreadtrum PWM support") 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 b20b097 commit 2be4dcf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/pwm/pwm-sprd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ static int sprd_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
109109
duty = val & SPRD_PWM_DUTY_MSK;
110110
tmp = (prescale + 1) * NSEC_PER_SEC * duty;
111111
state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, chn->clk_rate);
112+
state->polarity = PWM_POLARITY_NORMAL;
112113

113114
/* Disable PWM clocks if the PWM channel is not in enable state. */
114115
if (!state->enabled)

0 commit comments

Comments
 (0)