Skip to content

Commit

Permalink
pwm: stm32: Fix complementary output in round_waveform_tohw()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fabrice Gasnier authored and Uwe Kleine-König committed Dec 18, 2024
1 parent 40384c8 commit edc19bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static int stm32_pwm_round_waveform_tohw(struct pwm_chip *chip,

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

rate = clk_get_rate(priv->clk);

Expand Down

0 comments on commit edc19bd

Please sign in to comment.