From patchwork Fri Jun 21 22:40:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Kemnade X-Patchwork-Id: 806433 Received: from mail2.andi.de1.cc (vmd64148.contaboserver.net [161.97.139.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CB0316F283; Fri, 21 Jun 2024 22:40:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=161.97.139.27 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719009643; cv=none; b=HdmokZr60diRriYffe5hAiZe3BPT+wrNVFwwCghLv/7qyrJwE0prIdW7OnOCDJYa6DmGm3jwFFM+Za7ufE89ii30RacZxesab0QotYVytwzBK557A09EjCt/E1eJA9bw5Y3NSsi7DeUp6bdcs1uKHkbawQ6k2r78/03NbP2/VA4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719009643; c=relaxed/simple; bh=iw38Cb900grqd7jDffEvI+TnYxm9SZQxb+r7nkvrhv4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GSmcAntCvb7W9CVGwvgI32Bp7d9xYE9xBXfGx2X3Z/55y0DHglSoknrtgoIevNIPJ9thjlmSbF/YB/FipcYWJnj1xOxKFS9iaMLEn4jL0wLlB/WoDAnwfOJ7x1W69pLz7KJv/tNLILmvH8rQMnk/TFjIhEF0cgG20RQg3WYoTaw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kemnade.info; spf=pass smtp.mailfrom=kemnade.info; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b=c+4Ap9eC; arc=none smtp.client-ip=161.97.139.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kemnade.info Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kemnade.info Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b="c+4Ap9eC" Received: from mail.andi.de1.cc ([2a02:c205:3004:2154::1]) by mail2.andi.de1.cc with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sKmvj-000Utv-1o; Sat, 22 Jun 2024 00:40:28 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20220719; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yWwlkRcSo+6kETf3mZVatASIaqAtWv3jvH9G8RGngdQ=; b=c+4Ap9eCKZKxBqFsljvDGbF949 fAenKL7is4bS1Y9tk70z2mn7sXFc0+bJOAQZFtGPcBj+itA2GPXnNvv0tjwUmyuzamaeu9QD8nu0X bVZm9odoA7C6KkDDVq0nX+vkSE0zn+J7K2xit0KEBTFeyVBHN9nRvCbk9v5N9BmHUCGg6KtIp/O/X mGP1ik3hbgOO4N3e2CykLew4+nl3XRg5eAugHu1eHreIDM2kB8Mkr2CY4TQOVd3BP2Fgjk1+2+9s9 iceNWQTmPzmZM/kN54wkmfi8RKcbsbpF3wplWaqGfe8Jrr/Uox0wkdxsRqPez5g2HShAMO6x+A6Ur C3IWdKAQ==; Received: from p200300c20737c2001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:c2:737:c200:1a3d:a2ff:febf:d33a] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sKmvi-003PlF-0a; Sat, 22 Jun 2024 00:40:27 +0200 Received: from andi by aktux with local (Exim 4.96) (envelope-from ) id 1sKmvj-006nfk-0f; Sat, 22 Jun 2024 00:40:27 +0200 From: Andreas Kemnade To: dmitry.torokhov@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, andreas@kemnade.info, hdegoede@redhat.com, andy.shevchenko@gmail.com, u.kleine-koenig@pengutronix.de, siebren.vroegindeweij@hotmail.com, linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH RESEND v3 1/3] dt-bindings: touchscreen: convert elan, ektf2127 to json-schema Date: Sat, 22 Jun 2024 00:40:20 +0200 Message-Id: <20240621224022.1620897-2-andreas@kemnade.info> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240621224022.1620897-1-andreas@kemnade.info> References: <20240621224022.1620897-1-andreas@kemnade.info> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Convert EKTF2127 infrared touchscreen controller binding to DT schema and add ektf2232 compatible. Signed-off-by: Andreas Kemnade Reviewed-by: Krzysztof Kozlowski --- .../bindings/input/touchscreen/ektf2127.txt | 25 -------- .../input/touchscreen/elan,ektf2127.yaml | 57 +++++++++++++++++++ 2 files changed, 57 insertions(+), 25 deletions(-) delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/ektf2127.txt create mode 100644 Documentation/devicetree/bindings/input/touchscreen/elan,ektf2127.yaml diff --git a/Documentation/devicetree/bindings/input/touchscreen/ektf2127.txt b/Documentation/devicetree/bindings/input/touchscreen/ektf2127.txt deleted file mode 100644 index c9f2c9f578e34..0000000000000 --- a/Documentation/devicetree/bindings/input/touchscreen/ektf2127.txt +++ /dev/null @@ -1,25 +0,0 @@ -* Elan eKTF2127 I2C touchscreen controller - -Required properties: - - compatible : "elan,ektf2127" or "elan,ektf2132" - - reg : I2C slave address of the chip (0x40) - - interrupts : interrupt specification for the ektf2127 interrupt - - power-gpios : GPIO specification for the pin connected to the - ektf2127's wake input. This needs to be driven high - to take ektf2127 out of its low power state - -For additional optional properties see: touchscreen.txt - -Example: - -i2c@00000000 { - ektf2127: touchscreen@15 { - compatible = "elan,ektf2127"; - reg = <0x15>; - interrupt-parent = <&pio>; - interrupts = <6 11 IRQ_TYPE_EDGE_FALLING> - power-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; - touchscreen-inverted-x; - touchscreen-swapped-x-y; - }; -}; diff --git a/Documentation/devicetree/bindings/input/touchscreen/elan,ektf2127.yaml b/Documentation/devicetree/bindings/input/touchscreen/elan,ektf2127.yaml new file mode 100644 index 0000000000000..5c4c29da0b11d --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/elan,ektf2127.yaml @@ -0,0 +1,57 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/elan,ektf2127.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Elan eKTF2127 I2C touchscreen controller + +maintainers: + - Siebren Vroegindeweij + +allOf: + - $ref: touchscreen.yaml# + +properties: + compatible: + enum: + - elan,ektf2127 + - elan,ektf2132 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + power-gpios: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - power-gpios + +unevaluatedProperties: false + +examples: + - | + #include + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + touchscreen@15 { + compatible = "elan,ektf2127"; + reg = <0x15>; + interrupt-parent = <&pio>; + interrupts = <6 11 IRQ_TYPE_EDGE_FALLING>; + power-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; + touchscreen-inverted-x; + touchscreen-swapped-x-y; + }; + }; +... From patchwork Fri Jun 21 22:40:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Kemnade X-Patchwork-Id: 807628 Received: from mail2.andi.de1.cc (vmd64148.contaboserver.net [161.97.139.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF16016F0F4; Fri, 21 Jun 2024 22:40:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=161.97.139.27 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719009644; cv=none; b=INVfkUTbr+SJxV2n/XBK6MqUq7cZbYVhzryD2YaobBfKLK67lrvAH7buetvEXmRm9qalLJtBdVZZabICFZX37PAW50RFUPQ4sTsfi8u+UTVkwaoDBBI4qF5n85FMlxYvHMu2UqwFHx3nkR1KT2wPSgXhb8ES3h1cPsTOOKLQRb0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719009644; c=relaxed/simple; bh=JmY/x2z6q1Q4af+tn6wc8WVCFrk0TIFyxVDD8495agM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dLHHWTJ/hhv4rGTW03vJqCpF+b/NVorJynVySA475NF2dqDzu57MMFL3FWKjM/G0V/VxmO3fj5MwI2QS25/B0aJLPLiXLM/A/BOjjquMjrIl1Nru0ETDlcGAFgzKY6+09WvJM9jpd5JefaSge3YOg2p8OsEbIOfSzWzK7aYPkTM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kemnade.info; spf=pass smtp.mailfrom=kemnade.info; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b=DB09cX5Z; arc=none smtp.client-ip=161.97.139.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kemnade.info Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kemnade.info Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b="DB09cX5Z" Received: from mail.andi.de1.cc ([2a02:c205:3004:2154::1]) by mail2.andi.de1.cc with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sKmvk-000Utz-0X; Sat, 22 Jun 2024 00:40:28 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20220719; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PGYb7xrswlXlviOfBdG+br1HD4qryj9qiptkmvxI+94=; b=DB09cX5ZTGZwtx10ft7gqZU6Kk UjDDzc1zO5WHV6+Msp+8acHJj7TzGMqmTwReEKx4Lid4Pgl03y2RwRTvTgiZJAnP+Pr8zCtsY1Jml FK2ulSSoXbppzXEd31tIeV1XtuNpEwukNtp+QoKS7MDR61Fmx+ijmmXW9goNUNA6TpRQu+Tnlnp8V 9YVGy/EFCYKLiVos7fShWhfVCWSjcpAfw5j+I5or3sSQWN34m7b/dvborDTAFM3QVAs+cW3jmihHv qk42rmA+FN87DsfywZ6AwY0jtKxhMzBNRvLHjIyQPWbHDonlf6gn4rwKLJv0mtWEjNHz5NkO3JZ+c v0CaTgMA==; Received: from p200300c20737c2001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:c2:737:c200:1a3d:a2ff:febf:d33a] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sKmvi-003PlR-37; Sat, 22 Jun 2024 00:40:28 +0200 Received: from andi by aktux with local (Exim 4.96) (envelope-from ) id 1sKmvj-006nfp-3D; Sat, 22 Jun 2024 00:40:28 +0200 From: Andreas Kemnade To: dmitry.torokhov@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, andreas@kemnade.info, hdegoede@redhat.com, andy.shevchenko@gmail.com, u.kleine-koenig@pengutronix.de, siebren.vroegindeweij@hotmail.com, linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH RESEND v3 2/3] dt-bindings: touchscreen: elan,ektf2127: Add EKTF2232 Date: Sat, 22 Jun 2024 00:40:21 +0200 Message-Id: <20240621224022.1620897-3-andreas@kemnade.info> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240621224022.1620897-1-andreas@kemnade.info> References: <20240621224022.1620897-1-andreas@kemnade.info> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add a compatible for the EKTF2232, which is similar to other chips in this document. Signed-off-by: Andreas Kemnade Reviewed-by: Krzysztof Kozlowski --- .../devicetree/bindings/input/touchscreen/elan,ektf2127.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/elan,ektf2127.yaml b/Documentation/devicetree/bindings/input/touchscreen/elan,ektf2127.yaml index 5c4c29da0b11d..ff0ec3fd24c5d 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/elan,ektf2127.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/elan,ektf2127.yaml @@ -17,6 +17,7 @@ properties: enum: - elan,ektf2127 - elan,ektf2132 + - elan,ektf2232 reg: maxItems: 1 From patchwork Fri Jun 21 22:40:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Kemnade X-Patchwork-Id: 806432 Received: from mail2.andi.de1.cc (vmd64148.contaboserver.net [161.97.139.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA79616F8FC; Fri, 21 Jun 2024 22:40:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=161.97.139.27 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719009645; cv=none; b=ctROaBoccFlRho6UV6KFmpxzr/e63q3Zqk/AiK5jmQVJbk+g2fZLKhdj6I8foqd8+M4EQWDLYcHEh1jGbbUeUijYpceD9NnD9b/MhvwxO880BESwnF/gmqn1ElLVAY0qeE5nYuNaPtTADFxNE49uyDqSdzP1JKaDxB3YrSFzAoM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719009645; c=relaxed/simple; bh=Uybd/th4afdJYueMsyszSrqC9bf6dhBOk6xYGLfGkrc=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pxJasbUeJUrL6adjYZ0WJTwmV0dT/jW29W3uw2+zo4eZGQBNr+BceXXo1HhRDIwsX6b6eDDulDixNvYoS0aLRCXmubefzsJRWwBWhOduPm564v8Y1v9qKpzrZ7+Wx6E82GxNp/BBLfhQAvhJVnzXdVxnBJI5S7pWgsgKwSyi8Ok= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kemnade.info; spf=pass smtp.mailfrom=kemnade.info; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b=U7fmM4bS; arc=none smtp.client-ip=161.97.139.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kemnade.info Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kemnade.info Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b="U7fmM4bS" Received: from mail.andi.de1.cc ([2a02:c205:3004:2154::1]) by mail2.andi.de1.cc with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sKmvl-000Uu3-07; Sat, 22 Jun 2024 00:40:29 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20220719; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VMoQa2KSRqpNbUkmMpoILf1hc3Bv7ijAt3K+kr38SlY=; b=U7fmM4bSU/lt4+VfW9C/8pSJCK g2Go5DAUQcStoQGJHtesb5k9wHSjoZo/QE/mxV/25jjXjWmzpWclOXczwjaIOPD0xMFPflHpzEhyT f4oYvzsLC6zDUPRNuPiot6FK5VVLHVJSoJDnweAuw8YdPuR83s2O9Wpm1DqXoMLziM0qSE7CYvX94 aYuOP+PdnPf4oKdSK0yw4nAh5JFUVfKAsL10bFIZnqfTsRuDMBr3+kWo6KGKI3j6hiWPPSTupomXK Fak3VO5HMz9tkMPzsGjwpJekaHm9yRUhJLSfMrkTdchf7wpU9/2pOSwdFvelSGmUsKNuh8tS4Rsb8 8jMdvuxg==; Received: from p200300c20737c2001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:c2:737:c200:1a3d:a2ff:febf:d33a] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sKmvj-003Plh-2U; Sat, 22 Jun 2024 00:40:29 +0200 Received: from andi by aktux with local (Exim 4.96) (envelope-from ) id 1sKmvk-006nfu-2T; Sat, 22 Jun 2024 00:40:28 +0200 From: Andreas Kemnade To: dmitry.torokhov@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, andreas@kemnade.info, hdegoede@redhat.com, andy.shevchenko@gmail.com, u.kleine-koenig@pengutronix.de, siebren.vroegindeweij@hotmail.com, linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND v3 3/3] Input: ektf2127 - add ektf2232 support Date: Sat, 22 Jun 2024 00:40:22 +0200 Message-Id: <20240621224022.1620897-4-andreas@kemnade.info> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240621224022.1620897-1-andreas@kemnade.info> References: <20240621224022.1620897-1-andreas@kemnade.info> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The chip is similar, but has status bits at different positions, so use the correct bits. Signed-off-by: Andreas Kemnade --- drivers/input/touchscreen/ektf2127.c | 36 +++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/ektf2127.c b/drivers/input/touchscreen/ektf2127.c index cc3103b9cbfba..b6f5046f4b917 100644 --- a/drivers/input/touchscreen/ektf2127.c +++ b/drivers/input/touchscreen/ektf2127.c @@ -13,6 +13,7 @@ * Hans de Goede */ +#include #include #include #include @@ -46,6 +47,11 @@ struct ektf2127_ts { struct input_dev *input; struct gpio_desc *power_gpios; struct touchscreen_properties prop; + int status_shift; +}; + +struct ektf2127_i2c_chip_data { + int status_shift; }; static void ektf2127_parse_coordinates(const u8 *buf, unsigned int touch_count, @@ -112,8 +118,8 @@ static void ektf2127_report2_contact(struct ektf2127_ts *ts, int slot, static void ektf2127_report2_event(struct ektf2127_ts *ts, const u8 *buf) { - ektf2127_report2_contact(ts, 0, &buf[1], !!(buf[7] & 2)); - ektf2127_report2_contact(ts, 1, &buf[4], !!(buf[7] & 4)); + ektf2127_report2_contact(ts, 0, &buf[1], !!(buf[7] & BIT(ts->status_shift))); + ektf2127_report2_contact(ts, 1, &buf[4], !!(buf[7] & BIT(ts->status_shift + 1))); input_mt_sync_frame(ts->input); input_sync(ts->input); @@ -247,6 +253,7 @@ static int ektf2127_query_dimension(struct i2c_client *client, bool width) static int ektf2127_probe(struct i2c_client *client) { struct device *dev = &client->dev; + const struct ektf2127_i2c_chip_data *chip_data; struct ektf2127_ts *ts; struct input_dev *input; u8 buf[4]; @@ -303,6 +310,13 @@ static int ektf2127_probe(struct i2c_client *client) return error; ts->input = input; + + chip_data = i2c_get_match_data(client); + if (!chip_data) + return dev_err_probe(&client->dev, -EINVAL, "missing chip data\n"); + + ts->status_shift = chip_data->status_shift; + input_set_drvdata(input, ts); error = devm_request_threaded_irq(dev, client->irq, @@ -325,18 +339,28 @@ static int ektf2127_probe(struct i2c_client *client) return 0; } +static const struct ektf2127_i2c_chip_data ektf2127_data = { + .status_shift = 1, +}; + +static const struct ektf2127_i2c_chip_data ektf2232_data = { + .status_shift = 0, +}; + #ifdef CONFIG_OF static const struct of_device_id ektf2127_of_match[] = { - { .compatible = "elan,ektf2127" }, - { .compatible = "elan,ektf2132" }, + { .compatible = "elan,ektf2127", .data = &ektf2127_data}, + { .compatible = "elan,ektf2132", .data = &ektf2127_data}, + { .compatible = "elan,ektf2232", .data = &ektf2232_data}, {} }; MODULE_DEVICE_TABLE(of, ektf2127_of_match); #endif static const struct i2c_device_id ektf2127_i2c_id[] = { - { "ektf2127", 0 }, - { "ektf2132", 0 }, + { .name = "ektf2127", .driver_data = (long)&ektf2127_data }, + { .name = "ektf2132", .driver_data = (long)&ektf2127_data }, + { .name = "ektf2232", .driver_data = (long)&ektf2232_data }, {} }; MODULE_DEVICE_TABLE(i2c, ektf2127_i2c_id);