From patchwork Thu Sep 20 14:22:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 10607819 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 CF8FC14BD for ; Thu, 20 Sep 2018 14:23:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C067A2D592 for ; Thu, 20 Sep 2018 14:23:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE8002D809; Thu, 20 Sep 2018 14:23:00 +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 58C862D592 for ; Thu, 20 Sep 2018 14:23:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732257AbeITUGm (ORCPT ); Thu, 20 Sep 2018 16:06:42 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:44827 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731678AbeITUGm (ORCPT ); Thu, 20 Sep 2018 16:06:42 -0400 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7] helo=dude.pengutronix.de.) by metis.ext.pengutronix.de with esmtp (Exim 4.89) (envelope-from ) id 1g2zr7-0004kr-AH; Thu, 20 Sep 2018 16:22:57 +0200 From: Lucas Stach To: Dmitry Torokhov , Rob Herring Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, patchwork-lst@pengutronix.de, kernel@pengutronix.de, Chris Healy Subject: [PATCH 3/4] Input: egalax_ts - add property for protocol version Date: Thu, 20 Sep 2018 16:22:55 +0200 Message-Id: <20180920142256.2788-3-l.stach@pengutronix.de> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180920142256.2788-1-l.stach@pengutronix.de> References: <20180920142256.2788-1-l.stach@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.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 EETI changed the i2c protocol in an incompatible way at some point. The documentation doesn't state if there is a way to autodetect the used protocol. Thus we introduce a DT property to let the driver know about the protocol version used by the touch controller. Signed-off-by: Lucas Stach --- .../devicetree/bindings/input/touchscreen/egalax-ts.txt | 8 ++++++++ drivers/input/touchscreen/egalax_ts.c | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt b/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt index 92fb2620f5e2..41be6287589d 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt +++ b/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt @@ -7,6 +7,13 @@ Required properties: - wakeup-gpios: the gpio pin to be used for waking up the controller and also used as irq pin +Optional properties: +- eeti,protocol-version: protocol version used by the controller + 0: This is the default protocol used when the property is absent. This + protocol supports up to 5 touch points with 1 points per report. + 1: Protocol supports up to 10 touch points with a maximum of 5 points + per report. + Example: touchscreen@4 { @@ -15,4 +22,5 @@ Example: interrupt-parent = <&gpio1>; interrupts = <9 2>; wakeup-gpios = <&gpio1 9 0>; + eeti,protocol-version = <1>; }; diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c index 4c751f8f806d..0f924d8c17c8 100644 --- a/drivers/input/touchscreen/egalax_ts.c +++ b/drivers/input/touchscreen/egalax_ts.c @@ -58,6 +58,7 @@ struct egalax_ts { struct i2c_client *client; struct input_dev *input_dev; + int protocol_version; struct touchscreen_properties props; }; @@ -195,6 +196,9 @@ static int egalax_ts_probe(struct i2c_client *client, return error; } + of_property_read_u32(client->dev.of_node, "eeti,protocol-version", + &ts->protocol_version); + input_dev->name = "EETI eGalax Touch Screen"; input_dev->id.bustype = BUS_I2C;