arch/stm32f7: Clear all PWM channel when during STOP

I noticed when executing pwm STOP command in
multichannel mode, the channel still outputting.

This commit fixes this issue.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
This commit is contained in:
Alan Carvalho de Assis
2024-02-15 12:50:25 -03:00
committed by Xiang Xiao
parent 6d346793ee
commit 5975b25951
+7
View File
@@ -4007,6 +4007,13 @@ static int pwm_stop(struct pwm_lowerhalf_s *dev)
outputs = pwm_outputs_from_channels(priv);
ret = pwm_outputs_enable(dev, outputs, false);
/* Clear all channels */
pwm_putreg(priv, STM32_GTIM_CCR1_OFFSET, 0);
pwm_putreg(priv, STM32_GTIM_CCR2_OFFSET, 0);
pwm_putreg(priv, STM32_GTIM_CCR3_OFFSET, 0);
pwm_putreg(priv, STM32_GTIM_CCR4_OFFSET, 0);
leave_critical_section(flags);
pwm_dumpregs(dev, "After stop");