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: 10533073 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 D7D05602CA for ; Wed, 18 Jul 2018 18:27:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D222029B7F for ; Wed, 18 Jul 2018 18:27:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C603E29B84; Wed, 18 Jul 2018 18:27:51 +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=-7.9 required=2.0 tests=BAYES_00, 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 53A7729B7F for ; Wed, 18 Jul 2018 18:27:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729667AbeGRTGr (ORCPT ); Wed, 18 Jul 2018 15:06:47 -0400 Received: from mail.bootlin.com ([62.4.15.54]:36602 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726992AbeGRTGq (ORCPT ); Wed, 18 Jul 2018 15:06:46 -0400 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 Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mylene.josserand@bootlin.com, thomas.petazzoni@bootlin.com 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 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 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);