]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.19/pwm-tiehrpwm-update-shadow-register-for-disabling-pw.patch
4.19-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.19 / pwm-tiehrpwm-update-shadow-register-for-disabling-pw.patch
CommitLineData
37554d48
SL
1From 4b1d35dfc0f31ae08c76a767dcc3aeb2e2365f11 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Christoph=20Vogtl=C3=A4nder?=
3 <c.vogtlaender@sigma-surface-science.com>
4Date: Tue, 12 Mar 2019 14:38:46 +0530
5Subject: pwm: tiehrpwm: Update shadow register for disabling PWMs
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10[ Upstream commit b00ef53053191d3025c15e8041699f8c9d132daf ]
11
12It must be made sure that immediate mode is not already set, when
13modifying shadow register value in ehrpwm_pwm_disable(). Otherwise
14modifications to the action-qualifier continuous S/W force
15register(AQSFRC) will be done in the active register.
16This may happen when both channels are being disabled. In this case,
17only the first channel state will be recorded as disabled in the shadow
18register. Later, when enabling the first channel again, the second
19channel would be enabled as well. Setting RLDCSF to zero, first, ensures
20that the shadow register is updated as desired.
21
22Fixes: 38dabd91ff0b ("pwm: tiehrpwm: Fix disabling of output of PWMs")
23Signed-off-by: Christoph VogtlÃĪnder <c.vogtlaender@sigma-surface-science.com>
24[vigneshr@ti.com: Improve commit message]
25Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
26Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
27Signed-off-by: Sasha Levin <sashal@kernel.org>
28---
29 drivers/pwm/pwm-tiehrpwm.c | 2 ++
30 1 file changed, 2 insertions(+)
31
32diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c
33index f7b8a86fa5c5..ad4a40c0f27c 100644
34--- a/drivers/pwm/pwm-tiehrpwm.c
35+++ b/drivers/pwm/pwm-tiehrpwm.c
36@@ -382,6 +382,8 @@ static void ehrpwm_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
37 }
38
39 /* Update shadow register first before modifying active register */
40+ ehrpwm_modify(pc->mmio_base, AQSFRC, AQSFRC_RLDCSF_MASK,
41+ AQSFRC_RLDCSF_ZRO);
42 ehrpwm_modify(pc->mmio_base, AQCSFRC, aqcsfrc_mask, aqcsfrc_val);
43 /*
44 * Changes to immediate action on Action Qualifier. This puts
45--
462.20.1
47