From patchwork Fri Mar 26 01:52:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 409801 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 ED11EC433DB for ; Fri, 26 Mar 2021 01:53:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB42C619B3 for ; Fri, 26 Mar 2021 01:53:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230338AbhCZBxM (ORCPT ); Thu, 25 Mar 2021 21:53:12 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:42189 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230289AbhCZBwn (ORCPT ); Thu, 25 Mar 2021 21:52:43 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 292FE5C007B; Thu, 25 Mar 2021 21:52:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 25 Mar 2021 21:52:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=Fi4qfAKGJys5lTo7IxdIoYS++m MALYmFVb1DZrJgwWA=; b=XyKATd5hEKnCMZzI/SPB29Yzb733DLTJoLXCOPYAS9 jzXGICK4Sbj28eGto73tMvNh8LIHva9AR8dfjvOQoZLAa9wbYCUrdasPlsj3waiD 5y9eNx/PArlmhWW4w8NswKCiNSAuyFYpbukqgI2vfJrPxqJBiSh1iKZndIa23dV3 /CKEpx74s5Mxm0o5hIg40riYUY0HQv8HN5Y02t89jbjRieXjwwTlPa/CYk5h5cI1 cA4E8lFwlINhQi2Ygh7dbJrsEvhc79MVxpKV2PjMDoRxWGIyXN1PiQhIoRz3pYyk kSpje6SkJ1E7yXwsTXuKAWPahLfljga7W3Q9rRYiJcoA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=Fi4qfAKGJys5lTo7I xdIoYS++mMALYmFVb1DZrJgwWA=; b=KIS0cCbJW3d8DXGummY4sXhJ8klpLNJCh gB0LgJH394dhCOv5gknsj9SIwLMV9fSIIz1gfQ6pixft1n0fn2KYR8dtkhFuHWbX qdDP5SffbFnFjVOCFl2Y6/7n57cKSgU68dCy7T3xsICKpJUH+NvHE3XiJ/4YJ/Hc UA4oelEbV2t66CIrK44qskyUy/sp8iyqTfQ19XXqP0EiTGdVMYwwJ4IFfyoDfPBJ RoEOJvs+CkAJKPsVJv81XExoMco+zl7GMNRF4RUpDxShyXM7F5nsoABW2Vk5Ocnc yoZhI7LXMyYI9056lnlcOD8aYfAlI4vfQ1118ymd2E99KHgwCDBJA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudehuddgfeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgrihhr segrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeejleeihfdvtefgtd ethfdtgefftdeiffefjeeiffefveeuleejheejvefhffeukeenucfkphepudelfedrvdej rddufedrvdefheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [193.27.13.235]) by mail.messagingengine.com (Postfix) with ESMTPA id DD8C21080063; Thu, 25 Mar 2021 21:52:40 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v4 01/10] dt-bindings: Add Wacom to vendor bindings Date: Thu, 25 Mar 2021 21:52:21 -0400 Message-Id: <20210326015229.141-1-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Signed-off-by: Alistair Francis --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index a8e1e8d2ef20..996f4de2fff5 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1216,6 +1216,8 @@ patternProperties: description: Vision Optical Technology Co., Ltd. "^vxt,.*": description: VXT Ltd + "^wacom,.*": + description: Wacom Co., Ltd "^wand,.*": description: Wandbord (Technexion) "^waveshare,.*": From patchwork Fri Mar 26 01:52:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 409800 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 8D065C433E2 for ; Fri, 26 Mar 2021 01:53:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 65AAE61A4F for ; Fri, 26 Mar 2021 01:53:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230045AbhCZBxN (ORCPT ); Thu, 25 Mar 2021 21:53:13 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:34971 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229893AbhCZBwp (ORCPT ); Thu, 25 Mar 2021 21:52:45 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id BF1915C00C3; Thu, 25 Mar 2021 21:52:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 25 Mar 2021 21:52:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=zRycIHAo8ReW9 IJaApWlLXkdnyCmXW/us1FFMU8uDn8=; b=Fqc9Sk82yzbHF+Ny5wUJVPXvC/2xL 1s+wSWAoa8JQcZj2GeRMrueQcVfDJAgkhFwcBzJFztbqmamd9LL4tkUxVE19NU2n X1nCTAGPfqbw+B5MccgMBzmsiNt5yFlPdXQnPVw8J2ei3LRvncbO6xmFCts7lCo0 1jQjW18FhV6BOM72NvlfEfN2jXHHcB6FiAY7Et1pTvbK4ywhr6zeHpWczPNnr9/e n5vyInVQQFyVwZs61enuJywSa9uD7JsFJBBybc+59yZ0uosq5Cr+3cRbjp05ZyVo MaQrVwqRNhMDcA+0safVcfJ8Ea6+XLkqtCiAOt7XbuD9AiJKhTnXbg+ig== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=zRycIHAo8ReW9IJaApWlLXkdnyCmXW/us1FFMU8uDn8=; b=UzfKeDIP 0sV5wiBET9FQr8la43FFTH4nSxCnKl6a/qRhWsCx/eNTJy4OCWCBxXhOOe3dK48E 903iNiL2S4MRWoVT+N4Gf0nMBLYmGcO+fKtiWFRWYAb4IFhsEsHBOwVKSFBbpe9E XpMP12GCLs7wN+WueaAiUxPG7/pTMpYkoUfeY1wKNEgJ7Aelp94z1ynyubcIgWDQ EzCKw7X3sEwQP5sHxaTntDe1P6AZ+RwiXf2xgp5nhXyv9Q/7TZ/7Kvkzji+SdCqW vovv2fjV1dGsjQvCX1QuzcSqQ//UYInghJm+f0onT2rFPlK9fzRtSJiEaFr/PViu nReWkTV6TVGhjw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudehuddgfeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepudelfedr vdejrddufedrvdefheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [193.27.13.235]) by mail.messagingengine.com (Postfix) with ESMTPA id D458B108005C; Thu, 25 Mar 2021 21:52:43 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v4 04/10] Input: wacom_i2c - Add touchscren properties Date: Thu, 25 Mar 2021 21:52:24 -0400 Message-Id: <20210326015229.141-4-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210326015229.141-1-alistair@alistair23.me> References: <20210326015229.141-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Connect touchscreen properties to the wacom_i2c. Signed-off-by: Alistair Francis --- v4: - Add touchscreen_report_pos() as well drivers/input/touchscreen/wacom_i2c.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index eada68770671..ee1829dd35f4 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -33,6 +34,7 @@ struct wacom_features { struct wacom_i2c { struct i2c_client *client; struct input_dev *input; + struct touchscreen_properties props; u8 data[WACOM_QUERY_SIZE]; bool prox; int tool; @@ -188,6 +190,9 @@ 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); + touchscreen_report_pos(input, &wac_i2c->props, features.x_max, + features.y_max, true); input_set_abs_params(input, ABS_X, 0, features.x_max, 0, 0); input_set_abs_params(input, ABS_Y, 0, features.y_max, 0, 0); input_set_abs_params(input, ABS_PRESSURE, From patchwork Fri Mar 26 01:52:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 409798 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 DAAC2C433E8 for ; Fri, 26 Mar 2021 01:53:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A16D2619A0 for ; Fri, 26 Mar 2021 01:53:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230394AbhCZBxO (ORCPT ); Thu, 25 Mar 2021 21:53:14 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:56307 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230331AbhCZBwr (ORCPT ); Thu, 25 Mar 2021 21:52:47 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id DA6675C0164; Thu, 25 Mar 2021 21:52:46 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 25 Mar 2021 21:52:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=Mr3SVxqvYtIDd YbZ+RVwG8ZSS/FVFdLi7hAy5Rzig2E=; b=G2wSsXraOQqLSMaTaMO22gcTlliR+ xdsg1c6dRAtmCASGeJw2RtIA6UkZg8SQCQa4q6Nu3G5KRrhEchq1mwaC91CZA/Pr vJlpNNvS7UaA1G/4T1xbB7jzCA0ofF/4XE/krGBzdHGLhasDj+S2ou0YuzwoDryp 5kD+Zbl3OqV7/MBVtXY2CxSrr/8NFMxf1rmNrFh04Db2axnB9muFsVDs4fjaZRl+ uO6BAyMGgdo2hztEzQfTClnoS86t/EPF+axydn/CIBg/Au+9VJ2460EyflgOxm3r XrCJvhvV+yAx7rZeyspTART/Jmc32oBr22Z3eTMMDkWj9KTGB5AY5tMHQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=Mr3SVxqvYtIDdYbZ+RVwG8ZSS/FVFdLi7hAy5Rzig2E=; b=HABi8Atz ZHmwyJX8hWJX63rsZOeCARIQcrHWS7USMZL09GhVjXUuIIHwjP/n8eqd/cEv7+Uu AarMwvhTHVwzfblEX291bZvsCYnhR2CH1hANBzT6n4HRdtBGPZSPdqmmzi632Ug4 utczVMjKKO+p4iOkPZqD8sNNuEOe+qcMzQfo0XltCMEDv4F/wtjD0wSK+a5D9OyZ MPsBqu8BYPNDlcl1ZXMkfWY30Jfw2LRoral8qr6YgTI2dYu11pI7lvMRbzeOLsuR LOT4X6sqfeNp7LfSTH+pQUleOVwE6DHag7rEGK2AW3Up7qFyRzNkIxSTsSNoWTVQ Ite5/MPjH0QixQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudehuddgfeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepudelfedr vdejrddufedrvdefheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [193.27.13.235]) by mail.messagingengine.com (Postfix) with ESMTPA id CCC9C108005C; Thu, 25 Mar 2021 21:52:45 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v4 06/10] Input: wacom_i2c - Clean up the query device fields Date: Thu, 25 Mar 2021 21:52:26 -0400 Message-Id: <20210326015229.141-6-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210326015229.141-1-alistair@alistair23.me> References: <20210326015229.141-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 --- v4: - Remove the reset_control_reset() logic 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 3b4bc514dc3f..84c7ccb737bd 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 { @@ -48,27 +65,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, }, }; @@ -89,9 +109,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 Fri Mar 26 01:52:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 409799 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 B84BEC433E3 for ; Fri, 26 Mar 2021 01:53:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C09C61A5E for ; Fri, 26 Mar 2021 01:53:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230409AbhCZBxO (ORCPT ); Thu, 25 Mar 2021 21:53:14 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:50821 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230248AbhCZBws (ORCPT ); Thu, 25 Mar 2021 21:52:48 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id DF2255C007B; Thu, 25 Mar 2021 21:52:47 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 25 Mar 2021 21:52:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=2qzggsfYr3Vfv yJSn0Ype9JxXkJamGloy+yUfPWg5tw=; b=BkcOFCDATxd+Hvjp8Dsl8So6DDoP4 gL/hfkelE/TXxOr06Ae9HPiNXVo9VR1oWG3Lrrk+0yKcJ3rXnyhyQA6d2pI+Ob3n sf4q5pQbofq2asPdRE1Yaot7zYda27XhaczmuOZPsmzZ8y9dKCICeaOu5jSqiFn3 2QS92bBC2S1dkcjdvNQDQEV/D4+KIihxkhDdEdgCqwKYAIpARzwZQPF6CtugiLGs pvULDAbBuh8cpBLx4aUP1XPdtfWdB1bPh8DunbOvUg9Vq25fMWHWEwxI2fwTZt3e Mzg1E71OjcPhUXUY4QmGH9mQ/w+/8CtxITt8bm2JQvpf7QuXXiZkbkNpA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=2qzggsfYr3VfvyJSn0Ype9JxXkJamGloy+yUfPWg5tw=; b=JIBfih4B 4JXx+gwg3vxKQ/pz35hybQxtg0FlifXTN3GJ9ehzkxjeNzGU5+P9ighpLbcWDFsF Wu9NtB04K82byd4iV4hIOMFWj3dvAq6qZXl5QGVdSKhCN3EfXLcq4TZabWqbUtd4 TWMGxUTyCq8MB8I3K2whaLlV5vgJsZD9aMY7RDiIGH//56cAt+rT35WLHGRV+jzo xGm/HIhz+mqjOunsvX7JRRyPnMY0s/M9stdpFbpsuSnKNTaVG02U7CE5kE8FFAhf 1053VHi5e+qcnoUQTg4lmfB8baDECP/Iht9kwur6lpyRATMxQezTFFu8PhR1QaHd eeFNLQSopBLazw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudehuddgfeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepudelfedr vdejrddufedrvdefheenucevlhhushhtvghrufhiiigvpeegnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [193.27.13.235]) by mail.messagingengine.com (Postfix) with ESMTPA id E7705108005C; Thu, 25 Mar 2021 21:52:46 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v4 07/10] Input: wacom_i2c - Add support for reset control Date: Thu, 25 Mar 2021 21:52:27 -0400 Message-Id: <20210326015229.141-7-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210326015229.141-1-alistair@alistair23.me> References: <20210326015229.141-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Alistair Francis Signed-off-by: Alistair Francis --- v4: - Initial commit drivers/input/touchscreen/wacom_i2c.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index 84c7ccb737bd..28004b1180c9 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -55,6 +55,7 @@ struct wacom_features { struct wacom_i2c { struct i2c_client *client; struct input_dev *input; + struct reset_control *rstc; struct touchscreen_properties props; u8 data[WACOM_QUERY_SIZE]; bool prox; @@ -175,6 +176,8 @@ static int wacom_i2c_open(struct input_dev *dev) struct wacom_i2c *wac_i2c = input_get_drvdata(dev); struct i2c_client *client = wac_i2c->client; + reset_control_reset(wac_i2c->rstc); + enable_irq(client->irq); return 0; @@ -193,6 +196,7 @@ static int wacom_i2c_probe(struct i2c_client *client, { struct wacom_i2c *wac_i2c; struct input_dev *input; + struct reset_control *rstc; struct wacom_features features = { 0 }; int error; @@ -201,6 +205,12 @@ static int wacom_i2c_probe(struct i2c_client *client, return -EIO; } + 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"); + return PTR_ERR(rstc); + } + error = wacom_query_device(client, &features); if (error) return error; @@ -214,6 +224,7 @@ static int wacom_i2c_probe(struct i2c_client *client, wac_i2c->client = client; wac_i2c->input = input; + wac_i2c->rstc = rstc; input->name = "Wacom I2C Digitizer"; input->id.bustype = BUS_I2C; From patchwork Fri Mar 26 01:52:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair X-Patchwork-Id: 409797 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 019B4C433E6 for ; Fri, 26 Mar 2021 01:53:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C7A1161A5E for ; Fri, 26 Mar 2021 01:53:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230327AbhCZBxP (ORCPT ); Thu, 25 Mar 2021 21:53:15 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:54621 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229919AbhCZBwu (ORCPT ); Thu, 25 Mar 2021 21:52:50 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 04E5F5C0161; Thu, 25 Mar 2021 21:52:50 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 25 Mar 2021 21:52:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=kvtLRzFj0nTx0 VbY6ToA4jpOg4Y0/rSNr9AP04Ed8oM=; b=d/6ED73yUeKwIFceRFEli53FWWpnd cRtISJwMRO+L81l7aTIu/m/h0v30GLCg7PMCW9BCb7Q960oFhneeyR5KAnVbL64U jN+7r1hBhsVuYz6OjERCmhB3QVYtf0eHOO4gFd3EqMS8N1DAKH4AMa9zbjaarkxJ 4bsxdwHcL9poKzYJ5/fs3Lww8cbbeWIJknfNhHQd9Uhz8h0pserRKz5+FvXVPfEV UNPRzsAKjPK2H6AMjdrBjrR5wzNY64kP8KaAqmacw1xfVDz2LOmG+bTIJI7sI1sL zWtTKNcj53MjmUw8P4Fl5c16Cy7oJJ3WzkVGsG6f/wzYw1shUdXXQXAZg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=kvtLRzFj0nTx0VbY6ToA4jpOg4Y0/rSNr9AP04Ed8oM=; b=K5QAbN86 us5ldNSV81ZwWlT9CoAzhnPWSxPBPDvQwQli6AFMjRlDa0Q/0H0haGpOZWLqTihV vtOArXOsjV6hncZAvtPN5n7IF1ggrarGeB/CuzrGzifuAd30GI3LL4jELMSnyhlA JjTfGUbXv9MlparsW9Y9MtmwgkmntJfcsDnylRo1UZ+mL2CPsmqY8imD2xkFeueW /HpRZv37fKT33211dV5FGLxl2jnF4KJaHClocaLYtn4cK0QmJfDIEixMUCnIgoc9 l3IR8RhPJmZPfTKaQmAv3ZrpZ/bSqfRu68PhVuVPXTpT0lrHToD3bPmTy7refuTS qRn0wrggitRhpQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudehuddgfeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepudelfedr vdejrddufedrvdefheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [193.27.13.235]) by mail.messagingengine.com (Postfix) with ESMTPA id DA79D108005C; Thu, 25 Mar 2021 21:52:48 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v4 09/10] ARM: imx_v6_v7_defconfig: Enable Wacom I2C Date: Thu, 25 Mar 2021 21:52:29 -0400 Message-Id: <20210326015229.141-9-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210326015229.141-1-alistair@alistair23.me> References: <20210326015229.141-1-alistair@alistair23.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Enable the Wacom I2C in the imx defconfig as it is used by the reMarkable2 tablet. Signed-off-by: Alistair Francis --- arch/arm/configs/imx_v6_v7_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig index 70928cc48939..cd80e85d37cf 100644 --- a/arch/arm/configs/imx_v6_v7_defconfig +++ b/arch/arm/configs/imx_v6_v7_defconfig @@ -174,6 +174,7 @@ CONFIG_TOUCHSCREEN_DA9052=y CONFIG_TOUCHSCREEN_EGALAX=y CONFIG_TOUCHSCREEN_GOODIX=y CONFIG_TOUCHSCREEN_ILI210X=y +CONFIG_TOUCHSCREEN_WACOM_I2C=y CONFIG_TOUCHSCREEN_MAX11801=y CONFIG_TOUCHSCREEN_IMX6UL_TSC=y CONFIG_TOUCHSCREEN_EDT_FT5X06=y