Skip to content

Commit 3f6edd1

Browse files
Christoph VogtländerLee Jones
authored andcommitted
pwm: tiehrpwm: Update shadow register for disabling PWMs
[ Upstream commit b00ef53 ] 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 <c.vogtlaender@sigma-surface-science.com> [vigneshr@ti.com: Improve commit message] Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Change-Id: Ic60775dd6aa795cecce9972f390e0c169ec31406
1 parent b8339cb commit 3f6edd1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/pwm/pwm-tiehrpwm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,8 @@ static void ehrpwm_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
385385
}
386386

387387
/* Update shadow register first before modifying active register */
388+
ehrpwm_modify(pc->mmio_base, AQSFRC, AQSFRC_RLDCSF_MASK,
389+
AQSFRC_RLDCSF_ZRO);
388390
ehrpwm_modify(pc->mmio_base, AQCSFRC, aqcsfrc_mask, aqcsfrc_val);
389391
/*
390392
* Changes to immediate action on Action Qualifier. This puts

0 commit comments

Comments
 (0)