From patchwork Wed May 16 12:28:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 10403795 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 5A8DD601D2 for ; Wed, 16 May 2018 12:38:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BD5128932 for ; Wed, 16 May 2018 12:38:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 302C928936; Wed, 16 May 2018 12:38:42 +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=unavailable 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 9CEDF28932 for ; Wed, 16 May 2018 12:38:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751786AbeEPMik (ORCPT ); Wed, 16 May 2018 08:38:40 -0400 Received: from mail.bugwerft.de ([46.23.86.59]:34682 "EHLO mail.bugwerft.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751389AbeEPMij (ORCPT ); Wed, 16 May 2018 08:38:39 -0400 X-Greylist: delayed 598 seconds by postgrey-1.27 at vger.kernel.org; Wed, 16 May 2018 08:38:39 EDT 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 5C35528255F; Wed, 16 May 2018 12:26:14 +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 1/3] input: touchscreen: edt-ft5x06: make wakeup source behavior configurable Date: Wed, 16 May 2018 14:28:27 +0200 Message-Id: <20180516122829.23694-2-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 Allow configuring the device as wakeup source through device properties, as not all platforms want to wake up on touch screen activity. Note that by default, the device will now no longer be a wakeup source. Signed-off-by: Daniel Mack --- Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt | 3 +++ drivers/input/touchscreen/edt-ft5x06.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt index 025cf8c9324a..83f792d4d88c 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt +++ b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt @@ -52,6 +52,8 @@ Optional properties: - touchscreen-inverted-y : See touchscreen.txt - touchscreen-swapped-x-y : See touchscreen.txt + - wakeup-source: touchscreen acts as wakeup source + Example: polytouch: edt-ft5x06@38 { compatible = "edt,edt-ft5406", "edt,edt-ft5x06"; @@ -62,4 +64,5 @@ Example: interrupts = <5 IRQ_TYPE_EDGE_FALLING>; reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>; wake-gpios = <&gpio4 9 GPIO_ACTIVE_HIGH>; + wakeup-source; }; diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 5bf63f76ddda..955f085627fa 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -1007,7 +1007,8 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client, goto err_remove_attrs; edt_ft5x06_ts_prepare_debugfs(tsdata, dev_driver_string(&client->dev)); - device_init_wakeup(&client->dev, 1); + device_init_wakeup(&client->dev, + device_property_read_bool(dev, "wakeup-source")); dev_dbg(&client->dev, "EDT FT5x06 initialized: IRQ %d, WAKE pin %d, Reset pin %d.\n",