From patchwork Sun Apr 18 21:00:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12211177 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.2 required=3.0 tests=BAYES_00,DATE_IN_PAST_06_12, 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_BLOCKED,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 C5263C433B4 for ; Mon, 19 Apr 2021 08:39:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 88F5461029 for ; Mon, 19 Apr 2021 08:39:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229790AbhDSIjt (ORCPT ); Mon, 19 Apr 2021 04:39:49 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:55341 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229635AbhDSIjs (ORCPT ); Mon, 19 Apr 2021 04:39:48 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1C2DA5C007E; Mon, 19 Apr 2021 04:39:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 19 Apr 2021 04:39:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=0HKqazXNqfs4VKoNzw2xDM3usy hk8xBQeC7/PRjOD9E=; b=qMnuHtJiOEkMXLi/hJw/4FtT6/MXzjAvJ1O5N/xbkC 1Kvkkb97ovqpmwWazC7lPzh1xMUMOKoLg7DP4uMGK2Glp4HcH3YWgWqGDCRJGu0L K4KN/CZh9G5Nv3N+BX9SfSaS0VucTFXKx0vTctZdZrF5NA13KssAwnNvqxGDv4It CJscA5hSTdQGt7hJFwJZuORN4g7u3AP2+dmdcA9RjonV/QOTtKkMSONDEsrEArMU u9IKxDAR9+Bq9tOk+vRtDucKV1oKBQ1lPoX1Y5PWhSMfKaBMQWN0XvDzRZ/p8etL r7wKgqXGYk9L0IF0tJX6snVHjmhUEVzG9zAT1TyHPzrA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=0HKqazXNqfs4VKoNz w2xDM3usyhk8xBQeC7/PRjOD9E=; b=kX++TCxmYialEnCplTz6SimctZ2mzZg61 4S/KVCHw3wxvDRcb1cd7d5/PU59WSg2AGxr8BNI+Ss9/lYZJ91Z0Ne6D5cxke8wn RQcDyN9fjHxAXR3+Ul61rZJqSPniyG46QiMAHfUkUNsCffvYZlKYScClqzrLTJ38 6AxbW5aAVoANG0XQwpoO+Wk3pSaHVkJeeGfk4LitLB3L02dFFTLM2r0rJya/xMid rzJcetqXgS8OPjdPBwHiBVFXKKIOknE150QsK9iATRjig+l4a0zXbyQ5Wak6nWuw R48rqYfGE5mb8hQ17Nov/krf3JrjEw505VFnGW/51+h/9fpyH4pjQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtgedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgrihhr segrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeejleeihfdvtefgtd ethfdtgefftdeiffefjeeiffefveeuleejheejvefhffeukeenucfkphepkeelrdeggedr uddtrdduvdefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homheprghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [89.44.10.123]) by mail.messagingengine.com (Postfix) with ESMTPA id AA9CA1080063; Mon, 19 Apr 2021 04:39:15 -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 v5 1/9] dt-bindings: Add Wacom to vendor bindings Date: Mon, 19 Apr 2021 07:00:56 +1000 Message-Id: <20210418210104.2876-1-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 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 Apr 18 21:00:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12211179 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.2 required=3.0 tests=BAYES_00,DATE_IN_PAST_06_12, 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_BLOCKED,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 7450CC433ED for ; Mon, 19 Apr 2021 08:39:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 513AF6108B for ; Mon, 19 Apr 2021 08:39:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231799AbhDSIjv (ORCPT ); Mon, 19 Apr 2021 04:39:51 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:45923 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231687AbhDSIjv (ORCPT ); Mon, 19 Apr 2021 04:39:51 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id CAD455C00D6; Mon, 19 Apr 2021 04:39:21 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 19 Apr 2021 04:39:21 -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=xa3UKf0PeGo+y c9OQD4iBkuA6ndOakmgwVIDpufF6mw=; b=B6YZ3PMQL3Yh8/blfMLlP1SVxUHIr GWvbPyIwxf25oVg1QwWOBF97vviagXVZXKqqo/Pp2R1fffWf0CdXct66OWCvhszf PyAM1WvmOjLhxcPlY+X6iI+2vVtHzBR2FiM84k6wee3rMS52GxXypNvvOnxNiH23 3TiXU4B4ZfEUoJ3dBDzT1ZZaMIAx7FoePG1ZlxYnlgKOTOgh6Z2vXd6OeVRAGRNz EIKn7DoemWIuWAfEhGYpg3A1qieLSvgw4d4t+C/BETETl9hXK+MkYyuJvEtZvELo zjitpPkqNysl1ynTNG1PtQaHhi0GYI1kGRtCQtV6l/8PmnkNrEr/dZjVw== 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=xa3UKf0PeGo+yc9OQD4iBkuA6ndOakmgwVIDpufF6mw=; b=IcNZtujq JNP4oYpE/4zzaziqie0HW5dpc+vxqZCQ69fVosBRYP/8HtPlKIW/OYM1BE5CjJa6 xoPZCp8X+TJqjlPdOJNGhPdWx401iFpFtWIXv7ELaa6OFZLL4mCF4Xasr3X9M1o1 tR+YT+Q8bTJffuYilcLlQVD67tjgTlVfQ8aC7fx7mUVPCLviT27QpRunrLPP4L5H vMr/JfaFZZyaxVNFivfWwR6QqfDm385bcy9phybDp6MHxrdtvLPRtpxclMMbXq+v qs1eaWLXNVQ4NXnlqUjdQZ2RZkwxd9ShyRUcS8bgGJNO5pCNPplhTawFCeqiExlM bzZzW+lutO6fwA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtgedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpefftdfhgfeggf elgfekjefhkeeigfelleefhfethfehfeetleeggeeggfefffdvtdenucffohhmrghinhep uggvvhhitggvthhrvggvrdhorhhgnecukfhppeekledrgeegrddutddruddvfeenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [89.44.10.123]) by mail.messagingengine.com (Postfix) with ESMTPA id F26D0108005B; Mon, 19 Apr 2021 04:39:18 -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 v5 2/9] dt-bindings: touchscreen: Initial commit of wacom,generic Date: Mon, 19 Apr 2021 07:00:57 +1000 Message-Id: <20210418210104.2876-2-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210418210104.2876-1-alistair@alistair23.me> References: <20210418210104.2876-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 Apr 18 21:00:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12211181 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.2 required=3.0 tests=BAYES_00,DATE_IN_PAST_06_12, 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_BLOCKED,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 413DEC433B4 for ; Mon, 19 Apr 2021 08:39:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D24061151 for ; Mon, 19 Apr 2021 08:39:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237718AbhDSIj6 (ORCPT ); Mon, 19 Apr 2021 04:39:58 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:60029 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237262AbhDSIjy (ORCPT ); Mon, 19 Apr 2021 04:39:54 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D10B95C007E; Mon, 19 Apr 2021 04:39:24 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 19 Apr 2021 04:39:24 -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=iMA5K+xFvBtF3 QCb4I1QCVjObfpkmcYxY9AlcLhoGG4=; b=ZziTWBBEcxyZkAFDl/Quo8gX9IxE0 M1D8RRxzlC+hmNs3MMH3isyLxmYtJzLpczRFmDMmuDWjA1C37Bqdx/6gIlgwDZcl lfLpWtK5AFzhXaSr90LLw+47S18Ijk2wAagx5tqrbqV6Op/28JF0Uhc0viOcPhjm +xWsNaUCHDtL3llarUCdis1UNtMriXYA51xerbnjX7qZYzBDSIkE67MroIaYOYkl pZ2EQj3VqMWBKWRkOFW/MAjc0Y+OQsQuB3XXtzP+ND+6D7pKtMH2T7T0fFQz0OLE gRek90N4DVCppbjI82rqLwy+SXmBVpNycUMxHQuPzu+2uapOdMxrb8QDg== 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=iMA5K+xFvBtF3QCb4I1QCVjObfpkmcYxY9AlcLhoGG4=; b=VyK2X7Qg m2XkwNq/OpmMDxi3L0gv1BlwqjYtZCd2eX4MePZMgjnx+M4NFVqX0lGqY05UP+IM NnrKuYeRKiMIOW8PKWxzfcMEQcbs75L7I+833BCtmeUqc127gdf5+cNvfD8WyxZU YacMlyILAhK5MFtURR92uo99TCHhkyCg9Jl50uDMmuXGWRVt7+5ANWGbY9OTOZo6 5ARBR5R3oZ4Q6zqYLvS9u0uvN3U5QwTJ5er6aG5IJLU60b5zDCND3yjr/yy7B5vl e5hEuZjbjZjkH5m78ioV6DVKCYPoHd2iFe8+2edrY2gBv6Mp52PLai2JKCtu1qJr +n0i7TGOomZVrg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtgedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepkeelrdeg gedruddtrdduvdefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [89.44.10.123]) by mail.messagingengine.com (Postfix) with ESMTPA id 3B4FE1080057; Mon, 19 Apr 2021 04:39:21 -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 v5 3/9] Input: wacom_i2c - Add device tree support to wacom_i2c Date: Mon, 19 Apr 2021 07:00:58 +1000 Message-Id: <20210418210104.2876-3-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210418210104.2876-1-alistair@alistair23.me> References: <20210418210104.2876-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..dd3fc54d3825 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[] = { + { .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 Sun Apr 18 21:00:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12211183 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.2 required=3.0 tests=BAYES_00,DATE_IN_PAST_06_12, 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_BLOCKED,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 C0AB6C43460 for ; Mon, 19 Apr 2021 08:39:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 735FB61107 for ; Mon, 19 Apr 2021 08:39:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237650AbhDSIj7 (ORCPT ); Mon, 19 Apr 2021 04:39:59 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:59415 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237717AbhDSIj5 (ORCPT ); Mon, 19 Apr 2021 04:39:57 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1FB6E5C00D6; Mon, 19 Apr 2021 04:39:28 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 19 Apr 2021 04:39:28 -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=Ce9Y9YKTf2RGN +1Lg+fvm8yJDxZYIMZFZEP5ALleVhM=; b=Fky6wf+dNakOSJskz3NvOTyu0rgfE xWPs67af36YFHQU0AJ4ewa5MTMXwwJNrxKA+u79O8zbhc2GINibKITbyFbHnKI9/ b7CbObmtldrxMdZMTvv8HkIh+jolgO8FhvwfLWqsAmWGUQpMvrX7+iqfU8SFwOXo oWZdrLXv7xfJU2tLCMzTa04ARXbUZb96r6O0y/qRaink5rH7zSAEA0pRDOCFVxyU avqRwr4WPDeH/Bg6bwclU4YRKaND+8HdoZtPlj4JjvHXzwkRZQ/tl/RsGXXrK4X8 qmj4lzmHKM6i0AKmLfL5ochK92erFdTVbqALXAuNnv/S6Ccyl3ymzqflg== 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=Ce9Y9YKTf2RGN+1Lg+fvm8yJDxZYIMZFZEP5ALleVhM=; b=ErldjM1z kO7d9PeA6gPtMr2RN6gm/6QOjjtCRGF/hFIVmLhRO/A2nbYMwIngGOaKrPQgMpiR 2Qo6fKLlZLzKT9deAWwsZ1OxM+Fo3bfTByxRtH/aNLuGf1cOh7M8jvNVLmCo3RfE mYqu8uffCNvgqeP+Qwg9IDVxz7aNHDJKVRtN40Pxs06dJBRZNJA8p7fhghLoRp/X qVBBcuZtIAJfIuMlIhhIxKLxDqBy0DzAj1paxr0lq+VE5Y6PVDpLSLpwU3k2fExC aKQ83/xXbaFAvk3IoVsXS2v9G5om8zfLshgC4EGqatsyuXNeBhH0McqRcnbDGmbZ aJ3n5KVu9z0sDA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtgedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepkeelrdeg gedruddtrdduvdefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [89.44.10.123]) by mail.messagingengine.com (Postfix) with ESMTPA id 5552A108005B; Mon, 19 Apr 2021 04:39:25 -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 v5 4/9] Input: wacom_i2c - Add touchscren properties Date: Mon, 19 Apr 2021 07:00:59 +1000 Message-Id: <20210418210104.2876-4-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210418210104.2876-1-alistair@alistair23.me> References: <20210418210104.2876-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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index dd3fc54d3825..28290724b3da 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; @@ -114,12 +116,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); @@ -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 Apr 18 21:01:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12211185 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.2 required=3.0 tests=BAYES_00,DATE_IN_PAST_06_12, 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_BLOCKED,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 8D6AAC433ED for ; Mon, 19 Apr 2021 08:39:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F40461151 for ; Mon, 19 Apr 2021 08:39:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237793AbhDSIkC (ORCPT ); Mon, 19 Apr 2021 04:40:02 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:48305 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237811AbhDSIkB (ORCPT ); Mon, 19 Apr 2021 04:40:01 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4809D5C007E; Mon, 19 Apr 2021 04:39:31 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 19 Apr 2021 04:39: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=fm3; bh=gDbtivz0l1uVV R7wCzlx1DreiUMjx2Rs1EJyoCuVhIg=; b=horNVfgEiPHQu7EYOMPRnNnY0mt6z QJ1v45y1XdprZl18x1UQsy/XoybHHnm8lbsrCrmyDCnm1i+iWsHrtcukR31cB+dm 7RwFVrX3G8hLYJvInQn6I3YcKM8x178GRzOghql3Ecl8fvd1k5FfDWmQ71AYEwC1 OhBlMVq0nwXicrZ6g9YrgxqTCLE229dXonyYYlsjYGUoOjpAUDEOsXdtU2ojRfaV xRy8aewrobtFRhQu55wR/qs6TG36A9IjZrlzrGBevnsPSPC+kAAeGnJ6ln9ueVX3 Ehue3IiQsSO5KstAMbt82XcYr4YC5VCwg7qfG7qyb4D0/6ieSrKpTSrPQ== 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=gDbtivz0l1uVVR7wCzlx1DreiUMjx2Rs1EJyoCuVhIg=; b=UUxLi4hb rK+RgAf/rZX0DB2mUcjv2GJfHQi0tbNHg3ljW+LxnUOtHqSvAnIVcX/814+6mtVs T9xEDG2q8vqTjX2yvKsVD1VHMMZ2pwpvz1XTrJdvoTu5zrJL0/HMuLu3n3ZNesnn fjD2jZN/gdZAghhPouWghmq1Li8Lhf0YObE5BMi1GmtLfaKpCMsjOehIrsIWXoQH iRjsb3/IFNZbywgPxXiq5VF76nrriG2VDBT2IMqZAXgE8wBIPoFHC1dgm7e5iHQr NjuR2DlgNhWNkQwOpSXrBcDn67UsrATlNtdRWVYwmlkGsPWQRtqWm/7v3oIAkTnH qDM+WlAYJevq6g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtgedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepkeelrdeg gedruddtrdduvdefnecuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehmrghilh hfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [89.44.10.123]) by mail.messagingengine.com (Postfix) with ESMTPA id 964A51080057; Mon, 19 Apr 2021 04:39:28 -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 v5 5/9] Input: wacom_i2c - Add support for distance and tilt x/y Date: Mon, 19 Apr 2021 07:01:00 +1000 Message-Id: <20210418210104.2876-5-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210418210104.2876-1-alistair@alistair23.me> References: <20210418210104.2876-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 --- v5: - Check the firmware version 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 28290724b3da..e0a69e63204d 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; }; @@ -79,6 +85,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", @@ -95,6 +112,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 +127,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 +146,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: @@ -195,7 +221,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 Apr 18 21:01:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12211187 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.2 required=3.0 tests=BAYES_00,DATE_IN_PAST_06_12, 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_BLOCKED,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 31A7FC433B4 for ; Mon, 19 Apr 2021 08:39:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06EFC6108B for ; Mon, 19 Apr 2021 08:39:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238158AbhDSIkK (ORCPT ); Mon, 19 Apr 2021 04:40:10 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:60009 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238092AbhDSIkE (ORCPT ); Mon, 19 Apr 2021 04:40:04 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id F37165C0081; Mon, 19 Apr 2021 04:39:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 19 Apr 2021 04:39:34 -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=lDkbZW17jQ9Hi vg2vxo/6OxHO8cpcehBux958bfFEjA=; b=D0yCvfOOZGQUcARrkW+AJ1BBx/ZgP JQEFxuUr5tJF3g6o52Mbxy5nLaPULw0TimIM2U/mw+aWT288ZvPT2/MS3EQAx6MM +yJRueAy5kjyIsBS3cJrq3oKnk6Qb3TT/dFQCiuX9Gay4OSFNMRq9lRxpVv54CO5 9K0LJ/hZ6QUSbuVpLacRHvY9lQUcjwO8yyf4GDeiPX7uPtGzSN0+oHUTzWcpr2IY EOCtjreTakTok0LaHYCidKpZ82Z8pqxL87eghXlEWYNl/gvM7GGdNXe7SY+h3uOJ xP8wWdqAR2HRvQdh4w/yG9IpLyp+TjuuCpwV1sKDiuRAaierKDvfy/eWA== 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=lDkbZW17jQ9Hivg2vxo/6OxHO8cpcehBux958bfFEjA=; b=WnQVCYfD hXST6OXX1IDVzsWRAQWokENeaTuFju1XKUmZhV1fYHgDPp8xybjnMqtLrYKC66h6 fdeHhNryNyVakZAJTGROaUa1C+bnQJEuBLn6mFc+QkymzuH6ZTPlo1rCxI2q6q5A OJ2tCbFezxvZdF3/C4jgLHc7uxzN/zYxOkz28j3f8iIM1jZZb9ccSVGF8oUr5tWB A+92l+grPaPbdTd1e00lVJkvzFXvxC9wK3MMHstGuhj7zzp6ijm8xQJYwZY2DnDf 393PAPkSkNtmR65Uo5Ge3dLHeT4kYQTjQ3v6JW2AvZE4iNgU0aXO7C9r1Y4P8aCW cHDnKBec5n7I7A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtgedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepkeelrdeg gedruddtrdduvdefnecuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehmrghilh hfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [89.44.10.123]) by mail.messagingengine.com (Postfix) with ESMTPA id DA1B5108005B; Mon, 19 Apr 2021 04:39:31 -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 v5 6/9] Input: wacom_i2c - Clean up the query device fields Date: Mon, 19 Apr 2021 07:01:01 +1000 Message-Id: <20210418210104.2876-6-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210418210104.2876-1-alistair@alistair23.me> References: <20210418210104.2876-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 e0a69e63204d..26881149d509 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 @@ -50,27 +67,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, }, }; @@ -98,9 +118,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 Sun Apr 18 21:01:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12211189 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.2 required=3.0 tests=BAYES_00,DATE_IN_PAST_06_12, 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_BLOCKED,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 864CCC433ED for ; Mon, 19 Apr 2021 08:39:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5585961159 for ; Mon, 19 Apr 2021 08:39:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238190AbhDSIkL (ORCPT ); Mon, 19 Apr 2021 04:40:11 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:38465 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237811AbhDSIkH (ORCPT ); Mon, 19 Apr 2021 04:40:07 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 373105C007E; Mon, 19 Apr 2021 04:39:38 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 19 Apr 2021 04:39:38 -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=tsYfqjVQonAa5 lbJhO0HanEGazrEoetr/Xp3UbO8c4w=; b=Odt6vwwqeaEPtdCC58IoQsxQBn8ou 97YSKPTi+U5Vy4wre4AfK5GwIvzK6JAOfpPbt2uq1DuOk5xKS8s/9SGO2wzbILBj ueRL4KOJE6nlMIOSaMvBiWAJfX1ZGmv0e4E4FjsH1VZx7ldPZxKBytPuWEUYvKrE qBtYGp49pr1Nk1AUDCOxPLh2mRNdVYK3pHGOIcvSHNKiwtzlp3RcQIeTnea83Mmi VDth0PK91YoMdkgGzsiqTvome/iuqwDxqlytN8jHrw+xYihPL5TiWBTKKhEKSGo5 6HLLjcClQvvwp67np8XgdZIbU5974UQXKnjCSFIInA78HsVcXiGsm35Iw== 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=tsYfqjVQonAa5lbJhO0HanEGazrEoetr/Xp3UbO8c4w=; b=E+YyNtcY KdM5QZ/dnr575IXNfLKvhGllVJJUVt42noqRP0DtPofbow4QK/bxliJUw28rg7Pp rspVUi++5AfAmquMh2q0c96ahWK0ra/8iLMmfnDQECP6vbqw4zvZw/galSS9VPUS Zwr7qkjYiKCvN+R5iwy+n/lqFWfXTTMyNClrE61Mx2EiF0PAjzEB/vl96VXaBg2c 6M7moebl2kEN+O7hSn+L35gLcZcAqMjmwnnQtNI2AGnt6bDnqUPmRbejg8TIvKfZ JVfkUe3JAxwExghfCfr1QomwdCYdeM5kMwRoPBgvY0wayRmXJHy7R+sQpRivD7Jd a5X390oz326iFQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtgedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepkeelrdeg gedruddtrdduvdefnecuvehluhhsthgvrhfuihiivgepgeenucfrrghrrghmpehmrghilh hfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [89.44.10.123]) by mail.messagingengine.com (Postfix) with ESMTPA id 7520A1080063; Mon, 19 Apr 2021 04:39:35 -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 v5 7/9] Input: wacom_i2c - Add support for vdd regulator Date: Mon, 19 Apr 2021 07:01:02 +1000 Message-Id: <20210418210104.2876-7-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210418210104.2876-1-alistair@alistair23.me> References: <20210418210104.2876-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 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index 26881149d509..a5963d9e1194 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 @@ -58,6 +59,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; @@ -221,6 +223,20 @@ static int wacom_i2c_probe(struct i2c_client *client, goto err_free_mem; } + 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; + } + wac_i2c->client = client; wac_i2c->input = input; @@ -277,6 +293,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 Apr 18 21:01:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12211191 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.2 required=3.0 tests=BAYES_00,DATE_IN_PAST_06_12, 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_BLOCKED,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 3CE87C433ED for ; Mon, 19 Apr 2021 08:39:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1FF096113C for ; Mon, 19 Apr 2021 08:39:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238221AbhDSIkP (ORCPT ); Mon, 19 Apr 2021 04:40:15 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:59889 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237966AbhDSIkK (ORCPT ); Mon, 19 Apr 2021 04:40:10 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 42EFB5C0081; Mon, 19 Apr 2021 04:39:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 19 Apr 2021 04:39: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=fm3; bh=ATQZFgAJhWZiG ySupWX/oJS6Wb8DhGdjsY6S4Ar60bs=; b=NWgKqur5sEft9KwkGah1vBfDqqggx mcqci3IoWGvhuA3cRVSq15znbn2VZ+keDl1wW5I7nszpWh9YjNeRmqwui+0pqO21 hfcKNGpNL6GX7f3LMtIuCm27bBRNuuTPNfVYZ+yrph0ki5xZ/YWXpFtOqMDH0/HH PR3NWXf3J8s33EccInBfN3oGJU2piI3qRimQQ9EDFKIucEf8ffyZyeVlf6TkYF94 9/yIedw1L8hGcMX+oc/+sV/1Vaj6RNsg1OD3qPrBDQ1FVDlvZF43ELGkSf+HqX96 7rGh59O3S+ike1In1D6oB8S2G5R1MXM36h8TcUwEiqhPc2UyiVKD7j2sg== 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=ATQZFgAJhWZiGySupWX/oJS6Wb8DhGdjsY6S4Ar60bs=; b=Q0stw50Q wU/8UoU6h5d/NzMds66GSlume2VmusiTgz43VLhUg0BVm7TWuVtCWXx0boFYfQ4w hVgWYO2Qf/eRltjxRyQykeV6fVUKez1OC5XwPeJEKGZAw+zjrL6fNjJmnUyv8AK2 HAEY4IqKEgVYTIm8yFV2E3SdOX4SdNKc6FUYkFjSOfu2uK+WcB6923ESFQjbqcoT Um0BqKS71bKPlh2w812j3aCFMcNEOIpQ5poPhXZWLZEDDvdm6Vs1xqdrUBHrhRL0 ZYtgsG8cudNpX/17mx+3U5x0f8r6hHYpd9wfn8f3Kb0q1ALdrZiY9NBohexLJ6pM DwaK/5D2TWBu/g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtgedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepkeelrdeg gedruddtrdduvdefnecuvehluhhsthgvrhfuihiivgepgeenucfrrghrrghmpehmrghilh hfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [89.44.10.123]) by mail.messagingengine.com (Postfix) with ESMTPA id 9D3921080057; Mon, 19 Apr 2021 04:39:38 -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 v5 8/9] ARM: imx_v6_v7_defconfig: Enable Wacom I2C Date: Mon, 19 Apr 2021 07:01:03 +1000 Message-Id: <20210418210104.2876-8-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210418210104.2876-1-alistair@alistair23.me> References: <20210418210104.2876-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 Apr 18 21:01:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12211193 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.2 required=3.0 tests=BAYES_00,DATE_IN_PAST_06_12, 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_BLOCKED,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 4D739C433B4 for ; Mon, 19 Apr 2021 08:39:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A9936113C for ; Mon, 19 Apr 2021 08:39:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238260AbhDSIkY (ORCPT ); Mon, 19 Apr 2021 04:40:24 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:34059 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238262AbhDSIkO (ORCPT ); Mon, 19 Apr 2021 04:40:14 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9B0B45C0043; Mon, 19 Apr 2021 04:39:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 19 Apr 2021 04:39:44 -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=9p2JnqWk1N0os lHhkuELn2Kb2X3tmtsWK0i5HX2EdDU=; b=mQFAZwwq5XJGSzZksmVaVATNAwCpP pjXOPB8hF5zdVHGPEp7G+EbjC7VxhSFcMbYc7TiA7BuiyrmeWw34E9NX5SBJSTUS AHhjDvaymqOQ2PI/uxyD/5IEPIjKCpwcSVZsjlebT0JqfBbvRiAzuxxI5w3hR5gB YnZcxiRHhVLHnORPdsAevXdWq++eukTGRQamB2fYR5bRvH8E0uNMyi0MMDb0M6e1 CkFyiDmP+ffnjKEXPvBYdqEyytY/pPZxW06wW3eFvOVDr/sO1eMltWzOly7TSEzL 2RPJMpbBOcliuTxIW0IyExNUD8FJDO9gS0/pOOuZMNiDs7X7MQXgPAU4w== 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=9p2JnqWk1N0oslHhkuELn2Kb2X3tmtsWK0i5HX2EdDU=; b=FgfoJ9KZ 6nB7WDQTsJzPvWiXEgs5F0DqQjZtZ6ViXXSCTdv3HJ1GTdCioElwVdCWHt6/Pnxc 3RYLh6VNNvz7jgaLZacom1Fs8HPV7g8s3G+lnoa6K3tUkMF7OpUrZxlmcUhqiOzs VBFkrAYWSvF0BOdXAL0Ff10TUZPo/Ol9IY6rs1avmlNiLRhxQ01QkoZrrZXswbvP 1g0m90ss1LoywSEJRxfzh3LiMyoNtu+SRWwX67h0BeZlaWQgVsfeSGaoFJQTbYBs BegAzyQh059S/endg7pdAgmLefaBnr2HB9lDWlhVQCQLT/isgv8+jf8hnl5CuIJE rc0gZSl0Hj5GTQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtgedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepkeelrdeg gedruddtrdduvdefnecuvehluhhsthgvrhfuihiivgepieenucfrrghrrghmpehmrghilh hfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [89.44.10.123]) by mail.messagingengine.com (Postfix) with ESMTPA id B0B4C1080057; Mon, 19 Apr 2021 04:39:41 -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 v5 9/9] ARM: dts: imx7d: remarkable2: add wacom digitizer device Date: Mon, 19 Apr 2021 07:01:04 +1000 Message-Id: <20210418210104.2876-9-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210418210104.2876-1-alistair@alistair23.me> References: <20210418210104.2876-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 c3dda2b92fe6..ea1dd41023f9 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"; }; @@ -117,6 +152,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 = < @@ -125,6 +179,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