Skip to content

Commit 38dabd9

Browse files
r-vigneshthierryreding
authored andcommitted
pwm: tiehrpwm: Fix disabling of output of PWMs
pwm-tiehrpwm driver disables PWM output by putting it in low output state via active AQCSFRC register in ehrpwm_pwm_disable(). But, the AQCSFRC shadow register is not updated. Therefore, when shadow AQCSFRC register is re-enabled in ehrpwm_pwm_enable() (say to enable second PWM output), previous settings are lost as shadow register value is loaded into active register. This results in things like PWMA getting enabled automatically, when PWMB is enabled and vice versa. Fix this by updating AQCSFRC shadow register as well during ehrpwm_pwm_disable(). Fixes: 19891b2 ("pwm: pwm-tiehrpwm: PWM driver support for EHRPWM") Cc: [email protected] Signed-off-by: Vignesh R <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent aa49d62 commit 38dabd9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/pwm/pwm-tiehrpwm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ static void ehrpwm_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
381381
aqcsfrc_mask = AQCSFRC_CSFA_MASK;
382382
}
383383

384+
/* Update shadow register first before modifying active register */
385+
ehrpwm_modify(pc->mmio_base, AQCSFRC, aqcsfrc_mask, aqcsfrc_val);
384386
/*
385387
* Changes to immediate action on Action Qualifier. This puts
386388
* Action Qualifier control on PWM output from next TBCLK

0 commit comments

Comments
 (0)