From patchwork Tue Jan 29 10:44:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Fend X-Patchwork-Id: 10785973 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 13BEB922 for ; Tue, 29 Jan 2019 10:50:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 040D72B0DA for ; Tue, 29 Jan 2019 10:50:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBFFC2B286; Tue, 29 Jan 2019 10:50:07 +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 64AD42B0DA for ; Tue, 29 Jan 2019 10:50:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728492AbfA2KuG (ORCPT ); Tue, 29 Jan 2019 05:50:06 -0500 Received: from rmisp-mx-out4.tele.net ([194.208.23.39]:35529 "EHLO rmisp-mx-out4.tele.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728444AbfA2KuF (ORCPT ); Tue, 29 Jan 2019 05:50:05 -0500 X-Greylist: delayed 340 seconds by postgrey-1.27 at vger.kernel.org; Tue, 29 Jan 2019 05:50:04 EST Received: from localhost.localdomain (91-118-163-37.static.upcbusiness.at [91.118.163.37]) by rmisp-mx-out4.tele.net (Postfix) with ESMTPSA id BD5C8104A7BA; Tue, 29 Jan 2019 11:44:22 +0100 (CET) From: Matthias Fend To: linux-input@vger.kernel.org, devicetree@vger.kernel.org Cc: dmitry.torokhov@gmail.com, martin.kepplinger@ginzinger.com, Matthias Fend Subject: [PATCH v2 1/2] dt-bindings: input: touchscreen: st1232: reference common DT bindings Date: Tue, 29 Jan 2019 11:44:13 +0100 Message-Id: <1548758654-27153-1-git-send-email-matthias.fend@wolfvision.net> X-Mailer: git-send-email 2.7.4 X-Scanned-By: MIMEDefang 2.75 on 194.208.23.39 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 Add a reference to common touchscreen bindings which are also partly supported. Signed-off-by: Matthias Fend Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/input/touchscreen/sitronix-st1232.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/sitronix-st1232.txt b/Documentation/devicetree/bindings/input/touchscreen/sitronix-st1232.txt index 64ad48b..f3046e7 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/sitronix-st1232.txt +++ b/Documentation/devicetree/bindings/input/touchscreen/sitronix-st1232.txt @@ -8,6 +8,8 @@ Required properties: Optional properties: - gpios: a phandle to the reset GPIO +For additional optional properties see: touchscreen.txt + Example: i2c@00000000 { From patchwork Tue Jan 29 10:44:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Fend X-Patchwork-Id: 10785975 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 4B78A188D for ; Tue, 29 Jan 2019 10:50:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D6B32B0DA for ; Tue, 29 Jan 2019 10:50:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31DBC2B285; Tue, 29 Jan 2019 10:50: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=-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 CDF992B27B for ; Tue, 29 Jan 2019 10:50:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728495AbfA2KuF (ORCPT ); Tue, 29 Jan 2019 05:50:05 -0500 Received: from rmisp-mx-out4.tele.net ([194.208.23.39]:35530 "EHLO rmisp-mx-out4.tele.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728492AbfA2KuE (ORCPT ); Tue, 29 Jan 2019 05:50:04 -0500 Received: from localhost.localdomain (91-118-163-37.static.upcbusiness.at [91.118.163.37]) by rmisp-mx-out4.tele.net (Postfix) with ESMTPSA id 1DEE51249839; Tue, 29 Jan 2019 11:44:23 +0100 (CET) From: Matthias Fend To: linux-input@vger.kernel.org, devicetree@vger.kernel.org Cc: dmitry.torokhov@gmail.com, martin.kepplinger@ginzinger.com, Matthias Fend Subject: [PATCH v2 2/2] Input: st1232 - handle common DT bindings Date: Tue, 29 Jan 2019 11:44:14 +0100 Message-Id: <1548758654-27153-2-git-send-email-matthias.fend@wolfvision.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548758654-27153-1-git-send-email-matthias.fend@wolfvision.net> References: <1548758654-27153-1-git-send-email-matthias.fend@wolfvision.net> X-Scanned-By: MIMEDefang 2.75 on 194.208.23.39 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 is required to specify generic touchscreen properties via DT. Signed-off-by: Matthias Fend --- drivers/input/touchscreen/st1232.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c index 11ff32c..6485936 100644 --- a/drivers/input/touchscreen/st1232.c +++ b/drivers/input/touchscreen/st1232.c @@ -21,6 +21,7 @@ #include #include #include +#include #define ST1232_TS_NAME "st1232-ts" @@ -41,6 +42,7 @@ struct st1232_ts_finger { struct st1232_ts_data { struct i2c_client *client; struct input_dev *input_dev; + struct touchscreen_properties prop; struct st1232_ts_finger finger[MAX_FINGERS]; struct dev_pm_qos_request low_latency_req; int reset_gpio; @@ -109,8 +111,8 @@ static irqreturn_t st1232_ts_irq_handler(int irq, void *dev_id) continue; input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, finger[i].t); - input_report_abs(input_dev, ABS_MT_POSITION_X, finger[i].x); - input_report_abs(input_dev, ABS_MT_POSITION_Y, finger[i].y); + touchscreen_report_pos(input_dev, &ts->prop, + finger[i].x, finger[i].y, true); input_mt_sync(input_dev); count++; } @@ -195,6 +197,7 @@ static int st1232_ts_probe(struct i2c_client *client, input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, MAX_AREA, 0, 0); input_set_abs_params(input_dev, ABS_MT_POSITION_X, MIN_X, MAX_X, 0, 0); input_set_abs_params(input_dev, ABS_MT_POSITION_Y, MIN_Y, MAX_Y, 0, 0); + touchscreen_parse_properties(input_dev, true, &ts->prop); error = devm_request_threaded_irq(&client->dev, client->irq, NULL, st1232_ts_irq_handler,