Skip to content

Commit edc19bd

Browse files
Fabrice GasnierUwe Kleine-König
authored andcommitted
pwm: stm32: Fix complementary output in round_waveform_tohw()
When the timer supports complementary output, the CCxNE bit must be set additionally to the CCxE bit. So to not overwrite the latter use |= instead of = to set the former. Fixes: deaba9c ("pwm: stm32: Implementation of the waveform callbacks") Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Link: https://lore.kernel.org/r/20241217150021.2030213-1-fabrice.gasnier@foss.st.com [ukleinek: Slightly improve commit log] Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
1 parent 40384c8 commit edc19bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pwm/pwm-stm32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static int stm32_pwm_round_waveform_tohw(struct pwm_chip *chip,
8484

8585
wfhw->ccer = TIM_CCER_CCxE(ch + 1);
8686
if (priv->have_complementary_output)
87-
wfhw->ccer = TIM_CCER_CCxNE(ch + 1);
87+
wfhw->ccer |= TIM_CCER_CCxNE(ch + 1);
8888

8989
rate = clk_get_rate(priv->clk);
9090

0 commit comments

Comments
 (0)