From patchwork Sun Mar 21 14:10:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12153083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 225A2C433E1 for ; Sun, 21 Mar 2021 14:11:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB71961944 for ; Sun, 21 Mar 2021 14:11:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229984AbhCUOLO (ORCPT ); Sun, 21 Mar 2021 10:11:14 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:43109 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbhCUOLF (ORCPT ); Sun, 21 Mar 2021 10:11:05 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6B5205C010E; Sun, 21 Mar 2021 10:11:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 21 Mar 2021 10:11:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=WXcDtVZ73/eGv RVLeoiMWZHr3ueha3vyUKfjsdTInIo=; b=EiowsjA3okfqIkEcIAmPUtVOxhfM3 Y5fedl4rmZOL9VCCShxdQamwEKL7D0IGO0jOHppQzxIjW8aQaceFSpo9zfLxUcpj ZPiD2DbAMvTdwaTofBBsiko6yO5c4CfAc3UFgBIxPMOfe8SxT0LYmRl1lrS7QedJ 96Ps4T7q/7/YuqSgnhn9Qv0FbnVI4ZTG0PG9h4D+Z+iV/IPypZ0D/ZA+6/xTEThl HSCKNu9KQwTS0Wx94iZPSBJMlNJUCj+SXFl44Ge5Xwrx+mKQq6RDjkTqoktUvJ3D lAxIJfFZRpTz9Jmuoh6OpljPbQTHnEUbjLIORf2UC9uVnl4+EDaGdupeg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=WXcDtVZ73/eGvRVLeoiMWZHr3ueha3vyUKfjsdTInIo=; b=bTYywoon ldrOj3nJLw2xIjQN2wYGlqN5XEn1FcJXajcqXecOMqxE0rc2S71uzH1kdiygtIZ1 YS/bi0Fav1qs7VGd9jS7z0NJABHACnp0Z5TRPZFA8Cnx4AfB1IgXEmvpaekZ8PIo nbHoJ1Dq8IawFXwxHJNAsk/Q3TLfTIGGvIDu+m3+njiBZoCmtEDPeLC1KwRitLQT Eyp6fh1JA5LP1kxJ7DePYpWhY32P/0lWkNV5RIgR0mhXY+uIENkMym66ldtXdFhU JWD0lluuHd023AX0km6U+snaszDbSGnPMFlkLC4/i5fMkWZ72IJn7oS0k+U+5y/R dww5X925+ndNJQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegvddgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepudelfedr vdejrddufedrvdefheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [193.27.13.235]) by mail.messagingengine.com (Postfix) with ESMTPA id 4818A2400CC; Sun, 21 Mar 2021 10:11:04 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 1/9] dt-bindings: Add Wacom to vendor bindings Date: Sun, 21 Mar 2021 10:10:41 -0400 Message-Id: <20210321141049.148-2-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210321141049.148-1-alistair@alistair23.me> References: <20210321141049.148-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Signed-off-by: Alistair Francis --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index a8e1e8d2ef20..996f4de2fff5 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1216,6 +1216,8 @@ patternProperties: description: Vision Optical Technology Co., Ltd. "^vxt,.*": description: VXT Ltd + "^wacom,.*": + description: Wacom Co., Ltd "^wand,.*": description: Wandbord (Technexion) "^waveshare,.*": From patchwork Sun Mar 21 14:10:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12153079 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A6EAC433E2 for ; Sun, 21 Mar 2021 14:11:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D8EB261943 for ; Sun, 21 Mar 2021 14:11:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229991AbhCUOLO (ORCPT ); Sun, 21 Mar 2021 10:11:14 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:44141 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229901AbhCUOLG (ORCPT ); Sun, 21 Mar 2021 10:11:06 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4EC135C00B1; Sun, 21 Mar 2021 10:11:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 21 Mar 2021 10:11:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=QilBSQELC5Jps eLwMvLp8OTL2JP7KPgW34CJqSKOLUw=; b=rSWqdiX0lwxLSRT5se1fuKm/g7q8z 5qdTB+0+3ESx9iKwdfq4mvAVLteD9L4DVDDbIbmoGtLnp6Ffx4tU9T2Sp19uISQG 9cBPlRzQMqSi+xYyqVU20bL2UpF4Yyzob/cInpYDQqSBNOPJzhIeNKQVWZYltCZu 5dNKZOTC0aS/O/3/yXemiGCv68h8p587qshqQ4vK8nNQLDMvBD9g7CW85nrQdSTC qiiA2fhIQPFAvC6lUrw6tEx9Z4Fg4DW16CL3ZZUz+5EUkNqbaru2CQyDYqG6f05z S70C0v0nvNjVmCiFQzxvU370xpy5XWVitgDOcDXLJwv0xgk+OFduUmjiQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=QilBSQELC5JpseLwMvLp8OTL2JP7KPgW34CJqSKOLUw=; b=ibT9hFk4 b3TmO13s8Al0mMAoRGhsskpGqA7+nU0idzycomOWiQDIxWmLsbjrr6TRbzC7yU0A nPGidDrTVaFBsiDElZvT7LEyrprR3Wi1n80X3rryouU2S3RLs2+o89Qo+8ykcTn8 3CjTgZ72Nc0PWFQ84phG5DWBF0URpcOfyOBvMe9YZlPqGyUvmQg6iLPZFZCd4mPJ dB6kE+AX1M8HIQmlMBDQdONslSlt5Jwq2U0ol8OBSY0OERdQCQ4j2Q2BBBQWiwEB HOv+Z7oNRBcADasDHpBW2/Jm93p4QZnmAf0nqZTfGz5nghGK5seNVJzRXwOUvRIt rG6Cj7jOTJafKg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegvddgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpefftdfhgfeggf elgfekjefhkeeigfelleefhfethfehfeetleeggeeggfefffdvtdenucffohhmrghinhep uggvvhhitggvthhrvggvrdhorhhgnecukfhppeduleefrddvjedrudefrddvfeehnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [193.27.13.235]) by mail.messagingengine.com (Postfix) with ESMTPA id 6AF22240138; Sun, 21 Mar 2021 10:11:05 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 2/9] dt-bindings: touchscreen: Initial commit of wacom,generic Date: Sun, 21 Mar 2021 10:10:42 -0400 Message-Id: <20210321141049.148-3-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210321141049.148-1-alistair@alistair23.me> References: <20210321141049.148-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Signed-off-by: Alistair Francis --- .../input/touchscreen/wacom,generic.yaml | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/wacom,generic.yaml diff --git a/Documentation/devicetree/bindings/input/touchscreen/wacom,generic.yaml b/Documentation/devicetree/bindings/input/touchscreen/wacom,generic.yaml new file mode 100644 index 000000000000..19bbfc55ed76 --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/wacom,generic.yaml @@ -0,0 +1,48 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/wacom,generic.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Wacom I2C Controller + +maintainers: + - Alistair Francis + +allOf: + - $ref: touchscreen.yaml# + +properties: + compatible: + const: wacom,generic + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + vdd-supply: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +examples: + - | + #include "dt-bindings/interrupt-controller/irq.h" + i2c { + #address-cells = <1>; + #size-cells = <0>; + digitiser@9 { + compatible = "wacom,generic"; + reg = <0x9>; + interrupt-parent = <&gpio1>; + interrupts = <9 IRQ_TYPE_LEVEL_LOW>; + vdd-supply = <®_touch>; + }; + }; From patchwork Sun Mar 21 14:10:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12153081 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE13CC433E0 for ; Sun, 21 Mar 2021 14:11:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE2126024A for ; Sun, 21 Mar 2021 14:11:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229996AbhCUOLP (ORCPT ); Sun, 21 Mar 2021 10:11:15 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:48109 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229903AbhCUOLH (ORCPT ); Sun, 21 Mar 2021 10:11:07 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6CB925C00FF; Sun, 21 Mar 2021 10:11:07 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 21 Mar 2021 10:11:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=0KBDSN+M//14L U3MrMHPCIQQOcg9+lHSbWSqHVh3st8=; b=qoNtAcyNRPweYLi5sQmbqpiUK/ZI+ /HsSd+gJqVkdNHhQWtTCrwi3UGOJ1dNYY+d8ePP/nl3XyfNVgEPw5oWthSP7iSRE M1ZA0HRxQ+4JfsvEQBmZZRfBZMVOBLQX2Qn9aYUJ6mVmoudu4W4RESPeUGqWB8FA 90klhyX8oTiEZw2i4z/khnKufuRc56fxunkmXE1mhEjrFp/pJApIPzhOttRuXJlW oTWya98/Khk1QKh4Ox2vgLUDgdaB8f9rTtvtrK8RahdBni/WHaoklE7Jq87zXTyz xJ395qTWG0dWCkZabDMaEeJyomOyIpxLR0uvhx4z9kZXA5fUB3GwKgOkQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=0KBDSN+M//14LU3MrMHPCIQQOcg9+lHSbWSqHVh3st8=; b=SMsRnAMZ VudWXUuidvsyli9GCzV3eHKnRBW1eg3po9fqGdlg2fl/qZq9EiFA7VkxX4ObEuhG hzJx9/1ggdwKE8CpFeEBylF5jjQH83Z5/knIOCg6e0t1mcc434Vhc+PI94ZpNlnk Ju3lYsK9DsVBzY75CNUpmmbzwUQC1Vez/9uEN9pgJQuhsYOx4n0MuE4HNH1OKKFI jgHVAxG4JK43KKxNbqtLkB8d7nNU4KIc/jXZE6pN6YQYejO36VO8qwuthIrgkcQT fl8CNoU2HD/rcAQAxZGhFVodOCJ5/BLhPfXPcWIqeLRP8HX9TfPCdEgJWhIeCjsI zBoW/mKw9hHuYA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegvddgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepudelfedr vdejrddufedrvdefheenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [193.27.13.235]) by mail.messagingengine.com (Postfix) with ESMTPA id 7306D2400CC; Sun, 21 Mar 2021 10:11:06 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 3/9] Input: wacom_i2c - Add device tree support to wacom_i2c Date: Sun, 21 Mar 2021 10:10:43 -0400 Message-Id: <20210321141049.148-4-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210321141049.148-1-alistair@alistair23.me> References: <20210321141049.148-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Allow the wacom-i2c device to be exposed via device tree. Signed-off-by: Alistair Francis --- drivers/input/touchscreen/wacom_i2c.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index 1afc6bde2891..fc0bf583d33b 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #define WACOM_CMD_QUERY0 0x04 @@ -262,10 +263,17 @@ static const struct i2c_device_id wacom_i2c_id[] = { }; MODULE_DEVICE_TABLE(i2c, wacom_i2c_id); +static const struct of_device_id wacom_i2c_of_match_table[] __maybe_unused = { + { .compatible = "wacom,generic" }, + {} +}; +MODULE_DEVICE_TABLE(of, wacom_i2c_of_match_table); + static struct i2c_driver wacom_i2c_driver = { .driver = { .name = "wacom_i2c", .pm = &wacom_i2c_pm, + .of_match_table = of_match_ptr(wacom_i2c_of_match_table), }, .probe = wacom_i2c_probe, From patchwork Sun Mar 21 14:10:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12153091 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 440ADC433E5 for ; Sun, 21 Mar 2021 14:11:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2588561943 for ; Sun, 21 Mar 2021 14:11:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230001AbhCUOLP (ORCPT ); Sun, 21 Mar 2021 10:11:15 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:55823 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229904AbhCUOLJ (ORCPT ); Sun, 21 Mar 2021 10:11:09 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 73B495C0113; Sun, 21 Mar 2021 10:11:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 21 Mar 2021 10:11:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=ozbx/JQs71euy yD3wNF0SDO5Kj17AC4ow5F+feJkDnU=; b=TOQq10sdpDReyH0+moqlUBa64Ezmf BTgLjQP0qTTnXmEJvHHRqLKRvtwVBJ64zxg3p8YOilZz0XivEwtnWnd/pouiO6et 8uwJU2K8eJhrX+ariUWNxmCtUPB6cvaYVlnG4cp7LwjpTdR8cjzQJX1luMAo9Fim mQlfrmV6tOeBWDSmT5ndodWkY/dlRZXOYdoKHGELma63QDF0QyXCU1i0EqdbTWS8 iKhkPrYEHmE70C88EZn1CGsJfKPI42fCFbMjX+Ykh/mHjjZXmr5QmGM8CgXBAjeE 9JdbCKd+vY+FCfMGA4tNISAWKiBoMy8tJvfT8KXfPegt3PjwLYwpexmIA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=ozbx/JQs71euyyD3wNF0SDO5Kj17AC4ow5F+feJkDnU=; b=di2JMI0M qwDO9jwlF5qmfmiI3+ovh1WWvhcowiEsY7Y6YyTeuEoZAv5TmB3g11oCexuuauKM c6YZrfZOWnAhG7V7wk0VFILNyoBQdw3K3TtsTd0DuIUwLymm2BuiIw1uPp9ZwbcH SztUDz40laVhUVMThI8A4e/nnpUkJsXQF71ym8Khw/RUGC7CsmDRS0zNNa0KJ1un ESdg2foMfyLSplmjeYkUbP+Jz4PdxeTER5qWeojZmpvlLPTbeNcxwrX0WJuqSsG/ dlqbo1lzQaDK73y9yahjLJNNwViDmV/UDv4+iG9wDkYskdi/qjZ9A0B2FpKt8uWs JUKSAgUfr4ECwg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegvddgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepudelfedr vdejrddufedrvdefheenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [193.27.13.235]) by mail.messagingengine.com (Postfix) with ESMTPA id 7B28F240138; Sun, 21 Mar 2021 10:11:07 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 4/9] Input: wacom_i2c - Add touchscren properties Date: Sun, 21 Mar 2021 10:10:44 -0400 Message-Id: <20210321141049.148-5-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210321141049.148-1-alistair@alistair23.me> References: <20210321141049.148-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Connect touchscreen properties to the wacom_i2c. Signed-off-by: Alistair Francis --- drivers/input/touchscreen/wacom_i2c.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index fc0bf583d33b..9b2ed0463d09 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -33,6 +34,7 @@ struct wacom_features { struct wacom_i2c { struct i2c_client *client; struct input_dev *input; + struct touchscreen_properties props; u8 data[WACOM_QUERY_SIZE]; bool prox; int tool; @@ -188,6 +190,7 @@ static int wacom_i2c_probe(struct i2c_client *client, __set_bit(BTN_STYLUS2, input->keybit); __set_bit(BTN_TOUCH, input->keybit); + touchscreen_parse_properties(input, true, &wac_i2c->props); input_set_abs_params(input, ABS_X, 0, features.x_max, 0, 0); input_set_abs_params(input, ABS_Y, 0, features.y_max, 0, 0); input_set_abs_params(input, ABS_PRESSURE, From patchwork Sun Mar 21 14:10:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12153085 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D29DC433E3 for ; Sun, 21 Mar 2021 14:11:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 109CC61946 for ; Sun, 21 Mar 2021 14:11:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230006AbhCUOLP (ORCPT ); Sun, 21 Mar 2021 10:11:15 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:55833 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbhCUOLJ (ORCPT ); Sun, 21 Mar 2021 10:11:09 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 7077D5C010D; Sun, 21 Mar 2021 10:11:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 21 Mar 2021 10:11:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=K095MDsa2rzvq +bTQ66D8DiKMgrE+in12AqXZ5ineXk=; b=nkC4TZFtCMuS0Cnbps014mBNRY6B1 YeEwjobF1HkC85esKZ68D3PttjN+fXb24K8aeNAlh+ilJp2mOlr045DTrcQ+75PA X9ZSYujsCnUz4E98QFsRSkeuJ8hfXfNLUFoCqkNr1o2XNWi84tqJwKUDwQ0VO5fi NaqiX7E77S8Rrb+qlP42wA3kJo8sCR9b2mKISQs7spdYt+oB2Vg444RZzI4uh0Nt 7Nn/ewbSaxNZLqSkW7fnLoUz8X2Gi5wRtNs8Oj8tfkZsGA6ZEEQSQYajloxgxSKe IThYbsxyslwkinxNVipJRrBvhCjqwJy2lJ7o5nqpWDT8dHmpvzzkdeVPQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=K095MDsa2rzvq+bTQ66D8DiKMgrE+in12AqXZ5ineXk=; b=L6q7vKd/ vr2PpeaH1Ndmb4xPgZNXgXFCNQ/BVvMwLkZe8vRPuesJFP/a28kFVEfb/HzhqmFS DeByvGVJxvQNlvoMHG7oxi5oDo0EqNLY4uusI6CIEtdJW+JwaeE5WwGY1htack0L EdNWjmYu0nZoh8Qu4drSTZkwJJWzyC8+U1+Dr0zXBw5uCpE2CVWGnm1jJrApGJ+E sazH3BBDNXsxyb9khilNmM8NcUUy0dhNziZrZalVIU7xrSjZgKtGg7ejvQNBB5rc yrTS8QB/NL66YUwSHs7lDjRnhi0kjfV3JDBpA0XvdlMRD4an5IysWNmBIIbxkdRq LirBsVqk2p34xA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegvddgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepudelfedr vdejrddufedrvdefheenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [193.27.13.235]) by mail.messagingengine.com (Postfix) with ESMTPA id 7EBD2240138; Sun, 21 Mar 2021 10:11:08 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 5/9] Input: wacom_i2c - Add support for distance and tilt x/y Date: Sun, 21 Mar 2021 10:10:45 -0400 Message-Id: <20210321141049.148-6-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210321141049.148-1-alistair@alistair23.me> References: <20210321141049.148-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org This is based on the out of tree rM2 driver. Signed-off-by: Alistair Francis --- drivers/input/touchscreen/wacom_i2c.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index 9b2ed0463d09..929680dce9cf 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -22,12 +22,16 @@ #define WACOM_CMD_QUERY3 0x02 #define WACOM_CMD_THROW0 0x05 #define WACOM_CMD_THROW1 0x00 -#define WACOM_QUERY_SIZE 19 +#define WACOM_QUERY_SIZE 22 struct wacom_features { int x_max; int y_max; int pressure_max; + int distance_max; + int distance_physical_max; + int tilt_x_max; + int tilt_y_max; char fw_version; }; @@ -79,6 +83,10 @@ static int wacom_query_device(struct i2c_client *client, features->y_max = get_unaligned_le16(&data[5]); features->pressure_max = get_unaligned_le16(&data[11]); features->fw_version = get_unaligned_le16(&data[13]); + features->distance_max = data[15]; + features->distance_physical_max = data[16]; + features->tilt_x_max = get_unaligned_le16(&data[17]); + features->tilt_y_max = get_unaligned_le16(&data[19]); dev_dbg(&client->dev, "x_max:%d, y_max:%d, pressure:%d, fw:%d\n", @@ -95,6 +103,7 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) u8 *data = wac_i2c->data; unsigned int x, y, pressure; unsigned char tsw, f1, f2, ers; + short tilt_x, tilt_y, distance; int error; error = i2c_master_recv(wac_i2c->client, @@ -109,6 +118,11 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) x = le16_to_cpup((__le16 *)&data[4]); y = le16_to_cpup((__le16 *)&data[6]); pressure = le16_to_cpup((__le16 *)&data[8]); + distance = data[10]; + + /* Signed */ + tilt_x = le16_to_cpup((__le16 *)&data[11]); + tilt_y = le16_to_cpup((__le16 *)&data[13]); if (!wac_i2c->prox) wac_i2c->tool = (data[3] & 0x0c) ? @@ -123,6 +137,9 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) input_report_abs(input, ABS_X, x); input_report_abs(input, ABS_Y, y); input_report_abs(input, ABS_PRESSURE, pressure); + input_report_abs(input, ABS_DISTANCE, distance); + input_report_abs(input, ABS_TILT_X, tilt_x); + input_report_abs(input, ABS_TILT_Y, tilt_y); input_sync(input); out: @@ -195,7 +212,11 @@ static int wacom_i2c_probe(struct i2c_client *client, input_set_abs_params(input, ABS_Y, 0, features.y_max, 0, 0); input_set_abs_params(input, ABS_PRESSURE, 0, features.pressure_max, 0, 0); - + input_set_abs_params(input, ABS_DISTANCE, 0, features.distance_max, 0, 0); + input_set_abs_params(input, ABS_TILT_X, -features.tilt_x_max, + features.tilt_x_max, 0, 0); + input_set_abs_params(input, ABS_TILT_Y, -features.tilt_y_max, + features.tilt_y_max, 0, 0); input_set_drvdata(input, wac_i2c); error = request_threaded_irq(client->irq, NULL, wacom_i2c_irq, From patchwork Sun Mar 21 14:10:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12153089 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BC25C433E8 for ; Sun, 21 Mar 2021 14:11:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62CAD61943 for ; Sun, 21 Mar 2021 14:11:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230022AbhCUOLQ (ORCPT ); Sun, 21 Mar 2021 10:11:16 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:47153 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229920AbhCUOLK (ORCPT ); Sun, 21 Mar 2021 10:11:10 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6B6A85C0116; Sun, 21 Mar 2021 10:11:10 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 21 Mar 2021 10:11:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=x+Hb78RjpnhpB kIL3qRebVWJuGh/fm1C5mpC8sGyBiU=; b=ionGDJ5KgwcKjEi+yH2c6/i6IEHVZ 3F3T48rR0wj4YIjEi4q6vb6BgrNcXsADsosui5GuFmTMhFoI6Hr+4NDiPXPmkj0h t8NGaIh64C5mFbKqhKAaHExrpljpXfD3uvoUNYpDmUSm0M8+37HXV89bnwvhnCYC WgCgcl6odsv0RzK/LdSMU0hYkfncr+mvgpIHO8IrQSI6wlhQgofTt++ayGRDGs+8 FQscrCO2dOlobJdFPPKqD05s5AOTS7gdn3gJuT/IRL8g3F25M0DA2wJdFNLU7KV1 0P7mzKaomTVcM2TX1q6QG4QdHPSDYa61+pq7t5eovI90Uw3HAZDN1653A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=x+Hb78RjpnhpBkIL3qRebVWJuGh/fm1C5mpC8sGyBiU=; b=rJc9jhRQ oYYVUuXWzLSOf9QloJFqvMXWyucM8BHPJn3ozludbVuEUEPQhoO9j8UCaVjMnHZy zakQ4DI0KBuDlpIn3Lj5Ye7uHxIPxyGtIWvGJwRhjoEu5aKVD93j+V82QoR1Qp46 pwBp64WWPEoqOfqwWgt+55nJZ1BhVE+uDevqDyxZRWltaDNmdOWvRFHFh8JMehtI clsW2fV80LdhOnOlCltWXkfGljAAb24wlyujiLWFHtjpAPr/zPlxLBYUjzdTlhS0 Es2sGuBOQlL94xGg3d74EcGDIdP8QYGHYO6XHB1B+vsh28hX24gIdSaQrFBmyg8g XxoQVlws4ATw6Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegvddgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepudelfedr vdejrddufedrvdefheenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [193.27.13.235]) by mail.messagingengine.com (Postfix) with ESMTPA id 7E6B4240138; Sun, 21 Mar 2021 10:11:09 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 6/9] Input: wacom_i2c - Clean up the query device fields Date: Sun, 21 Mar 2021 10:10:46 -0400 Message-Id: <20210321141049.148-7-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210321141049.148-1-alistair@alistair23.me> References: <20210321141049.148-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Improve the query device fields to be more verbose. Signed-off-by: Alistair Francis --- drivers/input/touchscreen/wacom_i2c.c | 71 +++++++++++++++++++-------- 1 file changed, 51 insertions(+), 20 deletions(-) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index 929680dce9cf..7aa0d1c3dbc9 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -13,15 +13,32 @@ #include #include #include +#include #include #include -#define WACOM_CMD_QUERY0 0x04 -#define WACOM_CMD_QUERY1 0x00 -#define WACOM_CMD_QUERY2 0x33 -#define WACOM_CMD_QUERY3 0x02 -#define WACOM_CMD_THROW0 0x05 -#define WACOM_CMD_THROW1 0x00 +// Registers +#define WACOM_COMMAND_LSB 0x04 +#define WACOM_COMMAND_MSB 0x00 + +#define WACOM_DATA_LSB 0x05 +#define WACOM_DATA_MSB 0x00 + +// Report types +#define REPORT_FEATURE 0x30 + +// Requests / operations +#define OPCODE_GET_REPORT 0x02 + +// Power settings +#define POWER_ON 0x00 +#define POWER_SLEEP 0x01 + +// Input report ids +#define WACOM_PEN_DATA_REPORT 2 +#define WACOM_SHINONOME_REPORT 26 + +#define WACOM_QUERY_REPORT 3 #define WACOM_QUERY_SIZE 22 struct wacom_features { @@ -48,31 +65,41 @@ static int wacom_query_device(struct i2c_client *client, struct wacom_features *features) { int ret; - u8 cmd1[] = { WACOM_CMD_QUERY0, WACOM_CMD_QUERY1, - WACOM_CMD_QUERY2, WACOM_CMD_QUERY3 }; - u8 cmd2[] = { WACOM_CMD_THROW0, WACOM_CMD_THROW1 }; u8 data[WACOM_QUERY_SIZE]; + struct reset_control *rstc; + + u8 get_query_data_cmd[] = { + WACOM_COMMAND_LSB, + WACOM_COMMAND_MSB, + REPORT_FEATURE | WACOM_QUERY_REPORT, + OPCODE_GET_REPORT, + WACOM_DATA_LSB, + WACOM_DATA_MSB, + }; + struct i2c_msg msgs[] = { + // Request reading of feature ReportID: 3 (Pen Query Data) { .addr = client->addr, .flags = 0, - .len = sizeof(cmd1), - .buf = cmd1, - }, - { - .addr = client->addr, - .flags = 0, - .len = sizeof(cmd2), - .buf = cmd2, + .len = sizeof(get_query_data_cmd), + .buf = get_query_data_cmd, }, + // Read 21 bytes { .addr = client->addr, .flags = I2C_M_RD, - .len = sizeof(data), + .len = WACOM_QUERY_SIZE - 1, .buf = data, }, }; + rstc = devm_reset_control_get_optional_exclusive(&client->dev, NULL); + if (IS_ERR(rstc)) + dev_err(&client->dev, "Failed to get reset control before init\n"); + else + reset_control_reset(rstc); + ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); if (ret < 0) return ret; @@ -89,9 +116,13 @@ static int wacom_query_device(struct i2c_client *client, features->tilt_y_max = get_unaligned_le16(&data[19]); dev_dbg(&client->dev, - "x_max:%d, y_max:%d, pressure:%d, fw:%d\n", + "x_max:%d, y_max:%d, pressure:%d, fw:%d, " + "distance: %d, phys distance: %d, " + "tilt_x_max: %d, tilt_y_max: %d\n", features->x_max, features->y_max, - features->pressure_max, features->fw_version); + features->pressure_max, features->fw_version, + features->distance_max, features->distance_physical_max, + features->tilt_x_max, features->tilt_y_max); return 0; } From patchwork Sun Mar 21 14:10:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12153093 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52A5BC433E6 for ; Sun, 21 Mar 2021 14:11:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3ACA46024A for ; Sun, 21 Mar 2021 14:11:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230034AbhCUOLQ (ORCPT ); Sun, 21 Mar 2021 10:11:16 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:42859 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229926AbhCUOLM (ORCPT ); Sun, 21 Mar 2021 10:11:12 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6D4D85C00CB; Sun, 21 Mar 2021 10:11:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 21 Mar 2021 10:11:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=32flhDWiUNY2V sj5ubaE1JFNCRDha2jAWNSmn4As7OM=; b=UQ9+vL0f0OMKIxa5KeLtca8UogsEt Psnoy6ARArYlTXcYAXm0pAVCU3FbsaqHszT95/Uo6h6Li7V4lwhkbhrCDUKvlgDY 6uAMaO0mx1KlmcGnSPy67XZmF+5OtILdbkVEHhVkN7X0FAI9xDhZ46eFPbQwjDrJ 2jhx/brmvEK6W+t2Ljdf7Ay6T6YzbU/0PrZOTjo6c+z/Rjsk9ZjHuB8/U0w0bLyO d3e/+PSztcnIh3+I0RZi3WSZAM4YD2qAORb2xFOgQnezKe5u2QPq7AAQZaubNxfi f5CBZuwX+9D4wAzdn9KKmxGd/t/mUmRW1ES/4qTYKBfCqa6mr7QB+YNRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=32flhDWiUNY2Vsj5ubaE1JFNCRDha2jAWNSmn4As7OM=; b=JGOyTmud +NGm30J11LpS9tbe0DFVvbZTX8XpB5lax6aNfHJ8a01KxGKtwI9JUZ4aZQqAVj7M ySGMRXJPVUS7RUb6zxPtzlwoJlbUId236WOhQ62hGkPzMm9s47T6WCPxx+Cuk8/y h64wLrc1haRTm6rh2Qwm00PCvztXyVpnSZ/Z6A27o2qIcLcpR25GGVW0nQpBm5R8 zShKK7IFDbG4lqxvA0nAidQW6fwEgUsvGBWcjLozPs7rNdO71DtWWmeVWx7t+H/I F86Ghic1kZDRPw6XthGTJabF5FN1TWD4iuvd/zkTmEzSa6NgdMNnghY/lpgQgOA4 quUh6br5Jxy7Hg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegvddgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepudelfedr vdejrddufedrvdefheenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [193.27.13.235]) by mail.messagingengine.com (Postfix) with ESMTPA id 79FD12400CC; Sun, 21 Mar 2021 10:11:10 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 7/9] Input: wacom_i2c - Add support for vdd regulator Date: Sun, 21 Mar 2021 10:10:47 -0400 Message-Id: <20210321141049.148-8-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210321141049.148-1-alistair@alistair23.me> References: <20210321141049.148-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Add support for a VDD regulator. This allows the kernel to prove the Wacom-I2C device on the rM2. Signed-off-by: Alistair Francis --- drivers/input/touchscreen/wacom_i2c.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index 7aa0d1c3dbc9..00db516fa3de 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -56,6 +57,7 @@ struct wacom_i2c { struct i2c_client *client; struct input_dev *input; struct touchscreen_properties props; + struct regulator *vdd; u8 data[WACOM_QUERY_SIZE]; bool prox; int tool; @@ -203,11 +205,29 @@ static int wacom_i2c_probe(struct i2c_client *client, struct wacom_features features = { 0 }; int error; + wac_i2c = kzalloc(sizeof(*wac_i2c), GFP_KERNEL); + if (!wac_i2c) + return -ENOMEM; + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { dev_err(&client->dev, "i2c_check_functionality error\n"); return -EIO; } + wac_i2c->vdd = regulator_get(&client->dev, "vdd"); + if (IS_ERR(wac_i2c->vdd)) { + error = PTR_ERR(wac_i2c->vdd); + kfree(wac_i2c); + return error; + } + + error = regulator_enable(wac_i2c->vdd); + if (error) { + regulator_put(wac_i2c->vdd); + kfree(wac_i2c); + return error; + } + error = wacom_query_device(client, &features); if (error) return error; @@ -275,6 +295,8 @@ static int wacom_i2c_probe(struct i2c_client *client, err_free_irq: free_irq(client->irq, wac_i2c); err_free_mem: + regulator_disable(wac_i2c->vdd); + regulator_put(wac_i2c->vdd); input_free_device(input); kfree(wac_i2c); From patchwork Sun Mar 21 14:10:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12153087 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 896E8C433EA for ; Sun, 21 Mar 2021 14:11:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7589461944 for ; Sun, 21 Mar 2021 14:11:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230035AbhCUOLR (ORCPT ); Sun, 21 Mar 2021 10:11:17 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:59423 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbhCUOLM (ORCPT ); Sun, 21 Mar 2021 10:11:12 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6AEC05C00D4; Sun, 21 Mar 2021 10:11:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 21 Mar 2021 10:11:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=73eyW0QPCYbw5 PMkKRHmXWFQ/7vYproNzQAhCUm7xPU=; b=GhRRITL9yva56qnM6NKqbDBGb3RbF s3AaYK12QOqKp1cAQItkbqe3WPG45osWWd2JWfjzHEtB/6C5r3kW9fJXb9smEXly VQQgc75kgzdqnIPEcVu60/NaU3opbXwv3iWnXoyaQO5mt+2VKTrKF0VQWteGLTkE N6oxZ+Vb5oQTTXMALpwlnIzgWx9aOj+3RZc0ALQOCwFBfrXURXi5d44VWWnTkrot 1qVzniRmEIXihCnOh33JGriVqIhUo0+SkuoGd+orUuyopA9+KDrnM3hMthUEzYtS fbdRbmq86DxN/G6HWN7SI262mm5q3CFkJyIgSDPop3gl/M4vKVp7AODGA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=73eyW0QPCYbw5PMkKRHmXWFQ/7vYproNzQAhCUm7xPU=; b=RllLcYq9 W3mABuiTigLuo9ow79swj/ih0IhL9XzzVzncHCyVON/Ol3s+LsetfZhqfj/sAbEC nCT5dn+8WzlglIddu5jJPMEUkUtRbb+e5xQXWNcMhAzFFUWXChRtO6GIHtCEnYyT wjoL5tR9sWFaHq/IFhR5019oGliQ2VDQQWR1iDfgKKvkoX/RljN0PtwjWfzfewhI DbwGn2iwK+Xkr4kNcS6ALBrB8g4A9ZigV6QbjTUBhH/HPYZdVzReUQfF3kK6695v ltC8LtwWrQ8b5lOcHr+37xJF4MdMuxlFML8KqsLTdcDsDyAegga9IL81tp+vzgpD ww/nNs/W1d7Jwg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegvddgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepudelfedr vdejrddufedrvdefheenucevlhhushhtvghrufhiiigvpeeinecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [193.27.13.235]) by mail.messagingengine.com (Postfix) with ESMTPA id 78E802400CC; Sun, 21 Mar 2021 10:11:11 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 8/9] ARM: imx_v6_v7_defconfig: Enable Wacom I2C Date: Sun, 21 Mar 2021 10:10:48 -0400 Message-Id: <20210321141049.148-9-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210321141049.148-1-alistair@alistair23.me> References: <20210321141049.148-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Enable the Wacom I2C in the imx defconfig as it is used by the reMarkable2 tablet. Signed-off-by: Alistair Francis --- arch/arm/configs/imx_v6_v7_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig index 70928cc48939..cd80e85d37cf 100644 --- a/arch/arm/configs/imx_v6_v7_defconfig +++ b/arch/arm/configs/imx_v6_v7_defconfig @@ -174,6 +174,7 @@ CONFIG_TOUCHSCREEN_DA9052=y CONFIG_TOUCHSCREEN_EGALAX=y CONFIG_TOUCHSCREEN_GOODIX=y CONFIG_TOUCHSCREEN_ILI210X=y +CONFIG_TOUCHSCREEN_WACOM_I2C=y CONFIG_TOUCHSCREEN_MAX11801=y CONFIG_TOUCHSCREEN_IMX6UL_TSC=y CONFIG_TOUCHSCREEN_EDT_FT5X06=y From patchwork Sun Mar 21 14:10:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12153095 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A8E3C433C1 for ; Sun, 21 Mar 2021 14:13:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC1DF6024A for ; Sun, 21 Mar 2021 14:13:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230137AbhCUOLv (ORCPT ); Sun, 21 Mar 2021 10:11:51 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:42939 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbhCUOLN (ORCPT ); Sun, 21 Mar 2021 10:11:13 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 667625C00FF; Sun, 21 Mar 2021 10:11:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 21 Mar 2021 10:11:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=FUpZqjlOgxXIY s30ynfwBw7aJ5BjzlYIhJyreti8lsQ=; b=J3dobLa5lMB+6VdFeOW7DVK8qno1J zlAFW5hyzccj017ayps3HiwOT0uF9JfZFXi8KYjOayWR11cuAC4w/uA7+1LRxnm0 00BaKYkQ+4sOVS/+535OHpVgJXjvYh2gpghPqBWrXXt4lSiQvr9tlzwEFoj88Kzd XVGIYwcMcO6PaCo117Cb1cRDnBfFmVeiDHjIONPjT4mgfeGkx241Tnq4JaDIqcGb SIWn93qyj3UODhD3oekNmdx+IzG9c23xmhQ7yvegVUcCal2eLPSqAYoMQTxU+xp0 AIEUtQxrjOGoEBVPTFAl5Ny6voXx4ILCVo7fA0c8exWbhPrtqOyTi5Rhg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=FUpZqjlOgxXIYs30ynfwBw7aJ5BjzlYIhJyreti8lsQ=; b=dx+Am8ts 49uWGdFJjX8Bnq1EaDh3nrtptzblrRypLP6y00/ORDSGUCM4aKEQi6+PGz13ztog krOmqcmIHcJfd3ehALlKde4gZBWoO8+3wQwTy5PwERFnSuYc+xvxd2PVnxMRYTSw 2LCjc1i0ngQhIX3hdCjkp6yHQUcoFL4dy0m/ZgzCMYHctAUDtkeoeYeYGUa/Hfpa hl55vZB85Wortf6mYD84pEV2bNLLWEABTjI6xTrbTtWfKQsthQRZIwoTrDUhsscT 1M91zCDXkvVvRK4XbOCWReUI0iQPZuWOtIHsx+U+HTitUBpplOqpHjsyfrTcCu5z DuWY/eGvenG3Kg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegvddgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepudelfedr vdejrddufedrvdefheenucevlhhushhtvghrufhiiigvpeeinecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [193.27.13.235]) by mail.messagingengine.com (Postfix) with ESMTPA id 780A32400CC; Sun, 21 Mar 2021 10:11:12 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 9/9] ARM: dts: imx7d: remarkable2: add wacom digitizer device Date: Sun, 21 Mar 2021 10:10:49 -0400 Message-Id: <20210321141049.148-10-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210321141049.148-1-alistair@alistair23.me> References: <20210321141049.148-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Enable the wacom_i2c touchscreen for the reMarkable2. Signed-off-by: Alistair Francis --- arch/arm/boot/dts/imx7d-remarkable2.dts | 52 +++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/arch/arm/boot/dts/imx7d-remarkable2.dts b/arch/arm/boot/dts/imx7d-remarkable2.dts index 7ed4eb5b8ea9..aa22b77af440 100644 --- a/arch/arm/boot/dts/imx7d-remarkable2.dts +++ b/arch/arm/boot/dts/imx7d-remarkable2.dts @@ -33,6 +33,19 @@ reg_brcm: regulator-brcm { startup-delay-us = <150>; }; + reg_digitizer: regulator-digitizer { + compatible = "regulator-fixed"; + regulator-name = "VDD_3V3_DIGITIZER"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&pinctrl_digitizer_reg>; + pinctrl-1 = <&pinctrl_digitizer_reg>; + gpio = <&gpio1 6 GPIO_ACTIVE_HIGH>; + enable-active-high; + startup-delay-us = <100000>; /* 100 ms */ + }; + wifi_pwrseq: wifi_pwrseq { compatible = "mmc-pwrseq-simple"; pinctrl-names = "default"; @@ -50,6 +63,28 @@ &clks { assigned-clock-rates = <0>, <32768>; }; +&i2c1 { + clock-frequency = <400000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1>; + status = "okay"; + + wacom_digitizer: digitizer@9 { + compatible = "wacom,generic"; + reg = <0x09>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_wacom>; + interrupt-parent = <&gpio1>; + interrupts = <1 IRQ_TYPE_EDGE_FALLING>; + flip-tilt-x; + flip-tilt-y; + flip-pos-x; + flip-pos-y; + flip-distance; + vdd-supply = <®_digitizer>; + }; +}; + &snvs_pwrkey { status = "okay"; }; @@ -123,6 +158,16 @@ pinctrl_digitizer_reg: digitizerreggrp { MX7D_PAD_LPSR_GPIO1_IO06__GPIO1_IO6 0x14 >; }; + + pinctrl_wacom: wacomgrp { + fsl,pins = < + /*MX7D_PAD_LPSR_GPIO1_IO05__GPIO1_IO5 0x00000014 /* FWE */ + MX7D_PAD_LPSR_GPIO1_IO04__GPIO1_IO4 0x00000074 /* PDCTB */ + MX7D_PAD_LPSR_GPIO1_IO01__GPIO1_IO1 0x00000034 /* WACOM INT */ + /*MX7D_PAD_LPSR_GPIO1_IO06__GPIO1_IO6 0x00000014 /* WACOM PWR ENABLE */ + /*MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0 0x00000074 /* WACOM RESET */ + >; + }; }; &iomuxc { @@ -133,6 +178,13 @@ MX7D_PAD_SAI1_TX_BCLK__GPIO6_IO13 0x14 >; }; + pinctrl_i2c1: i2c1grp { + fsl,pins = < + MX7D_PAD_I2C1_SDA__I2C1_SDA 0x4000007f + MX7D_PAD_I2C1_SCL__I2C1_SCL 0x4000007f + >; + }; + pinctrl_uart1: uart1grp { fsl,pins = < MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX 0x79