]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.69/pwm-tiehrpwm-fix-disabling-of-output-of-pwms.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.69 / pwm-tiehrpwm-fix-disabling-of-output-of-pwms.patch
1 From 38dabd91ff0bde33352ca3cc65ef515599b77a05 Mon Sep 17 00:00:00 2001
2 From: Vignesh R <vigneshr@ti.com>
3 Date: Mon, 11 Jun 2018 11:39:56 +0530
4 Subject: pwm: tiehrpwm: Fix disabling of output of PWMs
5
6 From: Vignesh R <vigneshr@ti.com>
7
8 commit 38dabd91ff0bde33352ca3cc65ef515599b77a05 upstream.
9
10 pwm-tiehrpwm driver disables PWM output by putting it in low output
11 state via active AQCSFRC register in ehrpwm_pwm_disable(). But, the
12 AQCSFRC shadow register is not updated. Therefore, when shadow AQCSFRC
13 register is re-enabled in ehrpwm_pwm_enable() (say to enable second PWM
14 output), previous settings are lost as shadow register value is loaded
15 into active register. This results in things like PWMA getting enabled
16 automatically, when PWMB is enabled and vice versa. Fix this by
17 updating AQCSFRC shadow register as well during ehrpwm_pwm_disable().
18
19 Fixes: 19891b20e7c2 ("pwm: pwm-tiehrpwm: PWM driver support for EHRPWM")
20 Cc: stable@vger.kernel.org
21 Signed-off-by: Vignesh R <vigneshr@ti.com>
22 Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
23 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24
25 ---
26 drivers/pwm/pwm-tiehrpwm.c | 2 ++
27 1 file changed, 2 insertions(+)
28
29 --- a/drivers/pwm/pwm-tiehrpwm.c
30 +++ b/drivers/pwm/pwm-tiehrpwm.c
31 @@ -381,6 +381,8 @@ static void ehrpwm_pwm_disable(struct pw
32 aqcsfrc_mask = AQCSFRC_CSFA_MASK;
33 }
34
35 + /* Update shadow register first before modifying active register */
36 + ehrpwm_modify(pc->mmio_base, AQCSFRC, aqcsfrc_mask, aqcsfrc_val);
37 /*
38 * Changes to immediate action on Action Qualifier. This puts
39 * Action Qualifier control on PWM output from next TBCLK