From patchwork Thu Jan 21 06:56:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12037641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 22F64C433E0 for ; Thu, 21 Jan 2021 20:38:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4DEC2389F for ; Thu, 21 Jan 2021 20:38:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727770AbhAUHuL (ORCPT ); Thu, 21 Jan 2021 02:50:11 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:33149 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726488AbhAUG6D (ORCPT ); Thu, 21 Jan 2021 01:58:03 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E563D5C00F4; Thu, 21 Jan 2021 01:56:48 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 21 Jan 2021 01:56:48 -0500 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=SJWixD92WzD5A KdY55B5gYlOoEKpKsI7RztlWKiuj1M=; b=jtEZnlyQ+uchiJntQ4O97J8kXQUca 5BabrIOan80CNLoJnsAQBFHLtKxP9LAVjqxnX4VTZCFloEi9F/oz1PLp5bPKj5Xk Hl6CzPjvgyUoWBmI9EEEJ0j/z9kl2we1qe+RI6ItuEyCxsSPiQGtjZPyMUGLP+7r jOy7E331KQmut369oZSxUwKx2YKphKXkf9AjSmBPLqJjlgeM6S2rRmTPD6xG7WAs gfvEgJKx7Mhv8pNJ7o+DwqB3stulykp38qETuGi73f0TsRAYT36CTuVcV8CAvB6S 2+ITPfdy0jxA3OQHoWTr2FAI4ApNapsFVSNwKtfzNeIV3rczhwl4JuU5A== 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= fm1; bh=SJWixD92WzD5AKdY55B5gYlOoEKpKsI7RztlWKiuj1M=; b=oMwtOu5F CEnaTB15tmGbzB+My0DWrh8IvqBDjGwxrc3wq4TbSP8LaZck23zWoLqQNpNNwBWk AjhKKbwaAVGqVn8j1VgI7v6hRObmy0Rzs+8wTPloMwip6GcqFZXt8YbM5srot3lm L852lY6gANUXGWGpRlHJxw8cx++Oz5tZTI35N34CcyXyjtUL34WdeL7J7CrkZbF2 8QUanonR+8+QVd+MdXpkn0//q49wyeL8cOip6J6Ilb/20OZNb6M9rnJW6THJP29c uwdM14CKfg3Sw3PbVoTMrkoxrNg3qIk0VpVymgRlePvMHT3YCq1cY0jKuKQKcJDM JP7l9/BJBWzhoA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefgddutddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpefftdfhgfeggf elgfekjefhkeeigfelleefhfethfehfeetleeggeeggfefffdvtdenucffohhmrghinhep uggvvhhitggvthhrvggvrdhorhhgnecukfhppeejfedrleefrdekgedrvddtkeenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (c-73-93-84-208.hsd1.ca.comcast.net [73.93.84.208]) by mail.messagingengine.com (Postfix) with ESMTPA id E97261080064; Thu, 21 Jan 2021 01:56:47 -0500 (EST) 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 v2 1/6] devicetree/bindings: Initial commit of wacom,wacom-i2c Date: Wed, 20 Jan 2021 22:56:38 -0800 Message-Id: <20210121065643.342-2-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210121065643.342-1-alistair@alistair23.me> References: <20210121065643.342-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,wacom-i2c.yaml | 44 +++++++++++++++++++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + 2 files changed, 46 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/wacom,wacom-i2c.yaml diff --git a/Documentation/devicetree/bindings/input/touchscreen/wacom,wacom-i2c.yaml b/Documentation/devicetree/bindings/input/touchscreen/wacom,wacom-i2c.yaml new file mode 100644 index 000000000000..b36d22cd20a2 --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/wacom,wacom-i2c.yaml @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/wacom,wacom-i2c.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Wacom I2C Controller + +maintainers: + - Alistair Francis + +allOf: + - $ref: touchscreen.yaml# + +properties: + compatible: + const: wacom,wacom-i2c + + reg: + maxItems: 1 + + interrupts: + 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,wacom-i2c"; + reg = <0x9>; + interrupt-parent = <&gpio1>; + interrupts = <9 IRQ_TYPE_LEVEL_LOW>; + }; + }; diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 041ae90b0d8f..5bca22f035a3 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1202,6 +1202,8 @@ patternProperties: description: Vision Optical Technology Co., Ltd. "^vxt,.*": description: VXT Ltd + "^wacom,.*": + description: Wacom Co., Ltd "^wand,.*": description: Wandbord (Technexion) "^waveshare,.*": From patchwork Thu Jan 21 06:56:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12035033 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 86540C433E9 for ; Thu, 21 Jan 2021 07:49:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 545372313E for ; Thu, 21 Jan 2021 07:49:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727527AbhAUHst (ORCPT ); Thu, 21 Jan 2021 02:48:49 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:33493 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726533AbhAUG6D (ORCPT ); Thu, 21 Jan 2021 01:58:03 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E81975C00DF; Thu, 21 Jan 2021 01:56:49 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 21 Jan 2021 01:56:49 -0500 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=oJodX6qpXFQV+ VsYmHwJjMPWcGqsiXCsjC3oiV31AZQ=; b=FUtFZx7Ggjfrm/qJjbj1QIYWcud14 MuLt/fjrKzLs89va+9GXKXWoILHh900Zf/WBiOUT+y5peSFBHsrJgWxaTRRk7YR2 9pk4tJBk/2aytHoqgpZS3p4RB0Sbb3HGlb9w7SG1DJbrN0Amk2dxtaUR5UaUiQ4A fjoPwoi95wuWIG9wnB0Kilav1Jf6HP1Vf2bTO5GbCuxWkQPcEph5eXGumVgzpYWI YsGbwX0W33632KEQUUcfZlHlpc6xwyuH9em1RNPfTYibVm+BbE/7/F6U226qnOce 7DaYEGaTKMS5WVE14tKS0yzAoQ7zsZQDHT+/t8LEGm49wtlciCAa+iIAA== 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= fm1; bh=oJodX6qpXFQV+VsYmHwJjMPWcGqsiXCsjC3oiV31AZQ=; b=TUJMprGm 7TSy96+Eoz72UAnJRi0L+fnXCxzh1uhiW3z30+CQBvLkt4jMdApo6PPRVdjrLgA6 lnzPk3ql/QLRALvu2OYoboU1OYIf/KF5jgHYVSB5ojC8Cmu1i0pP3k3SNUNfiZYy lo+9sldG1lXrMtUoeznigF8aqObp+rYKKZF6jD6m1x+01h0gZF3qKAsN56001PS4 EYExiX/mcPU7M/0GiPOH/K87FmqxamXpAK0A3/CHbhbTMzsG0ak1G78gG9WhgvH3 2oARrfKatbWYpTJwTwTuKlNWgfMZX3mRBfvzyYGpsr27/PgIn+ANNuaZPYCRr8IO WFaQTxtCAJfUjg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefgddutddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepjeefrdel fedrkeegrddvtdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (c-73-93-84-208.hsd1.ca.comcast.net [73.93.84.208]) by mail.messagingengine.com (Postfix) with ESMTPA id 013191080057; Thu, 21 Jan 2021 01:56:48 -0500 (EST) 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 v2 2/6] input/touchscreen: Add device tree support to wacom_i2c Date: Wed, 20 Jan 2021 22:56:39 -0800 Message-Id: <20210121065643.342-3-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210121065643.342-1-alistair@alistair23.me> References: <20210121065643.342-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 --- .../input/touchscreen/wacom,wacom-i2c.yaml | 4 ++++ drivers/input/touchscreen/wacom_i2c.c | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/wacom,wacom-i2c.yaml b/Documentation/devicetree/bindings/input/touchscreen/wacom,wacom-i2c.yaml index b36d22cd20a2..06ad5ee561af 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/wacom,wacom-i2c.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/wacom,wacom-i2c.yaml @@ -22,6 +22,9 @@ properties: interrupts: maxItems: 1 + vdd-supply: + maxItems: 1 + required: - compatible - reg @@ -40,5 +43,6 @@ examples: reg = <0x9>; interrupt-parent = <&gpio1>; interrupts = <9 IRQ_TYPE_LEVEL_LOW>; + vdd-supply = <®_touch>; }; }; diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index 1afc6bde2891..ec6e0aff8deb 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -11,7 +11,9 @@ #include #include #include +#include #include +#include #include #define WACOM_CMD_QUERY0 0x04 @@ -32,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; @@ -187,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, @@ -214,6 +218,7 @@ static int wacom_i2c_probe(struct i2c_client *client, } i2c_set_clientdata(client, wac_i2c); + return 0; err_free_irq: @@ -262,10 +267,21 @@ static const struct i2c_device_id wacom_i2c_id[] = { }; MODULE_DEVICE_TABLE(i2c, wacom_i2c_id); +#ifdef CONFIG_OF +static const struct of_device_id wacom_i2c_of_match_table[] = { + { .compatible = "wacom,wacom-i2c" }, + {} +}; +MODULE_DEVICE_TABLE(of, wacom_i2c_of_match_table); +#endif + static struct i2c_driver wacom_i2c_driver = { .driver = { .name = "wacom_i2c", .pm = &wacom_i2c_pm, +#ifdef CONFIG_OF + .of_match_table = of_match_ptr(wacom_i2c_of_match_table), +#endif }, .probe = wacom_i2c_probe, From patchwork Thu Jan 21 06:56:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12037643 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 48DABC433DB for ; Thu, 21 Jan 2021 20:39:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB51E2389B for ; Thu, 21 Jan 2021 20:39:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727788AbhAUHs5 (ORCPT ); Thu, 21 Jan 2021 02:48:57 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:60765 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726531AbhAUG6D (ORCPT ); Thu, 21 Jan 2021 01:58:03 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id EB9425C00E5; Thu, 21 Jan 2021 01:56:50 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 21 Jan 2021 01:56:50 -0500 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=hjkcziuEISlgP zvUtaoI0dsvabdQteZf1dpUx9Wn+oQ=; b=HzD7jY79SQPY1YF0OVhvzjv4hKNHi iOLQsHwCEnDjqpDqtRyMkeIAiGF1SVOSnYngZAGMyygTlJfEt+WqfGgY+e4EQyuI 8mi00j1LSP5bt61ab19X2aFWATzTk4+gn7vC3dMFzWG+b98kV/TZIMIVQLw/LqGc iovfFVCvlrV+gjoE3lCVIbQWwxshNmJavcaBwRF7CYdsT8z/U9NHlN1ISFQeXiTv sPf+RhuNHEV24oINKVg8fitaEAgmgL5hy+UEpoiWcSyIXgoPq1kvTQzw7YdDC0n2 LDBlLNKPUPKezkSrXTruDHL3cDLZ22B5ze6RXGciE0wDPJoYdVnHCJCAA== 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= fm1; bh=hjkcziuEISlgPzvUtaoI0dsvabdQteZf1dpUx9Wn+oQ=; b=LhHOSexq mhqDdzjUV8xcmbTqVn6hiS66057eQQtF5aQNvL/+VSgqfCwKxhI794ZoCiTU5XVW oVWPPwEDJSLdZXbVXG5UmKB6RCWGDsahjiJL9HuZwORUsKyMknLAoabgsXUkfui+ FDdHSgDYz4crm+lxkxNSiNnPjHXLWPE1IiOVhygTI05wUCmoncFRcjKk1/2wP81t zD3dJ/LKX2TcA+4ggwxhTRhNXc3m68wnZyndxItxlpdAC+N+8LFcKhjw33kgbmxL vHB/sHEkigASRKzWRemVjtp8o+/tQA6RngRaUedLK7hzh0NJ/tOIujVoW5aZhI/6 n3oFszewr67H0Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefgddutddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepjeefrdel fedrkeegrddvtdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (c-73-93-84-208.hsd1.ca.comcast.net [73.93.84.208]) by mail.messagingengine.com (Postfix) with ESMTPA id 0339B1080057; Thu, 21 Jan 2021 01:56:49 -0500 (EST) 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 v2 3/6] touchscreen/wacom_i2c: Add support for distance and tilt x/y Date: Wed, 20 Jan 2021 22:56:40 -0800 Message-Id: <20210121065643.342-4-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210121065643.342-1-alistair@alistair23.me> References: <20210121065643.342-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org This is based on the out of tree rM2 driver. Signed-off-by: Alistair Francis --- drivers/input/touchscreen/wacom_i2c.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index ec6e0aff8deb..5f0b80d52ad5 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -22,12 +22,16 @@ #define WACOM_CMD_QUERY3 0x02 #define WACOM_CMD_THROW0 0x05 #define WACOM_CMD_THROW1 0x00 -#define WACOM_QUERY_SIZE 19 +#define WACOM_QUERY_SIZE 22 struct wacom_features { int x_max; int y_max; int pressure_max; + int distance_max; + int distance_physical_max; + int tilt_x_max; + int tilt_y_max; char fw_version; }; @@ -79,6 +83,10 @@ static int wacom_query_device(struct i2c_client *client, features->y_max = get_unaligned_le16(&data[5]); features->pressure_max = get_unaligned_le16(&data[11]); features->fw_version = get_unaligned_le16(&data[13]); + features->distance_max = data[15]; + features->distance_physical_max = data[16]; + features->tilt_x_max = get_unaligned_le16(&data[17]); + features->tilt_y_max = get_unaligned_le16(&data[19]); dev_dbg(&client->dev, "x_max:%d, y_max:%d, pressure:%d, fw:%d\n", @@ -95,6 +103,7 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) u8 *data = wac_i2c->data; unsigned int x, y, pressure; unsigned char tsw, f1, f2, ers; + short tilt_x, tilt_y, distance; int error; error = i2c_master_recv(wac_i2c->client, @@ -109,6 +118,11 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) x = le16_to_cpup((__le16 *)&data[4]); y = le16_to_cpup((__le16 *)&data[6]); pressure = le16_to_cpup((__le16 *)&data[8]); + distance = data[10]; + + /* Signed */ + tilt_x = le16_to_cpup((__le16 *)&data[11]); + tilt_y = le16_to_cpup((__le16 *)&data[13]); if (!wac_i2c->prox) wac_i2c->tool = (data[3] & 0x0c) ? @@ -123,6 +137,9 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) input_report_abs(input, ABS_X, x); input_report_abs(input, ABS_Y, y); input_report_abs(input, ABS_PRESSURE, pressure); + input_report_abs(input, ABS_DISTANCE, distance); + input_report_abs(input, ABS_TILT_X, tilt_x); + input_report_abs(input, ABS_TILT_Y, tilt_y); input_sync(input); out: @@ -195,7 +212,11 @@ static int wacom_i2c_probe(struct i2c_client *client, input_set_abs_params(input, ABS_Y, 0, features.y_max, 0, 0); input_set_abs_params(input, ABS_PRESSURE, 0, features.pressure_max, 0, 0); - + input_set_abs_params(input, ABS_DISTANCE, 0, features.distance_max, 0, 0); + input_set_abs_params(input, ABS_TILT_X, -features.tilt_x_max, + features.tilt_x_max, 0, 0); + input_set_abs_params(input, ABS_TILT_Y, -features.tilt_y_max, + features.tilt_y_max, 0, 0); input_set_drvdata(input, wac_i2c); error = request_threaded_irq(client->irq, NULL, wacom_i2c_irq, From patchwork Thu Jan 21 06:56:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12037647 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=-15.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,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 1503DC433E6 for ; Thu, 21 Jan 2021 20:39:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D58A52389F for ; Thu, 21 Jan 2021 20:39:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726809AbhAUHsg (ORCPT ); Thu, 21 Jan 2021 02:48:36 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:59637 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726448AbhAUG6D (ORCPT ); Thu, 21 Jan 2021 01:58:03 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id EFEF45C00EF; Thu, 21 Jan 2021 01:56:51 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 21 Jan 2021 01:56:51 -0500 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=Jzi3cSowWS5S7 0nBZeVOs2bPOJ//6VSXwxqn9sDhYyQ=; b=ekqWlwwehrCpGozy5ekgMgAmIq947 rgcFOXZb98n4PxN+YIsDAlwruO4URYKcgCGMQI5qhPTE8Aja0fM+RPgXOuEq7DDV jGW5H3BLd9s3T9Wc8A5xPdGSRurcGVn2s23/kiLxV43iJe4GkbLktpO8pTNfB64F RXzdR13ACWGZIxDz89i2rZ1qTEF9nV+DYWCQp/DjGvoeLzQvrUmJvgupd+ox/Q5t psmNBcIQitPcJCRAYYKNKXrjmcAqP0amCttCXTkV6BUYmHPjk/jVhQmsP06vZ1GF YNaKmjip13YUjNjCtalsYt3nCo+mO9b2Ti8WrUo4h4pIhkSbu0X9MOBOA== 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= fm1; bh=Jzi3cSowWS5S70nBZeVOs2bPOJ//6VSXwxqn9sDhYyQ=; b=FPYlGcpY VfR3s9YbX0ztpLdn2QKiXioWuNuupEMddxBh8T3gUfh6gUJU34optlDn5sN+mIzV 6ycNuQEUZkZRoIuerg+2X0oNQGSBjjDqHFOyI37UPfvv6rO5a3HVdXKDV0+DTsw4 GZ3hoTxdwa6RBTlIL2T5snYkBzKk4hjJTtU5AwQ8UAVv2uuItL38UGiONWdZLKxW rhOil4lWDmDeMIHFkERDO3owgnbsMz8KDsI2vLRsio5YBY8dXZdmbPTcQ6vZnb4k 1/yQMMT8IWWZG3jPRaMKVNZo+SzzgtfJg0VDJbuX4iOKf3k6IWZJnKwRdrJNcIpG 4N/H0iMs21yIgw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefgddutddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepjeefrdel fedrkeegrddvtdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (c-73-93-84-208.hsd1.ca.comcast.net [73.93.84.208]) by mail.messagingengine.com (Postfix) with ESMTPA id 0779E1080057; Thu, 21 Jan 2021 01:56:50 -0500 (EST) 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 v2 4/6] touchscreen/wacom_i2c: Clean up the query device fields Date: Wed, 20 Jan 2021 22:56:41 -0800 Message-Id: <20210121065643.342-5-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210121065643.342-1-alistair@alistair23.me> References: <20210121065643.342-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 | 73 +++++++++++++++++++-------- 1 file changed, 52 insertions(+), 21 deletions(-) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index 5f0b80d52ad5..a22570adc939 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -13,15 +13,32 @@ #include #include #include +#include #include #include -#define WACOM_CMD_QUERY0 0x04 -#define WACOM_CMD_QUERY1 0x00 -#define WACOM_CMD_QUERY2 0x33 -#define WACOM_CMD_QUERY3 0x02 -#define WACOM_CMD_THROW0 0x05 -#define WACOM_CMD_THROW1 0x00 +// Registers +#define WACOM_COMMAND_LSB 0x04 +#define WACOM_COMMAND_MSB 0x00 + +#define WACOM_DATA_LSB 0x05 +#define WACOM_DATA_MSB 0x00 + +// Report types +#define REPORT_FEATURE 0x30 + +// Requests / operations +#define OPCODE_GET_REPORT 0x02 + +// Power settings +#define POWER_ON 0x00 +#define POWER_SLEEP 0x01 + +// Input report ids +#define WACOM_PEN_DATA_REPORT 2 +#define WACOM_SHINONOME_REPORT 26 + +#define WACOM_QUERY_REPORT 3 #define WACOM_QUERY_SIZE 22 struct wacom_features { @@ -45,34 +62,44 @@ struct wacom_i2c { }; static int wacom_query_device(struct i2c_client *client, - struct wacom_features *features) + struct wacom_features *features) { int ret; - u8 cmd1[] = { WACOM_CMD_QUERY0, WACOM_CMD_QUERY1, - WACOM_CMD_QUERY2, WACOM_CMD_QUERY3 }; - u8 cmd2[] = { WACOM_CMD_THROW0, WACOM_CMD_THROW1 }; u8 data[WACOM_QUERY_SIZE]; + struct reset_control *rstc; + + u8 get_query_data_cmd[] = { + WACOM_COMMAND_LSB, + WACOM_COMMAND_MSB, + REPORT_FEATURE | WACOM_QUERY_REPORT, + OPCODE_GET_REPORT, + WACOM_DATA_LSB, + WACOM_DATA_MSB, + }; + struct i2c_msg msgs[] = { + // Request reading of feature ReportID: 3 (Pen Query Data) { .addr = client->addr, .flags = 0, - .len = sizeof(cmd1), - .buf = cmd1, - }, - { - .addr = client->addr, - .flags = 0, - .len = sizeof(cmd2), - .buf = cmd2, + .len = sizeof(get_query_data_cmd), + .buf = get_query_data_cmd, }, + // Read 21 bytes { .addr = client->addr, .flags = I2C_M_RD, - .len = sizeof(data), + .len = WACOM_QUERY_SIZE - 1, .buf = data, }, }; + rstc = devm_reset_control_get_optional_exclusive(&client->dev, NULL); + if (IS_ERR(rstc)) + dev_err(&client->dev, "Failed to get reset control before init\n"); + else + reset_control_reset(rstc); + ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); if (ret < 0) return ret; @@ -89,9 +116,13 @@ static int wacom_query_device(struct i2c_client *client, features->tilt_y_max = get_unaligned_le16(&data[19]); dev_dbg(&client->dev, - "x_max:%d, y_max:%d, pressure:%d, fw:%d\n", + "x_max:%d, y_max:%d, pressure:%d, fw:%d, " + "distance: %d, phys distance: %d, " + "tilt_x_max: %d, tilt_y_max: %d\n", features->x_max, features->y_max, - features->pressure_max, features->fw_version); + features->pressure_max, features->fw_version, + features->distance_max, features->distance_physical_max, + features->tilt_x_max, features->tilt_y_max); return 0; } From patchwork Thu Jan 21 06:56:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12034933 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 A85A0C433E6 for ; Thu, 21 Jan 2021 07:08:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 61DDF2396D for ; Thu, 21 Jan 2021 07:08:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725988AbhAUHI1 (ORCPT ); Thu, 21 Jan 2021 02:08:27 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:40903 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727078AbhAUHAR (ORCPT ); Thu, 21 Jan 2021 02:00:17 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 023AC5C00EB; Thu, 21 Jan 2021 01:56:53 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 21 Jan 2021 01:56:53 -0500 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=Uht3iC/SsfC5u zyT3GSWG1iiRBlvfC4inAbmhJVb0aA=; b=KsNAtJHRIlTwkDfWoQOUOQ5ZNPc4g W3H+MCAZRA5F6iySliLpkHGzWcLzKMMNMZgUAR6vvGPJsbXDVJJPbJoiEBKUktLU iribAnAxqDx5U5l2+O2nzs3dx73mvF/hRDi+OLaKAI9ND6xbiVYU8uB3/Yv9kd4D xDLa6m0R6/EKKsgpWYv4pPLxdeR+nbwvD9aeHaaqADyobNYKOIQpIU7brM2mkfDE mGqt/GKEO4Ua1oH6I0zT+ylQwZqja6e/XYH07piet5jy/XygvOEB2xIu1jf6Vvq5 h6Jv847hA74NhgtzR61ssPzU5O8SqjAFeHluayGf4dcYimiAaDcmg6c+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= fm1; bh=Uht3iC/SsfC5uzyT3GSWG1iiRBlvfC4inAbmhJVb0aA=; b=GESiybsf VaUj5cXBQVJnpYIE/YCc7zTQl/FuYC3at7ROFguUAiAbqGG8iIA41cQf7XwZCHuX ig/mDpFPEMBlidBSQ+G+cmci3V/a4sy99ne76JbOOzpniv38UBdcM4IM8xYZPhXR AMpkAnsfEBI7mW4KO2eGYZlg2xmiZw2CB403lnP7c4sQ6g3Vdwp10BI4czVMfZse PclWsj7pZQxmNpMECRPaumpBd9YwgV7H2L+li4Azr6zUPzNUQYEN4gGsVRnqfC9M jMy3BIFSc+KmKjcw84uq4hQVw8ItfBO/1nNK1u+Fkcqyk0t/Z8leu1KKR0A2qAk+ +N8R4Uc8XEaGvA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefgddutddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepjeefrdel fedrkeegrddvtdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (c-73-93-84-208.hsd1.ca.comcast.net [73.93.84.208]) by mail.messagingengine.com (Postfix) with ESMTPA id 0FD7A1080057; Thu, 21 Jan 2021 01:56:51 -0500 (EST) 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 v2 5/6] touchscreen/wacom_i2c: Add support for vdd regulator Date: Wed, 20 Jan 2021 22:56:42 -0800 Message-Id: <20210121065643.342-6-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210121065643.342-1-alistair@alistair23.me> References: <20210121065643.342-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Add support for a VDD regulator. This allows the kernel to prove the Wacom-I2C device on the rM2. Signed-off-by: Alistair Francis --- drivers/input/touchscreen/wacom_i2c.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index a22570adc939..6d85a7bd0502 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -56,6 +57,7 @@ struct wacom_i2c { struct i2c_client *client; struct input_dev *input; struct touchscreen_properties props; + struct regulator *vdd; u8 data[WACOM_QUERY_SIZE]; bool prox; int tool; @@ -203,11 +205,29 @@ static int wacom_i2c_probe(struct i2c_client *client, struct wacom_features features = { 0 }; int error; + wac_i2c = kzalloc(sizeof(*wac_i2c), GFP_KERNEL); + if (!wac_i2c) + return -ENOMEM; + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { dev_err(&client->dev, "i2c_check_functionality error\n"); return -EIO; } + wac_i2c->vdd = regulator_get(&client->dev, "vdd"); + if (IS_ERR(wac_i2c->vdd)) { + error = PTR_ERR(wac_i2c->vdd); + kfree(wac_i2c); + return error; + } + + error = regulator_enable(wac_i2c->vdd); + if (error) { + regulator_put(wac_i2c->vdd); + kfree(wac_i2c); + return error; + } + error = wacom_query_device(client, &features); if (error) return error; @@ -276,6 +296,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 Thu Jan 21 06:56:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12034927 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 EFB7FC433E0 for ; Thu, 21 Jan 2021 07:02:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 96C8623788 for ; Thu, 21 Jan 2021 07:02:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727116AbhAUHBq (ORCPT ); Thu, 21 Jan 2021 02:01:46 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:43397 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727030AbhAUG7z (ORCPT ); Thu, 21 Jan 2021 01:59:55 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 083A35C00FF; Thu, 21 Jan 2021 01:56:54 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 21 Jan 2021 01:56:54 -0500 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=D5q7/JpfWnXMs /U4/SdqmnZ4pMs2OR5puiCrTr0sajE=; b=Hrq9b3zieHUW2k/J5MFrdHjXoSHXk F0wYlJo5rqOauNSaFl/d42c52Sb6adSfvalqc6tR1KJtjyfJwJ7ZlWxM/7y4Hp0o 1vLqUBWodEJFAdnxVu/ZZjhskFM9HFD7SUQAjTCrZQf0xC8MAsthbyDcvWUlFX33 A/QFVebDaFeELKm2/wryWZoGQmA7Gaz8lNZMFpEt8a7a4IllciDQb6CXAsK5ytcX j8t7VuDAxr/PDUiIAAXiihOTVXbskq8gJFoyeNUHthQgFS5RVhaCSBzfWwWKNUID 2qHK/JgF7gaLJGHZqsW7etfQsWFc+dAKm9aehk9pBic6gfjquXmCMTGeQ== 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= fm1; bh=D5q7/JpfWnXMs/U4/SdqmnZ4pMs2OR5puiCrTr0sajE=; b=R82duAvM aKVruW7TzsaWPlo+/2zLpA31XfK9/2gisBAfmxi7rFCrEvrZ8jlXUK7xlD9R3OtO f1V7u+v0Y4fpuqzOlj72glXGcpLXRz4ix8PFh6Rcms2MFrdqgjlG7xN6GEiTvORi BGDKcUkXknYCZmdy3wt+Yb0D364MN8g5IT+Wddrg2jT/krQ4WS6gg9y/28pRHPj5 zDd/0rTsiGwafYUbpapnTAcyuH0I07mBcFUIq8Ba9Zb846uKoPI1lHPQfxpNvW9d 2PmKzrRYHcXHEPKAUl/t/DQEeLHa9JoiAu8L8X7e3y4fkNGzD0YXE+Oc55Y0U7ZA 54jGLgLL3t6qZw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefgddutddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepjeefrdel fedrkeegrddvtdeknecuvehluhhsthgvrhfuihiivgepgeenucfrrghrrghmpehmrghilh hfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (c-73-93-84-208.hsd1.ca.comcast.net [73.93.84.208]) by mail.messagingengine.com (Postfix) with ESMTPA id 13D0C1080057; Thu, 21 Jan 2021 01:56:52 -0500 (EST) 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 v2 6/6] arch/arm: reMarkable2: Enable wacom_i2c Date: Wed, 20 Jan 2021 22:56:43 -0800 Message-Id: <20210121065643.342-7-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210121065643.342-1-alistair@alistair23.me> References: <20210121065643.342-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 | 41 +++++++++++++++++++++++++ arch/arm/configs/imx_v6_v7_defconfig | 1 + 2 files changed, 42 insertions(+) diff --git a/arch/arm/boot/dts/imx7d-remarkable2.dts b/arch/arm/boot/dts/imx7d-remarkable2.dts index fba55a0e028a..8052d884a5e5 100644 --- a/arch/arm/boot/dts/imx7d-remarkable2.dts +++ b/arch/arm/boot/dts/imx7d-remarkable2.dts @@ -150,6 +150,30 @@ &dma_apbh { status = "disabled"; }; +&i2c1 { + clock-frequency = <400000>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&pinctrl_i2c1>; + pinctrl-1 = <&pinctrl_i2c1>; + status = "okay"; + + digitizer: wacom-i2c@9 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&pinctrl_wacom>; + pinctrl-1 = <&pinctrl_wacom>; + compatible = "wacom,wacom-i2c"; + reg = <0x09>; + interrupt-parent = <&gpio1>; + interrupts = <1 2>; + flip-tilt-x; + flip-tilt-y; + flip-pos-x; + flip-pos-y; + flip-distance; + vdd-supply = <®_digitizer>; + }; +}; + &sdma { status = "okay"; }; @@ -221,6 +245,16 @@ &wdog1 { }; &iomuxc_lpsr { + pinctrl_wacom: wacomgrp { + fsl,pins = < + /*MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0 0x00000074 /* WACOM RESET */ + MX7D_PAD_LPSR_GPIO1_IO01__GPIO1_IO1 0x00000034 /* WACOM INT */ + MX7D_PAD_LPSR_GPIO1_IO04__GPIO1_IO4 0x00000074 /* PDCTB */ + /*MX7D_PAD_LPSR_GPIO1_IO05__GPIO1_IO5 0x00000014 /* FWE */ + /*MX7D_PAD_LPSR_GPIO1_IO06__GPIO1_IO6 0x00000014 /* WACOM PWR ENABLE */ + >; + }; + pinctrl_digitizer_reg: digitizerreggrp { fsl,pins = < /* DIGITIZER_PWR_EN */ @@ -236,6 +270,13 @@ MX7D_PAD_SAI1_RX_SYNC__GPIO6_IO16 0x59 >; }; + 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 diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig index fa9229616106..2fc8dc6a8b0a 100644 --- a/arch/arm/configs/imx_v6_v7_defconfig +++ b/arch/arm/configs/imx_v6_v7_defconfig @@ -167,6 +167,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