Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: deaba9cff809 ("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>

authored by

Fabrice Gasnier and committed by
Uwe Kleine-König
edc19bd0 40384c84

+1 -1
+1 -1
drivers/pwm/pwm-stm32.c
··· 84 84 85 85 wfhw->ccer = TIM_CCER_CCxE(ch + 1); 86 86 if (priv->have_complementary_output) 87 - wfhw->ccer = TIM_CCER_CCxNE(ch + 1); 87 + wfhw->ccer |= TIM_CCER_CCxNE(ch + 1); 88 88 89 89 rate = clk_get_rate(priv->clk); 90 90