From patchwork Wed May 16 12:28:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 10403799 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 0E9B66037D for ; Wed, 16 May 2018 12:38:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F251928926 for ; Wed, 16 May 2018 12:38:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E725028935; Wed, 16 May 2018 12:38:46 +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 927F528926 for ; Wed, 16 May 2018 12:38:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752119AbeEPMik (ORCPT ); Wed, 16 May 2018 08:38:40 -0400 Received: from mail.bugwerft.de ([46.23.86.59]:34686 "EHLO mail.bugwerft.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751395AbeEPMij (ORCPT ); Wed, 16 May 2018 08:38:39 -0400 Received: from localhost.localdomain (200116b8467d0800fc4322f50d1cf4c2.dip.versatel-1u1.de [IPv6:2001:16b8:467d:800:fc43:22f5:d1c:f4c2]) by mail.bugwerft.de (Postfix) with ESMTPSA id 8B57D282561; Wed, 16 May 2018 12:26:15 +0000 (UTC) From: Daniel Mack To: dmitry.torokhov@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, shawnguo@kernel.org, kernel@pengutronix.de, fabio.estevam@nxp.com Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Daniel Mack Subject: [PATCH 2/3] input: touchscreen: edt-ft5x06: assert reset during suspend Date: Wed, 16 May 2018 14:28:28 +0200 Message-Id: <20180516122829.23694-3-daniel@zonque.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180516122829.23694-1-daniel@zonque.org> References: <20180516122829.23694-1-daniel@zonque.org> 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 If the device is not configured as wakeup source, it can be put in reset during suspend to save some power. Signed-off-by: Daniel Mack --- drivers/input/touchscreen/edt-ft5x06.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 955f085627fa..c34a0b23f90a 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -1036,9 +1036,12 @@ static int edt_ft5x06_ts_remove(struct i2c_client *client) static int __maybe_unused edt_ft5x06_ts_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); + struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); if (device_may_wakeup(dev)) enable_irq_wake(client->irq); + else if (tsdata->reset_gpio) + gpiod_set_value_cansleep(tsdata->reset_gpio, 1); return 0; } @@ -1046,9 +1049,12 @@ static int __maybe_unused edt_ft5x06_ts_suspend(struct device *dev) static int __maybe_unused edt_ft5x06_ts_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); + struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); if (device_may_wakeup(dev)) disable_irq_wake(client->irq); + else if (tsdata->reset_gpio) + gpiod_set_value_cansleep(tsdata->reset_gpio, 0); return 0; }