Skip to content

Commit b00ef53

Browse files
Christoph Vogtländerthierryreding
authored andcommitted
pwm: tiehrpwm: Update shadow register for disabling PWMs
It must be made sure that immediate mode is not already set, when modifying shadow register value in ehrpwm_pwm_disable(). Otherwise modifications to the action-qualifier continuous S/W force register(AQSFRC) will be done in the active register. This may happen when both channels are being disabled. In this case, only the first channel state will be recorded as disabled in the shadow register. Later, when enabling the first channel again, the second channel would be enabled as well. Setting RLDCSF to zero, first, ensures that the shadow register is updated as desired. Fixes: 38dabd9 ("pwm: tiehrpwm: Fix disabling of output of PWMs") Signed-off-by: Christoph Vogtländer <[email protected]> [[email protected]: Improve commit message] Signed-off-by: Vignesh Raghavendra <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 4448195 commit b00ef53

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
@@ -382,6 +382,8 @@ static void ehrpwm_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
382382
}
383383

384384
/* Update shadow register first before modifying active register */
385+
ehrpwm_modify(pc->mmio_base, AQSFRC, AQSFRC_RLDCSF_MASK,
386+
AQSFRC_RLDCSF_ZRO);
385387
ehrpwm_modify(pc->mmio_base, AQCSFRC, aqcsfrc_mask, aqcsfrc_val);
386388
/*
387389
* Changes to immediate action on Action Qualifier. This puts

0 commit comments

Comments
 (0)