Skip to content

Commit 69f542a

Browse files
sknseangregkh
authored andcommitted
pwm: stm32: Always program polarity
Commit 7346e7a ("pwm: stm32: Always do lazy disabling") triggered a regression where PWM polarity changes could be ignored. stm32_pwm_set_polarity() was skipped due to a mismatch between the cached pwm->state.polarity and the actual hardware state, leaving the hardware polarity unchanged. Fixes: 7edf736 ("pwm: Add driver for STM32 plaftorm") Cc: stable@vger.kernel.org # <= 6.12 Signed-off-by: Sean Nyekjaer <sean@geanix.com> Co-developed-by: Uwe Kleine-König <ukleinek@kernel.org> Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
1 parent 828b59f commit 69f542a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/pwm/pwm-stm32.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,7 @@ static int stm32_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
458458
return 0;
459459
}
460460

461-
if (state->polarity != pwm->state.polarity)
462-
stm32_pwm_set_polarity(priv, pwm->hwpwm, state->polarity);
461+
stm32_pwm_set_polarity(priv, pwm->hwpwm, state->polarity);
463462

464463
ret = stm32_pwm_config(priv, pwm->hwpwm,
465464
state->duty_cycle, state->period);

0 commit comments

Comments
 (0)