From patchwork Sun Jan 17 04:24:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12025923 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 7D062C433E0 for ; Sun, 17 Jan 2021 23:43:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DCA920674 for ; Sun, 17 Jan 2021 23:43:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730710AbhAQXm6 (ORCPT ); Sun, 17 Jan 2021 18:42:58 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:39179 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729141AbhAQXm5 (ORCPT ); Sun, 17 Jan 2021 18:42:57 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id C41B95C0118; Sun, 17 Jan 2021 18:42:10 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 17 Jan 2021 18:42:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=IHDkxQ/wXzXYg5tlkjGvzwAi4s qGXHDpW2TWqnbUQC8=; b=N/2JKFvwfVrR1+zmOudMx71BteEbJm/f1SRyiV6uH4 159cPhZHitzS5x9/XmeOTOF4lpgxFpQZU89aGGyg5TBU2izEnaixzcqZDAL6Tl7G 6UfH+/f9mfwNP6GCnyO4WXwAVeFEt3GRthPB7DEsMsowKLF0NoKWip8DHiWJ5t4T khET+Iv8g8D0yhD3jLcO4Y8nP2TndNxBKi/Qv9aYDBc2/7ojDxcqrUyfdhYH5nUo cIB6po3qRZ+hjKyerxoXxqIW4EKyQRS3RKwv7Bfg30FvhW/Jm/cBhssYoQqWHatf 33qOFlObmWh2tQuPVNG91pcp5avreRlMGnVZLDz+i84A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=IHDkxQ/wXzXYg5tlk jGvzwAi4sqGXHDpW2TWqnbUQC8=; b=YyRu1U3SvhlX1c5jTC40AGl2zuJjKZYTH YBb6+ZZXLWXC3n33VQOPK1J3UrVPALHOMyDLYU+vPFQrYNZ+ZRXzIw5SSItk7gTY 6hrCz0Vb97QlCpJSlCvewyO0en+h4XPe2IaBV1UqSLlC72jNcue8Ap3nNzh15B4p U5LRvICEjLMu+dqdWU3S7IF1XhRAejzHRNxXBfGxr4+y35hmAUcQ++c6G7KS+psh URfcI7XfdADrZmU7QIs7yAMmvQt5CnDnZulb9iESzw9SXjRrncPQEeBCZguL040U MZs5foTHvryU/+VSS6j5YjlcNu4+ehyWAo76qI8ALyWGt9E+FlPCA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdejgdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertdertd dtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghirhes rghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepveeiueduhfevheetle dvgfeuhfejgfffieejhedttdffudfhheegjeefjeffleehnecuffhomhgrihhnpeguvghv ihgtvghtrhgvvgdrohhrghenucfkphepjeefrdelfedrkeegrddvtdeknecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegr lhhishhtrghirhdvfedrmhgv 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 8A892240057; Sun, 17 Jan 2021 18:42:09 -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 1/3] devicetree/bindings: Initial commit of wacom,wacom-i2c Date: Sat, 16 Jan 2021 20:24:26 -0800 Message-Id: <20210117042428.1497-1-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Signed-off-by: Alistair Francis --- .../input/touchscreen/wacom,wacom-i2c.yaml | 55 +++++++++++++++++++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + 2 files changed, 57 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..6b0e0034f836 --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/wacom,wacom-i2c.yaml @@ -0,0 +1,55 @@ +# 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 + + flip-tilt-x: + flip-tilt-y: + flip-pos-x: + flip-pos-y: + flip-distance: + +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>; + flip-tilt-x; + flip-tilt-y; + flip-pos-x; + flip-pos-y; + flip-distance; + }; + }; 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 Sun Jan 17 04:24:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12025925 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 2D851C433E6 for ; Sun, 17 Jan 2021 23:43:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E415F206ED for ; Sun, 17 Jan 2021 23:43:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730713AbhAQXm7 (ORCPT ); Sun, 17 Jan 2021 18:42:59 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:41975 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729455AbhAQXm5 (ORCPT ); Sun, 17 Jan 2021 18:42:57 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 59A535C011C; Sun, 17 Jan 2021 18:42:11 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 17 Jan 2021 18:42:11 -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=oClwcGbSXTcI3 kvaAdIUVBBqOR56N1zqJP29sSkNGDE=; b=eEZgM6hBkrm7HoX0OCsWqtC493sup XmOlx3249ZSXbayhSc969s/Fqii8LHg9voL/JNeRRNuo6ZlHXgUFR90lDAl+5xpC Ik+PTk79cSWR/ekCh4lQxufedLRUSNaZODvBIKigEydiNVI2qKua+yFR8Ok7JoVn CJxSoKz/bEM9jUiQCAE/3mRN2OyjLnTXmos1gsoS7s/gTMlmLbbQ55ge2UJHk6y7 s7sBvpLu/gR395LuzfAYvMynuipXnjcurvRKD21MTGjsWHkDaGJEtTru5DJXDa/H yHlnDZn4kaXQm+uD4ilRPthlAOhXNX+N6sBZ/oWjHAF9G0hq4xHKRc/pQ== 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=oClwcGbSXTcI3kvaAdIUVBBqOR56N1zqJP29sSkNGDE=; b=EcAeSGdA Z4hY4mTaauvBSe8VuWJaIpasBcv7VxFHRvrH2Ybxy4DGf0DVaDv1quCqlDDvY02Z pu2wein8I91qAGRmnLXYIMQxlXDzOS0jcZ/em3iniDgvjJR89bXD4lXO3Q3Tq5bW mpmtYSXhQvaz4flmu/b1792mQbHGi3JPY0jHsU0WJ6ANCzpe0sggOTpQzDGSjhGf CurMJlorwhVfx+xFmySbKKNFZ2j7JajQxpyHyRJly/cY6Yx59M0Uk9RMMJi/fg8j WJ5sIvhUyt17/BIFJmih6/+ZFP4dmYU/QPPVBmGr3beMfwfGq7/14tHvYAqgoUru U0OqyGtVaJZd5g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdejgdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecukfhppeejfedrleef rdekgedrvddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg 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 76DBE240066; Sun, 17 Jan 2021 18:42:10 -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 2/3] input/touchscreen: Add device tree support to wacom_i2c Date: Sat, 16 Jan 2021 20:24:27 -0800 Message-Id: <20210117042428.1497-2-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210117042428.1497-1-alistair@alistair23.me> References: <20210117042428.1497-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Allow the wacom-i2c device to be exposed via device tree. Signed-off-by: Alistair Francis --- drivers/input/touchscreen/wacom_i2c.c | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index 1afc6bde2891..54af2934ba17 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 @@ -35,6 +36,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, @@ -144,6 +152,20 @@ static void wacom_i2c_close(struct input_dev *dev) disable_irq(client->irq); } +#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 int wacom_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) { @@ -214,6 +236,11 @@ static int wacom_i2c_probe(struct i2c_client *client, } i2c_set_clientdata(client, wac_i2c); + +#ifdef CONFIG_OF + wacom_of_read(wac_i2c); +#endif + return 0; err_free_irq: @@ -262,10 +289,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 Sun Jan 17 04:24:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12025927 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 7DC81C433E6 for ; Sun, 17 Jan 2021 23:43:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D7CE20674 for ; Sun, 17 Jan 2021 23:43:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729455AbhAQXnW (ORCPT ); Sun, 17 Jan 2021 18:43:22 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:48499 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730687AbhAQXm6 (ORCPT ); Sun, 17 Jan 2021 18:42:58 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 45C545C0114; Sun, 17 Jan 2021 18:42:12 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 17 Jan 2021 18:42:12 -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=I+9i7Zg7kl5zs 7aTybIaXEt2e7jVzXYo07W5LPwCSgc=; b=HARRe+SQ9rxwaOlqMMNULU/drSBAB 8xk3oDFQahqA6wqzfMGD9Q1yyfxZ9oNoxQcbwh6zzdm4F0IwYOH2Kjc4s1xEghd7 xjHFxaj61VyoZpbYHOzXQw/xX+l+R5sguZZjkVYVz9zSigKINom8Ll6zqJCEArHx QWQ2ZrnX99H4bKAPjsp9TpM8MGVSOSfH+GnJIfINYNdU9a41h1ZmC7hSzo0FR2S8 f2DMBRLUfSjA1eAuCibu8g9NLX1/SRxjbEABptFBR6Q/Vz5bchavfDGL8l8byBU6 DnIMi3d/tb0129e+v2BHtIb4PlE76UYKNvIUdOJ5Uw54QSUN58dAeBT3g== 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=I+9i7Zg7kl5zs7aTybIaXEt2e7jVzXYo07W5LPwCSgc=; b=g12Umfli J8b17sYmju67qdV5xJklSHdAYv2cBqezsClo+fVTd7wEDneRHy/ZiJMJLbqQT+3s qGf18lHfOLtTbiPi46somi4j/VmKB1IYfV4VZ5Vb5d4BbEVAd5bJ95LapiqaqAML z0WXDbCqYXcwPhmU3uYzDKXPJSgPQ/SEeX4HSQxrGtgf/zE5z6X5NKLuSIlwJt/j dok6YfSZPS862KsyIu1NsUhzDLV4k5V6Byt5iMAbCMoh0PzT/PsW4K8dleBBTH0z 5KkSLcDg4fDWXX32sniRTPdqXcKCFfsFG+mXCwHLv5H/dazISIMj4cYDYiiozjT8 UY+5sr9SW2Boow== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdejgdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecukfhppeejfedrleef rdekgedrvddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg 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 6551E24005E; Sun, 17 Jan 2021 18:42:11 -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 3/3] arch/arm: reMarkable2: Enable wacom_i2c Date: Sat, 16 Jan 2021 20:24:28 -0800 Message-Id: <20210117042428.1497-3-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210117042428.1497-1-alistair@alistair23.me> References: <20210117042428.1497-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 +++++++++++++++++++++++++ 1 file changed, 41 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