diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-03-23 00:45:43 +0300 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2023-03-23 16:44:42 +0300 |
commit | 2be4dcf6627e1bcbbef8e6ba1811f5127d39202c (patch) | |
tree | 912454f30d2de7e3e567b3d8402b522df9953aa8 /drivers/pwm/pwm-sprd.c | |
parent | b20b097128d9145fadcea1cbb45c4d186cb57466 (diff) | |
download | linux-2be4dcf6627e1bcbbef8e6ba1811f5127d39202c.tar.xz |
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: 8aae4b02e8a6 ("pwm: sprd: Add Spreadtrum PWM support")
Link: https://lore.kernel.org/r/20230228135508.1798428-5-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-sprd.c')
-rw-r--r-- | drivers/pwm/pwm-sprd.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pwm/pwm-sprd.c b/drivers/pwm/pwm-sprd.c index d866ce345f97..bde579a338c2 100644 --- a/drivers/pwm/pwm-sprd.c +++ b/drivers/pwm/pwm-sprd.c @@ -109,6 +109,7 @@ static int sprd_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, duty = val & SPRD_PWM_DUTY_MSK; tmp = (prescale + 1) * NSEC_PER_SEC * duty; state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, chn->clk_rate); + state->polarity = PWM_POLARITY_NORMAL; /* Disable PWM clocks if the PWM channel is not in enable state. */ if (!state->enabled) |