]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/input-pwm-vibra-stop-regulator-after-disabling-pwm-n.patch
drop some duplicated patches that somehow got merged.
[thirdparty/kernel/stable-queue.git] / queue-4.14 / input-pwm-vibra-stop-regulator-after-disabling-pwm-n.patch
1 From 984b0d83d6d9db803bac3d023a46c0872292f4b6 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Pawe=C5=82=20Chmiel?= <pawel.mikolaj.chmiel@gmail.com>
3 Date: Mon, 28 Jan 2019 11:13:34 -0800
4 Subject: Input: pwm-vibra - stop regulator after disabling pwm, not before
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 [ Upstream commit 94803aef3533676194c772383472636c453e3147 ]
10
11 This patch fixes order of disable calls in pwm_vibrator_stop.
12 Currently when starting device, we first enable vcc regulator and then
13 setup and enable pwm. When stopping, we should do this in oposite order,
14 so first disable pwm and then disable regulator.
15 Previously order was the same as in start.
16
17 Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
18 Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
19 Signed-off-by: Sasha Levin <sashal@kernel.org>
20 ---
21 drivers/input/misc/pwm-vibra.c | 8 ++++----
22 1 file changed, 4 insertions(+), 4 deletions(-)
23
24 diff --git a/drivers/input/misc/pwm-vibra.c b/drivers/input/misc/pwm-vibra.c
25 index 9df87431d7d4..dbb6d9e1b947 100644
26 --- a/drivers/input/misc/pwm-vibra.c
27 +++ b/drivers/input/misc/pwm-vibra.c
28 @@ -80,14 +80,14 @@ static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
29
30 static void pwm_vibrator_stop(struct pwm_vibrator *vibrator)
31 {
32 + if (vibrator->pwm_dir)
33 + pwm_disable(vibrator->pwm_dir);
34 + pwm_disable(vibrator->pwm);
35 +
36 if (vibrator->vcc_on) {
37 regulator_disable(vibrator->vcc);
38 vibrator->vcc_on = false;
39 }
40 -
41 - if (vibrator->pwm_dir)
42 - pwm_disable(vibrator->pwm_dir);
43 - pwm_disable(vibrator->pwm);
44 }
45
46 static void pwm_vibrator_play_work(struct work_struct *work)
47 --
48 2.19.1
49