From patchwork Wed Aug 18 15:49:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 499898 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49260C4338F for ; Thu, 19 Aug 2021 11:20:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 31C5A610E6 for ; Thu, 19 Aug 2021 11:20:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238533AbhHSLVT (ORCPT ); Thu, 19 Aug 2021 07:21:19 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:55325 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238127AbhHSLVP (ORCPT ); Thu, 19 Aug 2021 07:21:15 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 0455C580C0E; Thu, 19 Aug 2021 07:20:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 19 Aug 2021 07:20:39 -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=32Umrmr7bVOCf HszrT7/dKCGNVfpwUR3PiX2IsuXkD0=; b=G7jqzqC6yTovn3LCiMtb7p0KUf2+9 Y4RIDiopXJetGWEE4rQrZxhNqsUQ8d4Jo2VSo4Zoz4RkJepxxfbPtuE+KIOGnbmq 089xqLCFJ31yxqgV8SqVl+4XO4SWUEfRIcAo1vRDhsMNOGIwXs7DiCH0/uezNWBC arByJysxScbcq5KUsf09SoXqUoWrAqz7wj8pZKGnPJANP/X+vW5fDoxCsKBzJlIW UvoApDWdbb/pn2AGkbaaEsJxSq6yQSSSdQNvCoH9My6Xp1FvKVnyRWFsE6zZZn9z CFoZ55LNS/J0rOZTtDYNQGDpfTLxdOg39uk4A9WAecJ46YUeczRTMVAmw== 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=32Umrmr7bVOCfHszrT7/dKCGNVfpwUR3PiX2IsuXkD0=; b=liXOY+Lj W7WaQVAekz4qYU1oSzl6GxYpdrXTHy/lE/uhSWbB6ysgkCX/f/gqT0FoF5cDaEUu 0bLcQSE77of1gKxSZkMpNbU5R8x9xebN1h/t4K2xuCU0LSChWxjjcBQvYcbBA/wV RRi/vC4S5fESEyRJLOT7fIQ7ePn/w9SUbjaTJpJQMFUNA50mIMP62gQG27+P+l7j RgzJGYK0eMCYtHcKTjnus64eTEwgJcUbMpOsRwvmuKsm2t8++mbwfLlulh8wvVG+ S4Q1nLKP+gp86SyPFXwObs6hYGsV+mJOdO8Fjv6g2vHRG4LjsxL8qW0Xk42TebPX Vakk+V5413Tnyw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomheptehlihhsthgr ihhrucfhrhgrnhgtihhsuceorghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgvqe enucggtffrrghtthgvrhhnpeeggedtteejkeeggeeugfehueevudegvdetjeeviedugedv tdekffekhedtteduhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:20:34 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org, Alistair Francis , Rob Herring Subject: [PATCH v9 01/11] dt-bindings: Add Wacom to vendor bindings Date: Thu, 19 Aug 2021 01:49:25 +1000 Message-Id: <20210818154935.1154-2-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154935.1154-1-alistair@alistair23.me> References: <20210818154935.1154-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Signed-off-by: Alistair Francis Acked-by: Rob Herring Cc: devicetree@vger.kernel.org --- 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 4dfaae537daf..31745c45dd92 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1252,6 +1252,8 @@ patternProperties: description: Vision Optical Technology Co., Ltd. "^vxt,.*": description: VXT Ltd + "^wacom,.*": + description: Wacom Co., Ltd "^wand,.*": description: Wandbord (Technexion) "^waveshare,.*": From patchwork Wed Aug 18 15:49:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 500619 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70679C4320A for ; Thu, 19 Aug 2021 11:20:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59B9361153 for ; Thu, 19 Aug 2021 11:20:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238165AbhHSLVV (ORCPT ); Thu, 19 Aug 2021 07:21:21 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:46653 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238546AbhHSLVU (ORCPT ); Thu, 19 Aug 2021 07:21:20 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 92808580C10; Thu, 19 Aug 2021 07:20:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 19 Aug 2021 07:20:43 -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=DvmjdCZONqMiz RnpwfTpRqqlbDgDApz/FK5y2XJHk4w=; b=UjMXUXe0lzGsnQxJnlGicJCs/AHpO 4I71RrxxgUnoMlEXlULLYhRUGI6Wy3OElkaSO0xngczbaTdiqgv14Zad7PXVxXgo kHd9drJxtK6nfaGJyGTuMiCCaVWojDZr+Pqc/5Fo8HfIDxN7d+01oUSQ2LbEVX3F lFhPjpG5OwNw7Xzbskaeq7XaxttmU9TIlsA0Z9wTLyDkTosi3SVru9iczU5BmfkT rWpY/cczFBGOQ4NxNcz30PoCSnP0n/UVELpn6ouSXUFtqq5NTB+slNbfa3ueZXej NnVCQSchLFunkDS7AL9wPsVznKR+P34qBVyDzlrml/tLXUDIByE7bzzYg== 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=DvmjdCZONqMizRnpwfTpRqqlbDgDApz/FK5y2XJHk4w=; b=d6+sCZaa GjDloDXfol41/U/zJmUIsrpOiXuqbSksr4PE2MH6o+BEwYK7Kz9aTj4C0GCp0lgQ 08P5FKmzfa4SdMxXUWHXaUU+mnVXAorXpcN7gMr15biAiAML5cimM4cO2ktXlLud kMqXPWz+8l6wj8Aw0WdSwpbORRdTdtyz2qXN5QwedpkDbifeGXieJvu+wVW+biOS z5hf+51NtrjWpL8RjA1Mrip9xHA9RWDjd8jqlE/TEY+75CCsXrMdBD2E62+yTWHi hq9EEY3GVaFqVozgu63ShiYh+0FMew7yhbq5czETGwT61Ahv7nI90PErZjrzMbtU gztQnbSlz6Ca/g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomheptehlihhsthgr ihhrucfhrhgrnhgtihhsuceorghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgvqe enucggtffrrghtthgvrhhnpefftdfhgfeggfelgfekjefhkeeigfelleefhfethfehfeet leeggeeggfefffdvtdenucffohhmrghinhepuggvvhhitggvthhrvggvrdhorhhgnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:20:39 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org, Alistair Francis , Rob Herring Subject: [PATCH v9 02/11] dt-bindings: touchscreen: Initial commit of wacom, i2c Date: Thu, 19 Aug 2021 01:49:26 +1000 Message-Id: <20210818154935.1154-3-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154935.1154-1-alistair@alistair23.me> References: <20210818154935.1154-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Signed-off-by: Alistair Francis Reviewed-by: Rob Herring Cc: devicetree@vger.kernel.org --- .../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..a8a7f362b0ce --- /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,i2c-30 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + vdd-supply: + description: Power Supply + +required: + - compatible + - reg + - interrupts + +unevaluatedProperties: false + +examples: + - | + #include "dt-bindings/interrupt-controller/irq.h" + i2c { + #address-cells = <1>; + #size-cells = <0>; + digitiser@9 { + compatible = "wacom,i2c-30"; + reg = <0x9>; + interrupt-parent = <&gpio1>; + interrupts = <9 IRQ_TYPE_LEVEL_LOW>; + vdd-supply = <®_touch>; + }; + }; From patchwork Wed Aug 18 15:49:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 499897 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B7B7C4320E for ; Thu, 19 Aug 2021 11:20:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 12C4D61156 for ; Thu, 19 Aug 2021 11:20:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238087AbhHSLVZ (ORCPT ); Thu, 19 Aug 2021 07:21:25 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:33915 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238612AbhHSLVY (ORCPT ); Thu, 19 Aug 2021 07:21:24 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 22DEF580C0E; Thu, 19 Aug 2021 07:20:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 19 Aug 2021 07:20:48 -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=FZjrgi31aOzX0tC6eplSIA2U+IRFj 1WmbGK0x5ng6hApjS/cZJSanEM7O1hseqJyXEX/fqZAXcmIE/ZEIlzVYUf4DhQ8G YPR+OTp5XXMJJMY8TEA9zkAhlBLS/5dgzUGIUREsR9koukUr0dCzQWBAATaz3JjT MMqZmRsr7jnIjn1WAiaTTTFdDueJAZBiszLeC9k5H2GVXj1rDdUanIQwLIl61qZp wKO4+YB8ER6q/PuFek00ElxotaZpVlpPpWdUo5obQymUbsUXfakMli2yRFppoB79 vGKVaag+SmqMpivFyu1y1h59uJjkPbxNoFkFgthM4bd2v/6Ma7EctYORg== 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=FmGFZrfQ ACGV/GXTGXAhjL5BNsDgDSjBrL8NtK7qbSPRlZG3srDO+/zF0z12nXYhGpXQzh4n /+BrorSAxJnW/lfrGJHM+QO4ltIFNdop23tZijRpKS3kHh1zc12qTXSDqZ9pSdHK iw5jH0ziYYmNh7QAAXlekUukgfZjG0MetyoBm0lxoxCS2BhAC31xECSeUbAt/o03 bq80VtU+gIJYEDWKfWfva1NopX2R3GreH5I4+uisIoVug4AO2jGQEDqNP9QVfvGb jWXjAtRRM+oekDSWgN8DO5MOIlwKGIuzAj3DzlV6ZiGh/qXohQouMR7Y9mgaF1Lk ExYenqvgXm7RNg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgepudenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:20:43 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org, Alistair Francis Subject: [PATCH v9 03/11] Input: wacom_i2c - Add device tree support to wacom_i2c Date: Thu, 19 Aug 2021 01:49:27 +1000 Message-Id: <20210818154935.1154-4-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154935.1154-1-alistair@alistair23.me> References: <20210818154935.1154-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@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 Wed Aug 18 15:49:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 500618 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9397C432BE for ; Thu, 19 Aug 2021 11:20:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C193E60E90 for ; Thu, 19 Aug 2021 11:20:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238655AbhHSLVc (ORCPT ); Thu, 19 Aug 2021 07:21:32 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:36485 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238745AbhHSLVa (ORCPT ); Thu, 19 Aug 2021 07:21:30 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id D2297580C0E; Thu, 19 Aug 2021 07:20:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 19 Aug 2021 07:20:53 -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=wDxD148pGxNLo fDiRuvl3Q1zS4b7Jw1CAMW3y7CSj/k=; b=B682DwcRnHBaLDwRGnbLkSGLL7zV1 +awkXg53d9OOHbnFzuGM1w+yzpeULlxzb+iHDaR4im6w0VXhVc4gG5pbQ/5AYJfa eW3erAUl+nP+orMRTIBp/ieFeA53ax4MV3C6j7xagmTLZwyo8+6J0BncaswjVv/N h9GWmOlWcKFJCnm47rpdcmqxaZ47nR+T8Yenj9Ca99wp+NUpHu47/1999GfNgTmL AUy3KRF2AOOHX4BVuemsuzVJ3Jb8JV1Uq8rNDZOQcXXHqwGLCoixZ+fkB/4+hfFa OJ7j+/YheAe79NjqBlO5B0nTeCpMii0r2pZBKifJ8HlKw6ih3kUWqwbGQ== 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=wDxD148pGxNLofDiRuvl3Q1zS4b7Jw1CAMW3y7CSj/k=; b=ijkfvo3N 7y8sQZ0BnxwQ18ZzLNmy8zmAb0gjVKZlMlT9CmfG1+1iZKaUJLw39aAsFWGsoYjZ BFCTf79FK4ce8M6LMvR9K/Y2D+GKQC59TUG9Eiq9BCWZgNMNc6i+nbcU7nVwT67S Ec2fSGYWY5CbbRzMrkq37d4xmqFlMUk3WkAGod1UK/0e6CyPjobHetv21pbmIVg/ z9N9aVebdwloHOhDpgsY1/tL210raNtWI+vflm7pa+MTCKXvOSzBbHZ2XbJTxm0I 0whnlWKx/G14mjfNCwVxV/1CMGxBOAcrKODhjLNKvZdlqlYFm/FYOpq4RgPnE1b6 OHJS2iEyhUttHA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:20:48 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org, Alistair Francis Subject: [PATCH v9 04/11] Input: wacom_i2c - Add touchscren properties Date: Thu, 19 Aug 2021 01:49:28 +1000 Message-Id: <20210818154935.1154-5-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154935.1154-1-alistair@alistair23.me> References: <20210818154935.1154-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Connect touchscreen properties to the wacom_i2c. Signed-off-by: Alistair Francis --- drivers/input/touchscreen/wacom_i2c.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index 6053595f2b30..28255c77d426 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,6 +118,8 @@ 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); @@ -151,7 +157,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 +165,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 +185,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 +197,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 Wed Aug 18 15:49:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 499896 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1DBFC43214 for ; Thu, 19 Aug 2021 11:21:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C4EA61175 for ; Thu, 19 Aug 2021 11:21:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238721AbhHSLVg (ORCPT ); Thu, 19 Aug 2021 07:21:36 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:55923 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238656AbhHSLVe (ORCPT ); Thu, 19 Aug 2021 07:21:34 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 23F20580BC3; Thu, 19 Aug 2021 07:20:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 19 Aug 2021 07:20: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=F3QSg3lIcPoB0 oTz0kpAR9eudbkvCfgPAbTccns9Gh4=; b=V9b/2nhQ9UALPuwLXWWwMWSvyrMji 5vf7fjzLGj3A+bwKfsX0h2bQNKAclB4nZPVy4zwIP51xvrSqiCPA/JwvLu0GwTM5 qtkBK5BuK7dKH1tYASzzZZOCmdZYL7nNwarLRW8viEkMx4bNMldtUo9xrC0+IxzJ z1xjP6zdCts6fPiSnoCA21VqyUhokjuOUggcFqcaZgVRvEJeB+bDrljJ27OnTZbl sTAifLAj3nacHkqGwHswo57Q6z85/nu0tfAwNhvGSERP8tfI2MHz1YHnjvcSNaDJ 9s1PBSUppxj8TvPQ8/7eNKsDez/Im9dQqEWDnLLycmLKOZiUI7brFvTcA== 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=F3QSg3lIcPoB0oTz0kpAR9eudbkvCfgPAbTccns9Gh4=; b=phb+6rx4 gSKfn+IUhm89DTB4am50B/khjz75wa3PM24bRN4xeyUMq77c2n1YQVCi7H2JuRCr Pf1Dq5fD3YhzcSHc/vPJeggBaDGeNAF0YNtfS/eDPHtGTvdVPQfGJRddbazdefBm 9svbgHTvKhJ/DuTeqU2jegIpdNssgV1bf52KDpg1mSO+N5n/GKksjpljXra46ADF RQMsHzJh6GN4j2Cy+TAfisDw8NdatBWQ1d4whFhbYrrh20cN8NCDf4j+PqGvo/0t 5KLirsHOAk6gA/4Cx+BTnOsJh9izEzE4tK+iGwT8Mc2+HRMPzY7LBZOrETEbM3Xz AnP2JQGOR9R5tA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgepudenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:20:54 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org, Alistair Francis Subject: [PATCH v9 05/11] Input: wacom_i2c - Add support for distance and tilt x/y Date: Thu, 19 Aug 2021 01:49:29 +1000 Message-Id: <20210818154935.1154-6-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154935.1154-1-alistair@alistair23.me> References: <20210818154935.1154-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add support for the distance and tilt x/y. This is based on the out of tree rM2 driver. Signed-off-by: Alistair Francis --- drivers/input/touchscreen/wacom_i2c.c | 35 +++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index 28255c77d426..4d0c19fbada4 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, @@ -112,6 +130,12 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) y = le16_to_cpup((__le16 *)&data[6]); pressure = le16_to_cpup((__le16 *)&data[8]); + /* Signed */ + tilt_x = le16_to_cpup((__le16 *)&data[11]); + tilt_y = le16_to_cpup((__le16 *)&data[13]); + + distance = le16_to_cpup((__le16 *)&data[15]); + if (!wac_i2c->prox) wac_i2c->tool = (data[3] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; @@ -127,6 +151,9 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) input_report_abs(input, ABS_X, x); input_report_abs(input, ABS_Y, y); input_report_abs(input, ABS_PRESSURE, pressure); + input_report_abs(input, ABS_DISTANCE, distance); + input_report_abs(input, ABS_TILT_X, tilt_x); + input_report_abs(input, ABS_TILT_Y, tilt_y); input_sync(input); out: @@ -202,7 +229,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 Wed Aug 18 15:49:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 500617 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D762C432BE for ; Thu, 19 Aug 2021 11:21:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DEA760E90 for ; Thu, 19 Aug 2021 11:21:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238845AbhHSLVs (ORCPT ); Thu, 19 Aug 2021 07:21:48 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:47217 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238865AbhHSLVi (ORCPT ); Thu, 19 Aug 2021 07:21:38 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 6DD3C580C0E; Thu, 19 Aug 2021 07:21:02 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 19 Aug 2021 07:21: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=Mgyn0Pl2gvmbZ jH/br8z7Blip4/G4e2q+jWo6laMznU=; b=e0eFTJbK5kh75ZDI9RYXUvFBkO5Cz 5fymH92saeXQZuC/zq4j6WtYt42x6sTQj0FQ7kOMTiP1473E9DzGbvHt+cMGdiYp jLfxzv5znY1sle1B9UXl8EfFfu6I77lxXlfWPvdDRrvOsptaPkdxdFHYmlAiufe7 V/NdUrrUhDyqpVlAJey6qH9LsB6HyzOxoz8HXDepA7o+ye65uUFleuM2dReph0nY 2U8fY1ZmY/dRwNOi6bcTajzO4wL/HTXCMKfe99iupGpXO88OW66mnMuzRnm2Gmx2 ct/UebxKkDj8rI5QIB0sPHNTj06UDh4sAfwcymwetP+eG8jXmb3FqAamA== 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=Mgyn0Pl2gvmbZjH/br8z7Blip4/G4e2q+jWo6laMznU=; b=I0lt1uUp 50mR5rQpcKWuc69yJa2nJOTD2TOt4uNP7yTnmCy9XukvJgejYdQQj7R6eMhCPVmn IzdGcu5dVR5tdw9rg0tMMJC526K00nJBKOX5XkZWi47AcqOs+1Xasw163ls8thd4 DpyOWoazuqpuBnSXEXOIK44GcNH6AF7O6kqpPrIdHYEWlLlS+0B0lg65on/+Js9D 7+5q2sK7QhN18drZyVAWYY/x1/uRDWEeY14QVQvXMA8ggbx8IkLqL8jaY7/NxMB7 h6vcQdYGLEzwByP0D+N7mLMryONc4nZbNIhKkOv8xIjajjo8xmhZ2IxcZtuwkoa4 TeHx8WQtnSIMeA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgepvdenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:20:58 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org, Alistair Francis Subject: [PATCH v9 06/11] Input: wacom_i2c - Clean up the query device fields Date: Thu, 19 Aug 2021 01:49:30 +1000 Message-Id: <20210818154935.1154-7-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154935.1154-1-alistair@alistair23.me> References: <20210818154935.1154-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@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 4d0c19fbada4..33a3ba110171 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 Wed Aug 18 15:49:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 499895 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9085C43214 for ; Thu, 19 Aug 2021 11:21:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E59060720 for ; Thu, 19 Aug 2021 11:21:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238981AbhHSLVw (ORCPT ); Thu, 19 Aug 2021 07:21:52 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:37253 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238808AbhHSLVo (ORCPT ); Thu, 19 Aug 2021 07:21:44 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 3BEFF580BC3; Thu, 19 Aug 2021 07:21:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 19 Aug 2021 07:21:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=9XSNySyo0dgk6 L24Qtk6hYM/zTivuRW683XZ2ixCBOE=; b=LX19B2YJWu4ndo1pe2uF25KQCiEse FjxdgNdu6mMd8UDTHlIZ8VI3mCAT4e3ywJhCCHn/9mH5XHYr+gF2nxYd8lgtfoEC //1nRiLX8YfxHcqKHMGXPMkUfCm0X6KxGdMHaN50AoU3q47mvdaMmuIo+8DIGAsK ibEgViPYIj5psOlME9qVP9e4pHcc5CFOARhvylspqrk+nnCSNT/JcTnu1rkIPdgS vjYUkWfVIQB8z2JN11XBc3wdDaZZ5k0pLFOCBaG4fO9IKjC2oYL7+GFoEE7TV2j4 XJy6IzIgBUUnEZA04oH0JXLUEIZyxwlXiCxeoiNRwW/SxmwNIxtJNmL/A== 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=9XSNySyo0dgk6L24Qtk6hYM/zTivuRW683XZ2ixCBOE=; b=wuJnqduF fkvvlfCgLCRvfloNZrAirxV12ZmH6vZ/lw5bpMfUPRhEga7f0BDxpXkMDpskwn2u /Jh26IqB9VRSiV/+i6sf2XBmvOcfD4F16vxRO94TjTmPN6uQBRZSSYjoT7eZ+B01 qQSjWinzGc/p099pvBwh3PniOAEyJFLTL6Fl8u15O3eTGr158T5jt6/8cjdIGWz3 6KPYbZIupkht2iphQxcGPDA4Ozq3Bafhaa1G8kEn5U0XwIHWWD9O5ZxDBtqgLJFm zDivZcxUeZvtsgz4s1zJppo/0imtmgLRe5+7Xgq8oU7qzotG3SjX7v8VniKAc55C vdrDKmJ12/BkxQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:21:02 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org, Alistair Francis Subject: [PATCH v9 07/11] Input: wacom_i2c - Add support for vdd regulator Date: Thu, 19 Aug 2021 01:49:31 +1000 Message-Id: <20210818154935.1154-8-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154935.1154-1-alistair@alistair23.me> References: <20210818154935.1154-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add support for a VDD regulator. This allows the kernel to probe 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 33a3ba110171..fd486b8ef2cc 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; @@ -220,6 +222,16 @@ static int wacom_i2c_probe(struct i2c_client *client, if (!wac_i2c) return -ENOMEM; + 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; + } + features = &wac_i2c->features; error = wacom_query_device(client, features); if (error) @@ -228,8 +240,11 @@ static int wacom_i2c_probe(struct i2c_client *client, 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; @@ -264,6 +279,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; } @@ -273,6 +290,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 Wed Aug 18 15:49:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 500616 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EB66C4320A for ; Thu, 19 Aug 2021 11:21:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 47B7E61152 for ; Thu, 19 Aug 2021 11:21:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238901AbhHSLVz (ORCPT ); Thu, 19 Aug 2021 07:21:55 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:51437 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238828AbhHSLVs (ORCPT ); Thu, 19 Aug 2021 07:21:48 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 88E28580C0E; Thu, 19 Aug 2021 07:21:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 19 Aug 2021 07:21:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=sudXsL0XPHhcq 21swpLW5Hc8hH7ACZW0Krc92I1Upyo=; b=epf/JGchTVtEAe4Qi35cQdLR2q1sJ /OwIjYoQr97Ajoo8QoQRayVGwzgs7E56r82NEJBoyXFK22FWMgkZI8NrKpjVGeOe hjDqJYzpcvxlXzwkxH1ryAP5ixvDBVIoEFFiPzSkkf0deb5gk8MrxXZMwNySY3x+ v4vR0aMjWVtO1roEZOXcfhHz9UXZ0zSTrfOh3ibho5GLidUl4PJXvY0gzJKabuY8 EEmOMPKh1Yxcxy36vK+k1ZHVsbMDp9DZ9yr/wyPzehJIYTRwxYivjElICaL1uJ7S O1H5a/GdoEYJrMaB/i3SRp1T1jUXaUMBzybmcywHrGFKM2CZuvz5aM3kg== 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=sudXsL0XPHhcq21swpLW5Hc8hH7ACZW0Krc92I1Upyo=; b=DkCLnlal l2i5lh6cQc0LMeh3PAn08CtfGR2bwOCMfCK0CAWMkv85V/+JfgD8YIAtQpn0no+H ZDOhAnvGmnFiUUO25pstFbuVkXYBYpztlFZ+YgKj6+Rbq/uU4qUtMdPMBXVXycIC 49AW78uBSrBruNLuVg7ZF1iiXvt0dD7vnCcA00Zydc/JhvKg+x6oMh+Enidj3OSO +NOQUy50az5Sdgbn7M044hKbJtJB4g56zCiFx/Xz/tVAS/ZEGuJqw0FPF6shpcWt Stgr8c4XhbHAj7SnFzS0Bdu0Ao3JeNVl8Huz8fGr3rxkibaOWcZlQmE2TLWQmBnP R3ntL6tVPFcyUA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgepvdenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:21:08 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org, Alistair Francis Subject: [PATCH v9 08/11] Input: wacom_i2c - Use macros for the bit masks Date: Thu, 19 Aug 2021 01:49:32 +1000 Message-Id: <20210818154935.1154-9-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154935.1154-1-alistair@alistair23.me> References: <20210818154935.1154-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org To make the code easier to read use macros for the bit masks. Signed-off-by: Alistair Francis --- drivers/input/touchscreen/wacom_i2c.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index fd486b8ef2cc..c6579a1a8d04 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -18,6 +18,14 @@ #include #include +// Bitmasks (for data[3]) +#define WACOM_TIP_SWITCH_bm (1 << 0) +#define WACOM_BARREL_SWITCH_bm (1 << 1) +#define WACOM_ERASER_bm (1 << 2) +#define WACOM_INVERT_bm (1 << 3) +#define WACOM_BARREL_SWITCH_2_bm (1 << 4) +#define WACOM_IN_RANGE_bm (1 << 5) + // Registers #define WACOM_COMMAND_LSB 0x04 #define WACOM_COMMAND_MSB 0x00 @@ -148,10 +156,10 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) if (error < 0) goto out; - tsw = data[3] & 0x01; - ers = data[3] & 0x04; - f1 = data[3] & 0x02; - f2 = data[3] & 0x10; + tsw = data[3] & WACOM_TIP_SWITCH_bm; + ers = data[3] & WACOM_ERASER_bm; + f1 = data[3] & WACOM_BARREL_SWITCH_bm; + f2 = data[3] & WACOM_BARREL_SWITCH_2_bm; x = le16_to_cpup((__le16 *)&data[4]); y = le16_to_cpup((__le16 *)&data[6]); pressure = le16_to_cpup((__le16 *)&data[8]); From patchwork Wed Aug 18 15:49:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 499894 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B431DC432BE for ; Thu, 19 Aug 2021 11:21:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C28960720 for ; Thu, 19 Aug 2021 11:21:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239035AbhHSLWC (ORCPT ); Thu, 19 Aug 2021 07:22:02 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:53079 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238896AbhHSLVx (ORCPT ); Thu, 19 Aug 2021 07:21:53 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id CCEC4580BC3; Thu, 19 Aug 2021 07:21:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 19 Aug 2021 07:21:16 -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=FKbcG/SSuUeVV rDhhMj/yHt2PNjV6DYHgylyNKHb+uM=; b=aFrVOdzMM31ojGj0nTaWi8DHFW8ur 7Qlm9TAwJcEelIU4YsaK0LCqgA8bXmxDHJ2+jYFl7+IuS/QZ0SfYITDrlOXhS2Gg DPBxlnkNIOaQrYXBATHm49uUN+EBfBQE7n68y5QrN9x4wYQ2lNXsKIGujCVHFpYH uHOUuvG5s0yYWvWuhr+Tk1ZC6am5P/zOdJ0ACpdsZoCL5ci+wOh77fN8Idi7inD3 PPZyyBdAUcAesVy2xiXrlHjE6RP+32ItbT5P3rNRIour85W+ufU8aMpB25HXb4yG 5VKqKA06hmJcZGmRT1QofHf04xBAngdQcrx/1jyE8E9CuDlZyqzq7LKfg== 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=FKbcG/SSuUeVVrDhhMj/yHt2PNjV6DYHgylyNKHb+uM=; b=HTcDC1o/ VMdFYJJH5khZT/fwJBT1Iml4jEmLmehKQLFrlBkGkib9oS1+t9kkwExvwx4DDWTb zykngBuJgEEvmDFnsFKj9svLTtUBKRs5CpsR7KxMp9rQoRFPN/dD0a4FWU28GMgZ 31aRmpRZviDd7/D7b04V780ZcfS6iQIPO8qaxgIp6z8RmWbzw7TJLLV+ZsOT9EGy PeomLcedLL4T51iK9kp2GcnY+Pp2hEzIcBiOCpftnyKH2jQTVpZV10CcLuNVE2t3 AXX6P63m6BGeG0ijgc4ETCXrCQGSUjLamNWKcv5POOEkuvs0obuSCMc2qm7Ncbu5 6/yAllgPL50iOQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgepfeenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:21:12 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org, Alistair Francis Subject: [PATCH v9 09/11] Input: wacom_i2c - Allow flipping the values from the DT Date: Thu, 19 Aug 2021 01:49:33 +1000 Message-Id: <20210818154935.1154-10-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154935.1154-1-alistair@alistair23.me> References: <20210818154935.1154-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Allow the device tree properties to flip the tilx, position or distance values. This is required for the stylus to work correctly on the reMarkable 2. Signed-off-by: Alistair Francis --- .../input/touchscreen/wacom,generic.yaml | 18 ++++++++++ drivers/input/touchscreen/wacom_i2c.c | 33 +++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/wacom,generic.yaml b/Documentation/devicetree/bindings/input/touchscreen/wacom,generic.yaml index a8a7f362b0ce..0da63fd92ea1 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/wacom,generic.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/wacom,generic.yaml @@ -25,6 +25,24 @@ properties: vdd-supply: description: Power Supply + flip-tilt-x: + type: boolean + + flip-tilt-y: + type: boolean + + flip-pos-x: + type: boolean + + flip-pos-y: + type: boolean + + flip-distance: + type: boolean + + flip-pressure: + type: boolean + required: - compatible - reg diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index c6579a1a8d04..82b62a768451 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -72,6 +72,13 @@ struct wacom_i2c { u8 data[WACOM_QUERY_SIZE]; bool prox; int tool; + + bool flip_tilt_x; + bool flip_tilt_y; + bool flip_pos_x; + bool flip_pos_y; + bool flip_distance; + bool flip_pressure; }; static int wacom_query_device(struct i2c_client *client, @@ -140,6 +147,20 @@ static int wacom_query_device(struct i2c_client *client, return 0; } +#ifdef CONFIG_OF +static void wacom_of_read(struct wacom_i2c *wac_i2c) +{ + struct i2c_client *client = wac_i2c->client; + + wac_i2c->flip_tilt_x = of_property_read_bool(client->dev.of_node, "flip-tilt-x"); + wac_i2c->flip_tilt_y = of_property_read_bool(client->dev.of_node, "flip-tilt-y"); + wac_i2c->flip_pos_x = of_property_read_bool(client->dev.of_node, "flip-pos-x"); + wac_i2c->flip_pos_y = of_property_read_bool(client->dev.of_node, "flip-pos-y"); + wac_i2c->flip_distance = of_property_read_bool(client->dev.of_node, "flip-distance"); + wac_i2c->flip_pressure = of_property_read_bool(client->dev.of_node, "flip-pressure"); +} +#endif + static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) { struct wacom_i2c *wac_i2c = dev_id; @@ -176,6 +197,14 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) wac_i2c->prox = data[3] & 0x20; + // Flip the values based on properties from the device tree + pressure = wac_i2c->flip_pressure ? (features->pressure_max - pressure) : pressure; + distance = wac_i2c->flip_distance ? -distance : distance; + x = wac_i2c->flip_pos_x ? (features->x_max - x) : x; + y = wac_i2c->flip_pos_y ? (features->y_max - y) : y; + tilt_x = wac_i2c->flip_tilt_x ? -tilt_x : tilt_x; + tilt_y = wac_i2c->flip_tilt_y ? -tilt_y : tilt_y; + touchscreen_report_pos(input, &wac_i2c->props, features->x_max, features->y_max, true); input_report_key(input, BTN_TOUCH, tsw || ers); @@ -303,6 +332,10 @@ static int wacom_i2c_probe(struct i2c_client *client, return error; } +#ifdef CONFIG_OF + wacom_of_read(wac_i2c); +#endif + return 0; } From patchwork Wed Aug 18 15:49:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 500615 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B71DC432BE for ; Thu, 19 Aug 2021 11:21:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6391761152 for ; Thu, 19 Aug 2021 11:21:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238799AbhHSLWF (ORCPT ); Thu, 19 Aug 2021 07:22:05 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:53235 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238828AbhHSLV7 (ORCPT ); Thu, 19 Aug 2021 07:21:59 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id B7085580C0E; Thu, 19 Aug 2021 07:21:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 19 Aug 2021 07:21:22 -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=+EvKAZLb0ChvJ XRDnM9S3OyJUJhWZBps8+iA1VzKiac=; b=k1mTW98Ui+eu9zfdoWUj4+xXi3zty DVZHGdZx0PRbinix7q4b5VGJajY7heTYV8Cf349XTbMaICKf8wCZcLusgFcsCFz7 G92UOX6cKLfFShC3J6WClBgGDUDnl+/btbAGtxQPUliNKZ2Iui/oSKJ/RK+STWNx l86xqxm4n1q+C4mzVL+fVm1Zofey5Mek91lNLbqVstpus9yr12OerveWxU8tNj4v hKcQEKgEGQb/7dFF57OIG1AWKKLSslzJTOgqX/2S32DyeAchTwYgx7zgEasXP/k4 0BlpfRXUX3cNs34YLsl+N63hF+HAh6Y6TFrQMnHshtcsAt1uXbDMR5chQ== 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=+EvKAZLb0ChvJXRDnM9S3OyJUJhWZBps8+iA1VzKiac=; b=divLTssv 7AVazRtCtzyFQ5+IbR+Rf5LLBoL5iX7TVj1jjWO9rl2aqxzWYY82BZZzhpGyAOBH g+gkkzC/KJeiGSDjnQ1+olE3ATO9FvhvHJ6o1nGakpuMFkTGz/XUuxaT6/vpZZZ+ Jz5REIzHZodxXcfbJUzemEAeCVUgcsk8toBrs6fKGVELamwP/NSAx9Abq1jOAUwq GPKQmB7/oUu1HES+2nLvceDGEWMnu2jUfpVeQLL1d+sSCVJwxhMZkdF3ApGT1tOL alSHVj/3zDSh4YQB8BftgN6Zm5uM8VPTRIrIPCWRscxSBizPIti9WoNHddxuF9bw OCq/RV97q4pnxA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:21:17 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org, Alistair Francis Subject: [PATCH v9 10/11] ARM: imx_v6_v7_defconfig: Enable Wacom I2C Date: Thu, 19 Aug 2021 01:49:34 +1000 Message-Id: <20210818154935.1154-11-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154935.1154-1-alistair@alistair23.me> References: <20210818154935.1154-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@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 079fcd8d1d11..477dac1edc75 100644 --- a/arch/arm/configs/imx_v6_v7_defconfig +++ b/arch/arm/configs/imx_v6_v7_defconfig @@ -176,6 +176,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 Wed Aug 18 15:49:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 499893 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.7 required=3.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A26CC4338F for ; Thu, 19 Aug 2021 11:21:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 251C061152 for ; Thu, 19 Aug 2021 11:21:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239133AbhHSLWN (ORCPT ); Thu, 19 Aug 2021 07:22:13 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:53079 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238865AbhHSLWD (ORCPT ); Thu, 19 Aug 2021 07:22:03 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 498B3580BC3; Thu, 19 Aug 2021 07:21:27 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 19 Aug 2021 07:21:27 -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=9COMIqJL2Ybx3 3JZ6BTNawSa1Jp0SEZ7LgvLm9CZf2M=; b=NmbUesK+MechTdvj0rIrg2HcUdkrZ wxkOc04IruNeKOXmPdUk67Nm3G6+2w6Prdo8HtZTTLmhVb4KkRF/AYfI4YtEm4LC OL7ebnm+tD7NGSKHRXbNAiQRef/YyCq94J6rJJqEo9P3kLpe5QmC55G79Y1Vu6WN x2lvS6kMsMZRayTH99zaZnt5vPFwxR8s5ARHA1/0CTiiSgGVsnn86gQDlPwkp2CJ sHa0cZlnB/d2e3PtRAFTAt6sSOeNuoOq1PquLYl0CcRmpdMiAfxGCKtCOTB11oK+ 6ltGq8DZGHBA6K8TEBDZDymhdZcZxtppkBvopqLnoebjTT3N9yRVFjU7w== 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=9COMIqJL2Ybx33JZ6BTNawSa1Jp0SEZ7LgvLm9CZf2M=; b=whUtOHHh 9GThPGHKSfuW3SRKHHk7560a9pT62a9iR3QYdnz9e6sCFQ9hE9CKxyY7ZeeQ0yD+ KYmG9p/qJ7E+LHwf02fjX2eESrjP3K1EAYjcawMafXNUKLAynnQj9EWwJm/t78go aqIzaovrKVIoXMRrPrtQD2/B52Zcfr0n0dGD+fI777xKMar9og1U0y64U3D4yRgf NXtbpbI5lha4cuokGaylR40kbtO5zfcmM+liLt9hFZ3OA5YLqxJ5ecOdDHwGwqwr +nl8LOGWAFsLaMjNBtn5ak5NJ9iE2o/UOPIr5cY1KHvS8x0iBx0zbvHNUdX7JWKO X21AzpBD09NkgA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdefjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgepgeenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 07:21:23 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org, Alistair Francis Subject: [PATCH v9 11/11] ARM: dts: imx7d: remarkable2: add wacom digitizer device Date: Thu, 19 Aug 2021 01:49:35 +1000 Message-Id: <20210818154935.1154-12-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210818154935.1154-1-alistair@alistair23.me> References: <20210818154935.1154-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@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 89cbf13097a4..052f9da32398 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_LEVEL_LOW>; + 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