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