From patchwork Wed Jul 18 18:27:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Myl=C3=A8ne_Josserand?= X-Patchwork-Id: 10533079 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A88EA602CA for ; Wed, 18 Jul 2018 18:28:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A128129B82 for ; Wed, 18 Jul 2018 18:28:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9422929B85; Wed, 18 Jul 2018 18:28:31 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4BBE429B82 for ; Wed, 18 Jul 2018 18:28:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PzC9poNZZwEuu6dFtuV/g11w0yCY/D7vJ1I2MGwe3qg=; b=BrpVvXRmFfaE/3 TW+kxqaKbdQ3FoVV6HAw8DAVE33uUcNWp0B6NAfoTDPf8QzhKXPrtQmLY0bV3RBEA7sw3dAA2UiV3 W84U3s3DBMQF6jdK2uIJdf0aYF0b760DkxacVidETJ6V3l6x529vN99Q5uGjOSfoQGL0hgx2be1GS jeUtSnV6uRftRfY8YPtkYhAV/bOoCUeRHn3Nzwtgpe/y+IdC+/ADdBHplcCY6E6STn/y/BLCQJR95 nJ7LYZr4LqsKXFKInmCZhGM1l+7XyLOniBg60TvJbrzVY/ZcpcwZyY0HKjDezKTq3dxvbtyihdoIU Ct63exWghAHyhyBAJE2Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffrBa-00054i-Ni; Wed, 18 Jul 2018 18:28:26 +0000 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffrAy-0004EG-Gv for linux-arm-kernel@lists.infradead.org; Wed, 18 Jul 2018 18:27:53 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 7072B20876; Wed, 18 Jul 2018 20:27:37 +0200 (CEST) Received: from dell-desktop.home (176-137-37-244.abo.bbox.fr [176.137.37.244]) by mail.bootlin.com (Postfix) with ESMTPSA id C6718206A6; Wed, 18 Jul 2018 20:27:36 +0200 (CEST) From: =?UTF-8?q?Myl=C3=A8ne=20Josserand?= To: dmitry.torokhov@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, maxime.ripard@bootlin.com, wens@csie.org Subject: [PATCH v3 2/3] Input: edt-ft5x06 - Set wake/reset values on resume/suspend Date: Wed, 18 Jul 2018 20:27:18 +0200 Message-Id: <20180718182719.29663-3-mylene.josserand@bootlin.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180718182719.29663-1-mylene.josserand@bootlin.com> References: <20180718182719.29663-1-mylene.josserand@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180718_112749_108202_9E0D7ED4 X-CRM114-Status: GOOD ( 10.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, linux-input@vger.kernel.org, mylene.josserand@bootlin.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On resume and suspend, set the value of wake and reset gpios to be sure that we are in a know state after suspending/resuming. Signed-off-by: Mylène Josserand --- drivers/input/touchscreen/edt-ft5x06.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index aa94494b06b5..b013d97006e6 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -1143,6 +1143,12 @@ static int __maybe_unused edt_ft5x06_ts_suspend(struct device *dev) if (device_may_wakeup(dev)) enable_irq_wake(client->irq); + if (tsdata->wake_gpio) + gpiod_set_value(tsdata->wake_gpio, 0); + + if (tsdata->reset_gpio) + gpiod_set_value(tsdata->reset_gpio, 1); + regulator_disable(tsdata->vcc); return 0; @@ -1157,6 +1163,12 @@ static int __maybe_unused edt_ft5x06_ts_resume(struct device *dev) if (device_may_wakeup(dev)) disable_irq_wake(client->irq); + if (tsdata->wake_gpio) + gpiod_set_value(tsdata->wake_gpio, 1); + + if (tsdata->reset_gpio) + gpiod_set_value(tsdata->reset_gpio, 0); + ret = regulator_enable(tsdata->vcc); if (ret < 0) { dev_err(dev, "failed to enable vcc: %d\n", ret);