From patchwork Thu Jan 24 20:27:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Chmiel?= X-Patchwork-Id: 10780097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7ED551399 for ; Thu, 24 Jan 2019 20:28:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F6062D48F for ; Thu, 24 Jan 2019 20:28:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 630462E1AC; Thu, 24 Jan 2019 20:28:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 150C02D48F for ; Thu, 24 Jan 2019 20:28:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728395AbfAXU2C (ORCPT ); Thu, 24 Jan 2019 15:28:02 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54563 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728084AbfAXU2A (ORCPT ); Thu, 24 Jan 2019 15:28:00 -0500 Received: by mail-wm1-f67.google.com with SMTP id a62so4585598wmh.4; Thu, 24 Jan 2019 12:27:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+6IfJiCGXlpW+dv24DGIPbhLiY/a5Z0pefOdxLNkgPs=; b=sePglr2n5+N+RPa28bDMFT82KfHBuei3V4a878wR5TOYpuiUowEvgw56bX4z2HmCFC 2GCose1fGUuw/V+/FMTgmdXebl0740MFL5AdZkbrR+uOw27TQXk7XjFPB82suVp3ydwx ig3/F1i9Ayf9c3jd8/M46Ojv2AxLos/lJNigSq+MquOgsuzf/Ysg/5zUwBv5LuTpNEHf 2q+vnbf1OxUbL0i/+JATZM0CpO2STUQfrnDlPr0yHYOh/i0TTp4rqVIUBRl9F7Ibrzy8 2q5RGugAfCtyIMG24TYWYO3YLxOiJYbpbYZy5K9SE8X8Ip1PJzkR/QBJiiIG2Emp1fvg FUzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+6IfJiCGXlpW+dv24DGIPbhLiY/a5Z0pefOdxLNkgPs=; b=LovjbO8UtRmMByeh+sU0LWDPP1yLHMbF/ntiwTNhjiSME8p4E72H4IXgw2cXcyxcPw ltgTfmwC7GhUKdhmVq5cY2D3VaZdFhKueza5PeP8MghQ37dNqonknu5L03Hg/EQTCQpI MEouEQp+AdQutza/nIsSxtZNrJxiMCS6svfFOyaYjfDjT+M8qdHTUzmo4/meJBoSXTKd NYA12DCKRIMGbQDwTeB9NF0/D+4a4Uk9gaqH9yx7hsPK1+wA5dsZl+S8+NMWW6RzBxSA Fkv5nc8/WGJrBTxFbwcJgjlR5ZCSVKgYZzaBfLGYTO9v9lTFq36l6KbLxgu3ZRVutkUx MGXg== X-Gm-Message-State: AJcUukfr7k8SmYFk7cMCXG67zzgolLPvDqxrpujjfNqASBF3FNCoBt0i tVWbb+HXT6OXjlmV4G0ycF8+P8Y2yOc= X-Google-Smtp-Source: ALg8bN7772rhYUqdCQQQ+0xH6mYJHPLxLdHLm3PyD7m8TqeQYB0q1Y4bW6PHt21ydQ2cKQXcLAg6ww== X-Received: by 2002:a1c:4d12:: with SMTP id o18mr4266950wmh.92.1548361678614; Thu, 24 Jan 2019 12:27:58 -0800 (PST) Received: from localhost.localdomain ([2a02:a315:5445:5300:9dbf:5832:1d37:55b2]) by smtp.googlemail.com with ESMTPSA id g67sm128617960wmd.38.2019.01.24.12.27.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 12:27:57 -0800 (PST) From: =?utf-8?q?Pawe=C5=82_Chmiel?= To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Paw?= =?utf-8?q?e=C5=82_Chmiel?= Subject: [PATCH v2 2/2] input: misc: pwm-vibra: Stop regulator after disabling pwm, not before Date: Thu, 24 Jan 2019 21:27:32 +0100 Message-Id: <20190124202732.14723-2-pawel.mikolaj.chmiel@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124202732.14723-1-pawel.mikolaj.chmiel@gmail.com> References: <20190124202732.14723-1-pawel.mikolaj.chmiel@gmail.com> MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes order of disable calls in pwm_vibrator_stop. Currently when starting device, we first enable vcc regulator and then setup and enable pwm. When stopping, we should do this in oposite order, so first disable pwm and then disable regulator. Previously order was the same as in start. Signed-off-by: Paweł Chmiel --- drivers/input/misc/pwm-vibra.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/pwm-vibra.c b/drivers/input/misc/pwm-vibra.c index 9df87431d7d4..dbb6d9e1b947 100644 --- a/drivers/input/misc/pwm-vibra.c +++ b/drivers/input/misc/pwm-vibra.c @@ -80,14 +80,14 @@ static int pwm_vibrator_start(struct pwm_vibrator *vibrator) static void pwm_vibrator_stop(struct pwm_vibrator *vibrator) { + if (vibrator->pwm_dir) + pwm_disable(vibrator->pwm_dir); + pwm_disable(vibrator->pwm); + if (vibrator->vcc_on) { regulator_disable(vibrator->vcc); vibrator->vcc_on = false; } - - if (vibrator->pwm_dir) - pwm_disable(vibrator->pwm_dir); - pwm_disable(vibrator->pwm); } static void pwm_vibrator_play_work(struct work_struct *work)