From patchwork Tue Jun 15 10:30:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12321069 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=-17.1 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,URIBL_BLACK, 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 708BEC48BDF for ; Tue, 15 Jun 2021 10:30:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 48A6861443 for ; Tue, 15 Jun 2021 10:30:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231503AbhFOKcq (ORCPT ); Tue, 15 Jun 2021 06:32:46 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:50749 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231614AbhFOKcp (ORCPT ); Tue, 15 Jun 2021 06:32:45 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 4FE07580729; Tue, 15 Jun 2021 06:30:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 15 Jun 2021 06:30:41 -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=fm1; bh=sXn/gj5O8k+bN hLDMHAC5azai265MJAlnFpI3cP2gy8=; b=M/m/OYzkyZeJ0MNAzta0CPgXWSLLI eZ/NrRsDum4NjKNKU5A7u5OrUVuhyFIn6t/8uk29GSF9f3bt7mbvBMT4UBNrlL6h Wl1Cdgv0lEnRTvv7/jFfBUaVnDyOUoquBy4CY8Fb5bD9Ve4Pix27qyJsmorIunEG x1h6CXafUyk5KUSw+rKZQS3FArFltqE9QhJxgYPI9XvwXd4jKcNzwv5Il8vHGWqC GHblqXpss43lonls9f9uGQFMahXsWN0y1L57tenn74D2489Vez73HRMg8u0eGidW X1wgugRQpX+ocPrx19bY+b6kNCuB0Md3tWuicYnJvnAJa1mdXqSGFamhg== 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= fm3; bh=sXn/gj5O8k+bNhLDMHAC5azai265MJAlnFpI3cP2gy8=; b=efuN/Dy9 IfawoOtiBxK6V19b09+C/sOLUCTd6J/DUSHfb8tjMZHMaRIKP37MhLv7xRasfyFy voD54IapMxOAT/Rm3qslegW+P+WlpfUIxlCeoQvpQOwWJF5K1tn7WV5lT5QLqIfm hd56g4VWSivmBdbXgSGwnBTXEyy6LrQmcWsXFTJyGKkWD3f/DxIL3BTFOTIE7ByK KF/JXIuuXt7y1mVzT0fZdWaQFFqVhw86YSbwx2U4G825qKjZmSjC/RGRxwC9uES8 qbQKqmLLPoTqgoyK2zNNSqlwVgyvh8LB7sRKrBKkfD79C/tkxkhyKXHTCHzop+OT kbjidC5/ZKARgg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedvjedgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Jun 2021 06:30:37 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.d, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v6 1/9] dt-bindings: Add Wacom to vendor bindings Date: Tue, 15 Jun 2021 20:30:06 +1000 Message-Id: <20210615103014.798-2-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210615103014.798-1-alistair@alistair23.me> References: <20210615103014.798-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 b868cefc7c55..abd878ff23d5 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1236,6 +1236,8 @@ patternProperties: description: Vision Optical Technology Co., Ltd. "^vxt,.*": description: VXT Ltd + "^wacom,.*": + description: Wacom Co., Ltd "^wand,.*": description: Wandbord (Technexion) "^waveshare,.*": From patchwork Tue Jun 15 10:30:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12321071 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=-17.1 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,URIBL_BLACK, 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 01469C48BE5 for ; Tue, 15 Jun 2021 10:30:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D0A6261451 for ; Tue, 15 Jun 2021 10:30:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231614AbhFOKcu (ORCPT ); Tue, 15 Jun 2021 06:32:50 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:34561 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231643AbhFOKcu (ORCPT ); Tue, 15 Jun 2021 06:32:50 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id A2152580729; Tue, 15 Jun 2021 06:30:45 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 15 Jun 2021 06:30:45 -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=fm1; bh=HIoTMriVA12LQ ElOMYva+gtL3TWoD/QflY0prR9RnFU=; b=SNvjkVLkArHryJRDcg02779xjeTDJ aZARMrkLEl1fnxU1seytk8xFZ/AC4FQVlkkOnXKWSh38i4nWj20D+XR+msRToSUL ngJjTkzq+0TGU7QUg2VAATcSRhXfJHxLKObLyVTMC0ybBqP7t6oL2nL2GLPK8nhd 0+QgZeGvPRcj1R2GpVcO4FRRaZgVIFZwnJK7aaUtJnG8jDsLr2PBPYBR0ZM+hsKN omEd9jN9r/QpzJst0I3bZ9jc0XLhisIV1LmHbpLqIh0PARCv5k06eSt4WHhsN/iA MzXB2ifGTsG5paRYm4bDC+4KKSRzFNtq/RLPf84p9vA+X16foGhRTm57w== 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= fm3; bh=HIoTMriVA12LQElOMYva+gtL3TWoD/QflY0prR9RnFU=; b=dJ7DxEca PZkF5q8Xc7/FcRqBnQ4srQHjZ3zBuxGS1vMUcMH9cGE3o0NBm08lYjh7epv0+sA0 J54HrR6Y30Vv6VQlLs7pYhfJMhwA5qQQhcRmu5BbfC3TYwoFHmpT5QNRlNBWMHRq hD8uNn160vWEZ3VAidDUk5LwQH3Pun+GyjNIUv/3B3BYZtxY1URb6WifSGHh77Yx lVuq1graYWOSBDg7xCn4sbHKX8XP+MAoRHV3swK08v4YPC4WvLDpJ54Z1G9SXiQO 8mmP6lQQM70yPHdLYSYqeeO5+u6YSMF0rpqoBAYhXDwibkDdDhaYg2hn2TBZRt2D il/nwYDc0KHq3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedvjedgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpefftdfhgfeggf elgfekjefhkeeigfelleefhfethfehfeetleeggeeggfefffdvtdenucffohhmrghinhep uggvvhhitggvthhrvggvrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Jun 2021 06:30:41 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.d, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v6 2/9] dt-bindings: touchscreen: Initial commit of wacom,generic Date: Tue, 15 Jun 2021 20:30:07 +1000 Message-Id: <20210615103014.798-3-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210615103014.798-1-alistair@alistair23.me> References: <20210615103014.798-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..68f3f5271b77 --- /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: + description: Power Supply + +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 Tue Jun 15 10:30:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12321073 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=-17.1 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,URIBL_BLACK, 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 32F39C48BE5 for ; Tue, 15 Jun 2021 10:30:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0961561443 for ; Tue, 15 Jun 2021 10:30:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231648AbhFOKcz (ORCPT ); Tue, 15 Jun 2021 06:32:55 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:56697 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231643AbhFOKcy (ORCPT ); Tue, 15 Jun 2021 06:32:54 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 44FC4580729; Tue, 15 Jun 2021 06:30:50 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 15 Jun 2021 06:30:50 -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=fm1; bh=PKUtGSy8iZDEY lpTbw2VI9ddzDZdqrWO9usf566B1Ng=; b=KRiY8AX9yhHq9NXiNRxat6AT0y3NS S1p/D9w9/6kpXOUvxnaLG2nJ/8C7lqcvcninXIOY/qT4GS6Qi/mPcS4IJAt8/sBO yxitxMxBczAZOFp+Kv6NjUZw7nC3TqTAelH9CZqAMAsO8N8HYgKUp54r0B4njUoJ cu4HjpQ/O/5CopQb+PHp7VPbH0kGQECbUxMS3w4xJ5FQt0CyQRi6in13pz9pu5dM eeDf3zugE5qwhOHrKsS6/0V3llBjbnNs4F0pD86e5ZKtS61NtExsK10khSEwUW5p xkWTT9LRYcIOPtJ22WlLOj5kGcZOdRQhjz7IYxDE8vIZQ7ibegcpuA4mw== 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= fm3; bh=PKUtGSy8iZDEYlpTbw2VI9ddzDZdqrWO9usf566B1Ng=; b=mahrQz1K hgR+RkY9m7QLQj+ZMqo/mmUFck6lt+kIRMGSfFOgWITEuzXwmOU5wbTgOnHe9CyW vCdtKwrJHV4+TviSGHa9xYrT1lH4ci/W01Ie1M3AIxC9iZ5jmZ6EDRiZLEP10kE4 eznAmt5EZgvbmHwJhPrZmPWag0rI6x3SeL+BTQYFSAj4UPUs5AjZqAYQKN82Guz+ oN9XruPLOnjPDJBF+pJ1n94d1aO2HGE0Yn/dF2ymeUhq4JabXyThYrURmzU9NAlb OsOOa2hfbndIP4hW0BlTA3sObH2Gnp21YGu1PZHGdaQprDASIvUm/i/7l6b4ZWvl cpmQWP2bCU9plA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedvjedgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Jun 2021 06:30:45 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.d, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v6 3/9] Input: wacom_i2c - Add device tree support to wacom_i2c Date: Tue, 15 Jun 2021 20:30:08 +1000 Message-Id: <20210615103014.798-4-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210615103014.798-1-alistair@alistair23.me> References: <20210615103014.798-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 22826c387da5..6053595f2b30 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 @@ -241,10 +242,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[] = { + { .compatible = "wacom,i2c-30" }, + {} +}; +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 = wacom_i2c_of_match_table, }, .probe = wacom_i2c_probe, From patchwork Tue Jun 15 10:30:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12321075 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=-17.1 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,URIBL_BLACK, 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 CADCCC48BE8 for ; Tue, 15 Jun 2021 10:30:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B4D6961443 for ; Tue, 15 Jun 2021 10:30:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231646AbhFOKc7 (ORCPT ); Tue, 15 Jun 2021 06:32:59 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:37845 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231214AbhFOKc6 (ORCPT ); Tue, 15 Jun 2021 06:32:58 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 439F3580729; Tue, 15 Jun 2021 06:30:54 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 15 Jun 2021 06:30:54 -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=fm1; bh=42U8DUxuirT24 UG9G+vL9N8k4v79ZOffL9JMNB77jg0=; b=JwKzX+jTbHTeMy7fHePzTBrmkfk/v GeHU8oT+F5Kf96gBXj6Zz0At6FlAVWxIn5bo+HiG8wCVcU3rYFCnO4DRbcdOfYIX Wu/HKvfHrS/Z4zcKuVe5YxviaSUGRvQt1g6ycaEb+xgNEhhYNDgrQLHm/6AVnAs6 T4T+2Sg0Fq44vUJQhqG1WUWdeTJ4KwSIzRvdASzm4W0BLOYJSggpQVsdaQcjOPwy gWMAucODGm1Eie7qSJhfiPwITNJDUM6kwwVdWpS6Q2lBbmmwX8ym5Aus6O9IGfCS XhVWzoWzj70Vj1Bcu61apK18D+la5iNQLmmzXLqjGE1B7YZ1V55YgoxLg== 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= fm3; bh=42U8DUxuirT24UG9G+vL9N8k4v79ZOffL9JMNB77jg0=; b=KBYi5BR+ RfCNLgHOj5CnEhnI6yLflWWt9Lw6pUPxqQt1tvBc8e0SZWoJaLX+A0W/3STOhEJM /3UuYiCWhokEl8QdfZrccm90ru0oHkvXPrY8u6jtZYezzBOtycxDUQFQDh6DQnQ0 G0wLPZJoJva6NQLVzp04l8atKajoWQQsKLrluZl+YFmEXIo7z2z6Z61kQbjWNVgC bfJ+UdPfaWwUKRMkS84QuHOZuVsB5UDko5iVkW1qHRePLAnpUgWM/DWGYgrzVGlf cJNy8s2gw3FBKI3aN5xpfZm14nUcsY6EI+2INDfkIPVFE5+aDlC71q0cfTq8rF/U n76M+7tR61g74w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedvjedgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucevlhhushhtvghr ufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Jun 2021 06:30:50 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.d, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v6 4/9] Input: wacom_i2c - Add touchscren properties Date: Tue, 15 Jun 2021 20:30:09 +1000 Message-Id: <20210615103014.798-5-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210615103014.798-1-alistair@alistair23.me> References: <20210615103014.798-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 | 28 ++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index 6053595f2b30..b47bc08efdd1 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,8 @@ struct wacom_features { struct wacom_i2c { struct i2c_client *client; struct input_dev *input; + struct touchscreen_properties props; + struct wacom_features features; u8 data[WACOM_QUERY_SIZE]; bool prox; int tool; @@ -90,6 +93,7 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) { struct wacom_i2c *wac_i2c = dev_id; struct input_dev *input = wac_i2c->input; + struct wacom_features *features = &wac_i2c->features; u8 *data = wac_i2c->data; unsigned int x, y, pressure; unsigned char tsw, f1, f2, ers; @@ -114,12 +118,12 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) wac_i2c->prox = data[3] & 0x20; + touchscreen_report_pos(input, &wac_i2c->props, features->x_max, + features->y_max, true); input_report_key(input, BTN_TOUCH, tsw || ers); input_report_key(input, wac_i2c->tool, wac_i2c->prox); input_report_key(input, BTN_STYLUS, f1); input_report_key(input, BTN_STYLUS2, f2); - input_report_abs(input, ABS_X, x); - input_report_abs(input, ABS_Y, y); input_report_abs(input, ABS_PRESSURE, pressure); input_sync(input); @@ -151,7 +155,7 @@ static int wacom_i2c_probe(struct i2c_client *client, struct device *dev = &client->dev; struct wacom_i2c *wac_i2c; struct input_dev *input; - struct wacom_features features = { 0 }; + struct wacom_features *features; int error; if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { @@ -159,14 +163,15 @@ static int wacom_i2c_probe(struct i2c_client *client, return -EIO; } - error = wacom_query_device(client, &features); - if (error) - return error; - wac_i2c = devm_kzalloc(dev, sizeof(*wac_i2c), GFP_KERNEL); if (!wac_i2c) return -ENOMEM; + features = &wac_i2c->features; + error = wacom_query_device(client, features); + if (error) + return error; + wac_i2c->client = client; input = devm_input_allocate_device(dev); @@ -178,7 +183,7 @@ static int wacom_i2c_probe(struct i2c_client *client, input->name = "Wacom I2C Digitizer"; input->id.bustype = BUS_I2C; input->id.vendor = 0x56a; - input->id.version = features.fw_version; + input->id.version = features->fw_version; input->open = wacom_i2c_open; input->close = wacom_i2c_close; @@ -190,10 +195,11 @@ static int wacom_i2c_probe(struct i2c_client *client, __set_bit(BTN_STYLUS2, input->keybit); __set_bit(BTN_TOUCH, input->keybit); - 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); + 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, - 0, features.pressure_max, 0, 0); + 0, features->pressure_max, 0, 0); input_set_drvdata(input, wac_i2c); From patchwork Tue Jun 15 10:30:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12321077 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=-17.1 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,URIBL_BLACK, 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 4E2DCC48BE5 for ; Tue, 15 Jun 2021 10:31:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3494161453 for ; Tue, 15 Jun 2021 10:31:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231214AbhFOKdG (ORCPT ); Tue, 15 Jun 2021 06:33:06 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:46151 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231616AbhFOKdD (ORCPT ); Tue, 15 Jun 2021 06:33:03 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 600DD580729; Tue, 15 Jun 2021 06:30:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 15 Jun 2021 06:30:58 -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=fm1; bh=jLYfQBxc5Fss5 wHk6K78mpbcM1U0H/2OtEIpp1nXFxo=; b=Kj8RYwPVR3UYiD8swIqWSr832jMpr tRb56hVG5ccBEr/5v+UF1wMkoSNMmpiBEVLJhYtAV1huyk4c0/SwWecxXG4mDB9I wO9oOC2LR6/D3qfe2mxrZoDn0UtAePDuNybIchE2YOv4xcQHKISWJaSyg2Jv0nrQ siN/adeDzoBBtQCZkEPVnsNM9irW/rRkJN5rnqxy2p2V+ozLU1AbUmSimfjfS4oH prxH3obXnhbsM5vXucJAhXQ9xROufVLy9I89LK8pCRKSiZa6aUycC04A10gFUlE4 DTG3wPGuW43Lh0RgiY3cMhXcg2xL7IYICKH/ZypHzSyB4lsIhftNKUWIg== 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= fm3; bh=jLYfQBxc5Fss5wHk6K78mpbcM1U0H/2OtEIpp1nXFxo=; b=tI0pJLi3 s2iFPaKgdNoHg9JWto8F1Llssnjx7w4Fc6omg7bYMiNxqNOAfSkHIZ6zkLKIpHWc 0l0xQtNLLQbEjflD5QHNxlc8S7xBA93XYgJvfFWgwqWznqMe5c7ZnR4YT3PsHzLR ycbOvjIjdeygm/Dy/AYgWrzxWkgwYjcfsJypcYFEXJTFztfP+019110XPQj5XNUf 9/r9fqcjbRLjtLOmYU9ZvLoEy0rYRk3gwjqCDLv6w75SpvPccuEdg01lbogLqpRq n3cq2Sm9mIXzGxeBSLLlWW5SakdscPN2yoFCMF41DfeJprWJCgASCALjG8x9tFkz Rm17YAm4IrQ+6Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedvjedgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucevlhhushhtvghr ufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Jun 2021 06:30:54 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.d, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v6 5/9] Input: wacom_i2c - Add support for distance and tilt x/y Date: Tue, 15 Jun 2021 20:30:10 +1000 Message-Id: <20210615103014.798-6-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210615103014.798-1-alistair@alistair23.me> References: <20210615103014.798-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 | 34 +++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index b47bc08efdd1..e2449a4fa2e3 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -22,12 +22,18 @@ #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 + +#define WACOM_DISTANCE_TILT_VERSION 0x30 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; }; @@ -80,6 +86,17 @@ 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]); + if (features->fw_version >= WACOM_DISTANCE_TILT_VERSION) { + 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]); + } else { + features->distance_max = -1; + features->distance_physical_max = -1; + features->tilt_x_max = -1; + features->tilt_y_max = -1; + } dev_dbg(&client->dev, "x_max:%d, y_max:%d, pressure:%d, fw:%d\n", @@ -97,6 +114,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, @@ -111,6 +129,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) ? @@ -125,6 +148,9 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) input_report_key(input, BTN_STYLUS, f1); input_report_key(input, BTN_STYLUS2, f2); 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: @@ -200,7 +226,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 = devm_request_threaded_irq(dev, client->irq, NULL, wacom_i2c_irq, From patchwork Tue Jun 15 10:30:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12321079 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=-17.1 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,URIBL_BLACK, 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 A1AFCC48BE5 for ; Tue, 15 Jun 2021 10:31:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8B79461457 for ; Tue, 15 Jun 2021 10:31:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231712AbhFOKdI (ORCPT ); Tue, 15 Jun 2021 06:33:08 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:57961 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231706AbhFOKdH (ORCPT ); Tue, 15 Jun 2021 06:33:07 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id DA2E1580729; Tue, 15 Jun 2021 06:31:02 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 15 Jun 2021 06:31:02 -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=fm1; bh=8knOJ7YElFUkD BiiRH7ZJBc2RpziTa8+4Ew7FNGqJ8Y=; b=NodUZB64NxqRyqR8Ted5Vd68+dIMD bUAatAJWkpZsaoxI3QrYifEWVVsXkGsWspipUg4v6ukhN/sYwIjP4KK8xIsw6Dxw /PJpUcF+iKSxRu7ztBSVuLbKb1LWjDTHDDkX44MRfZrAJr9pR0nyGPl9k87k/t3H XbkpDNMPyzSucSDixCdLQ02ZFpQkX7S5N1qCwRM3hZ0T3P9u4sOVDWHsu0llR06k h2mPxZxCQIhKqHZ/rFMAljlNfzcYwVjqneSv0KanQihtwR1V7jDX0wVt+WRZ+jeF QmpakBbICeL/ESBkPPE1sLgJMeHHx1aWKMVp5vg3DeWMl7Yy7wSau5dfA== 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= fm3; bh=8knOJ7YElFUkDBiiRH7ZJBc2RpziTa8+4Ew7FNGqJ8Y=; b=nRz1XLoG tdxDMkupfNqD7UNLrjVm8ryCvwZW3imV7vfyQaRjXlO8pRjmuuHkKJHZLpPXRYGO z6FyLWBQzDUaPd2cH8X6UhmiNLdFm6XAwK/Zl3iD/a3NrmnjUx0hHOhYAF4pOhBF M9gYJngWs23f4mIYitCulpKaljvgEkfe3YOzfo2VheylAs81JGKDalwDdcP1tJwE 76XbAZZoMGJW0n9twuwbhKwFPc5WFXWqeWrUoA2SY9ejwOdT8saRKNdzIYMCDQCT M1YA5hEOXcspj3ESX6KNh0eijJH+tVYDJWCx5tSWIqoIguhBqgPZ2OIU3drK6pcB 7uZlWPmGqQYWtQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedvjedgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Jun 2021 06:30:58 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.d, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v6 6/9] Input: wacom_i2c - Clean up the query device fields Date: Tue, 15 Jun 2021 20:30:11 +1000 Message-Id: <20210615103014.798-7-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210615103014.798-1-alistair@alistair23.me> References: <20210615103014.798-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 | 64 ++++++++++++++++++--------- 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index e2449a4fa2e3..49d1c15e623c 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 #define WACOM_DISTANCE_TILT_VERSION 0x30 @@ -51,27 +68,30 @@ 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]; + + 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, }, }; @@ -99,9 +119,13 @@ static int wacom_query_device(struct i2c_client *client, } 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 Tue Jun 15 10:30:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12321081 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=-17.1 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,URIBL_BLACK, 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 75FB6C48BDF for ; Tue, 15 Jun 2021 10:31:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E06F61450 for ; Tue, 15 Jun 2021 10:31:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231511AbhFOKde (ORCPT ); Tue, 15 Jun 2021 06:33:34 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:35023 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231615AbhFOKdb (ORCPT ); Tue, 15 Jun 2021 06:33:31 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id C2FAA5807DE; Tue, 15 Jun 2021 06:31:26 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 15 Jun 2021 06:31:26 -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=fm1; bh=gJSZFhKVP4HKE Mu49hVwBOwgPgn/uZOPWaLARXY00kE=; b=c2PxkIuOC1BTaWCbMdXLDr5nIbcxS tqwLNLufaadozlkb/JOnuW6dzjpc07A373VIxmtCB4XgL2ShY7M9LO19l/QrGsN9 WBVqnb1byppiHXzLxKHB+z8928nVA5opWvc3F/dfEd/eSC5CCPGrfGs6FjrVS06P OcYTMEzDkj/Z4D/HVGS0MPrgjiGsYBzC4hWk/yguGb9nsagYV6zIAPifCWQO8BnZ ZXF8jG+LdqwyeSRZA+Sy6MmEnganNxwskw1rqGA7ZVpv4986jnmJj9wUeyYnKjO2 4cSPL8o4/2VvKTi6a2jZAH4cdcz0JKC3DcsW67fnn+AdMwlLwtgZ0bw9Q== 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= fm3; bh=gJSZFhKVP4HKEMu49hVwBOwgPgn/uZOPWaLARXY00kE=; b=r/rAKHHo Fw8VjrrZIh/MQXeLYJIJ+Zl2fzvGG1DPMC4UcqdeP7/pVE//LHI++J/VsVdDeFr+ yD6dP3B1L7yL9Y5YxJnyAVEHzFSpKaGdp0h1keThsoR+0ODwDNIyHXNfzW0JakML pI92ZMPURlehiR+BT6DXpu/Arrxa+L90BSaOxrNv3WN2AVICisVj/KNUHPLvtQ6a ffUwz/NbOho6/DOJPqKPYagzOJ9UMO0K0ClbtRPs2BxjXkOJpJuw1LMqAOvA6wgx sInhoMU0CgNO0OczsIvxwLAv8EYLbrLfz0DlEn2Z8AhbdGUDUuFjsA4YZfLofTz7 R+bRpnt3gg4PpQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedvjedgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucevlhhushhtvghr ufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Jun 2021 06:31:03 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.d, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v6 7/9] Input: wacom_i2c - Add support for vdd regulator Date: Tue, 15 Jun 2021 20:30:12 +1000 Message-Id: <20210615103014.798-8-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210615103014.798-1-alistair@alistair23.me> References: <20210615103014.798-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 | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index 49d1c15e623c..df77b17835e4 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 @@ -59,6 +60,7 @@ struct wacom_i2c { struct input_dev *input; struct touchscreen_properties props; struct wacom_features features; + struct regulator *vdd; u8 data[WACOM_QUERY_SIZE]; bool prox; int tool; @@ -222,11 +224,24 @@ static int wacom_i2c_probe(struct i2c_client *client, if (error) return error; + wac_i2c->vdd = regulator_get(&client->dev, "vdd"); + if (IS_ERR(wac_i2c->vdd)) + return PTR_ERR(wac_i2c->vdd); + + error = regulator_enable(wac_i2c->vdd); + if (error) { + regulator_put(wac_i2c->vdd); + return error; + } + wac_i2c->client = client; input = devm_input_allocate_device(dev); - if (!input) + if (!input) { + regulator_disable(wac_i2c->vdd); + regulator_put(wac_i2c->vdd); return -ENOMEM; + } wac_i2c->input = input; @@ -261,6 +276,8 @@ static int wacom_i2c_probe(struct i2c_client *client, IRQF_ONESHOT, "wacom_i2c", wac_i2c); if (error) { dev_err(dev, "Failed to request IRQ: %d\n", error); + regulator_disable(wac_i2c->vdd); + regulator_put(wac_i2c->vdd); return error; } @@ -270,6 +287,8 @@ static int wacom_i2c_probe(struct i2c_client *client, error = input_register_device(wac_i2c->input); if (error) { dev_err(dev, "Failed to register input device: %d\n", error); + regulator_disable(wac_i2c->vdd); + regulator_put(wac_i2c->vdd); return error; } From patchwork Tue Jun 15 10:30:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12321083 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=-17.1 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,URIBL_BLACK, 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 DF780C49361 for ; Tue, 15 Jun 2021 10:31:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C6017613FA for ; Tue, 15 Jun 2021 10:31:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231675AbhFOKdh (ORCPT ); Tue, 15 Jun 2021 06:33:37 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:34921 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231706AbhFOKdf (ORCPT ); Tue, 15 Jun 2021 06:33:35 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 5339B5807DE; Tue, 15 Jun 2021 06:31:31 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 15 Jun 2021 06:31:31 -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=fm1; bh=ATQZFgAJhWZiG ySupWX/oJS6Wb8DhGdjsY6S4Ar60bs=; b=QQ4HFdf0zD7LjSbCP7CPujaDpyZh3 SFAtUwieQ9k58kNNp+ESWRuKOOVEeWI/ADaro2/8+zs1sPw6U5HmbCLOAZk4riHf bfuQP0yOsgxY+K3j/BmgcXdTBY64rwCTw6QTDD+tjBCOPiRRP+tn4RUjTN1PkbO1 Q4iL6mSwhzlYpROeeBfvp0oCgvzqZUHyAIP1bH06SsWfv9LrwzPSaV/RejDCqS4o alKEnDcmkkvUPqY5zthlF8IIoBvoEcRd7IK76ZtC8Gdjm1pd4zQvZNO00Apl2cV/ n2mF6H1MfhmRHJRyEMe9GU+HKaUGJFAqaoD2P+rVzC1Xx9W7euQMFgu0w== 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= fm3; bh=ATQZFgAJhWZiGySupWX/oJS6Wb8DhGdjsY6S4Ar60bs=; b=s70wL3yB Bah0XOYE67ImGWZmUKfabNrigF3MqE8ROt2kmD4vnk+7I32ZgnIrSiu1hg5S1jgq BTtINqXPdPvVvyZgs150ZoYCk7I2hGdrojllbD7JuNSBCXiJMAk+sW4Pr2EYF2Rs GCgpyG9wqYDyc2ltX3qzMKQzTxooOTGKzoz49bX0gs4zw21H+yNeK6n6kxKaBz3M 3MY3cl2qzSXbVLEY0TpliwEtOmRSiOmWNGy9n9/o3pyzZgtJCDng9NNe12uBoFfd +mF8xrMJN/NGDGpE9OPJt1zKeoZmjRcjXFrMoCA6u7uOIotguMImo9/fPctw8SGl cL+X/8LrFC9J/A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedvjedgvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Jun 2021 06:31:27 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.d, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v6 8/9] ARM: imx_v6_v7_defconfig: Enable Wacom I2C Date: Tue, 15 Jun 2021 20:30:13 +1000 Message-Id: <20210615103014.798-9-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210615103014.798-1-alistair@alistair23.me> References: <20210615103014.798-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 Tue Jun 15 10:30:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12321085 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=-17.1 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,URIBL_BLACK, 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 C25E3C48BDF for ; Tue, 15 Jun 2021 10:31:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD41061417 for ; Tue, 15 Jun 2021 10:31:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231706AbhFOKdl (ORCPT ); Tue, 15 Jun 2021 06:33:41 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:46333 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231742AbhFOKdk (ORCPT ); Tue, 15 Jun 2021 06:33:40 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 42CB058087B; Tue, 15 Jun 2021 06:31:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 15 Jun 2021 06:31:36 -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=fm1; bh=Vf0wsGrxQl7PO FKknrVYsjnKqkwGq57jfcRRmr9lURs=; b=IOnDx5sHciTrI+oIB47WVhPqMQXo2 bVBMcb8pwF5h3PpsI1QUeSf8fjZDroIaTUxyE1YBnB/vDTtX5qyTkFSi03UOeF0/ OZCf3njstVRf83+ibkCRu34dObYJXHEkMwM7gFy7/d9zN4F5zEAmTQtmbMk8Tvxw Is0YRvwW84r2iK9j83tTmpCI5IwjKJdzoo+nBymsJELd09pqvbqy5NVohE99/zn3 KbLBkWXaXVM13rLOKBfqG9wr+JDvY4ilUV+SHeDJ6lKtFRbItpYBJpf5zMDsfV5l PvaCufXzLnW85tKO4t+YWRvU2GxbEQt3a9ikXlgUd1VSY7dMro/TESzXg== 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= fm3; bh=Vf0wsGrxQl7POFKknrVYsjnKqkwGq57jfcRRmr9lURs=; b=Wz1EhSGd AMypqY+fxqr3mk0BhYtXjCCVfgVAin1UohWQbvunkbp1UquNgEYJbtMa+6o8b7Tb zajsBK1CCBiUD6gj9WyHVY99XQ64eWb4txhdtPJ5hHafXDPK8R9XD/1R+YS/M6oV 16Q353KIPLd8lofIwUFX6sFuH6z0vnSoniSXTC5/IrtME0kbYDXLaPbKV7HccvvO IaUb1708Sl3FgFX6NTQoyZ2Y9hbrtHfbpcYsWMsvppCRA5cI3Oxj7NgymUvmLB1p A8z+04oKJPtHvf82JcdWeXUWj4vZpIp0sbrx3MMweNqli+oMaaWpbaF6VCt3uPZl Y/reHzxky1WbWQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedvjedgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucevlhhushhtvghr ufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Jun 2021 06:31:31 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.d, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v6 9/9] ARM: dts: imx7d: remarkable2: add wacom digitizer device Date: Tue, 15 Jun 2021 20:30:14 +1000 Message-Id: <20210615103014.798-10-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210615103014.798-1-alistair@alistair23.me> References: <20210615103014.798-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 | 61 +++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/arch/arm/boot/dts/imx7d-remarkable2.dts b/arch/arm/boot/dts/imx7d-remarkable2.dts index 7eebcd7f23bb..35262c60f015 100644 --- a/arch/arm/boot/dts/imx7d-remarkable2.dts +++ b/arch/arm/boot/dts/imx7d-remarkable2.dts @@ -34,6 +34,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"; @@ -51,6 +64,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,i2c-30"; + 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"; }; @@ -118,6 +153,25 @@ &wdog1 { fsl,ext-reset-output; }; +&iomuxc_lpsr { + pinctrl_digitizer_reg: digitizerreggrp { + fsl,pins = < + /* DIGITIZER_PWR_EN */ + 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 { pinctrl_brcm_reg: brcmreggrp { fsl,pins = < @@ -126,6 +180,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