Skip to contentSkip to conversation

pwm: tiehrpwm: Update shadow register for disabling PWMs

PATCH Applied Vignesh Raghavendra 2 participants 2 messages Mar 12, 2019 – Mar 20, 2019 PWM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pwm: tiehrpwm: Update shadow register for disabling PWMs

From: Christoph Vogtländer <[email protected]>

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 38dabd91ff0b ("pwm: tiehrpwm: Fix disabling of output of PWMs")
[[email protected]: Improve commit message]
---
 drivers/pwm/pwm-tiehrpwm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/pwm/pwm-tiehrpwm.c +2 -0
index f7b8a86fa5c5..ad4a40c0f27c 100644
@@ -382,6 +382,8 @@ static void ehrpwm_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
 	}
 
 	/* Update shadow register first before modifying active register */
+	ehrpwm_modify(pc->mmio_base, AQSFRC, AQSFRC_RLDCSF_MASK,
+		      AQSFRC_RLDCSF_ZRO);
 	ehrpwm_modify(pc->mmio_base, AQCSFRC, aqcsfrc_mask, aqcsfrc_val);
 	/*
 	 * Changes to immediate action on Action Qualifier. This puts
Signature · 7 lines
2.21.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw
Quoted 12 lines · Vignesh Raghavendra

From: Christoph Vogtländer <[email protected]>

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.

Quoted 7 lines
Fixes 38dabd91ff0b ("pwm: tiehrpwm: Fix disabling of output of PWMs")
[[email protected]: Improve commit message]
---
 drivers/pwm/pwm-tiehrpwm.c | 2 ++
 1 file changed, 2 insertions(+)

Applied, thanks.

Thierry