linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Raymond Hackley <raymondhackley@protonmail.com>
To: linux-kernel@vger.kernel.org
Cc: Markuss Broks <markuss.broks@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Stephan Gerhold <stephan@gerhold.net>,
	Nikita Travkin <nikita@trvn.ru>,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	~postmarketos/upstreaming@lists.sr.ht
Subject: [PATCH v2 1/3] input/touchscreen: imagis: Clarify the usage of protocol_b
Date: Thu, 13 Jun 2024 02:56:54 +0000	[thread overview]
Message-ID: <20240613025631.5425-2-raymondhackley@protonmail.com> (raw)
In-Reply-To: <20240613025631.5425-1-raymondhackley@protonmail.com>

protocol_b is a property, which tells Imagis panel to use a different
format for coordinates.

IST30XXC series is known for using protocol B, while the other series
aren't. Note this could be confusing, unlike the model name implies.

Adjust the usage of protocol_b to avoid confusion.

Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
---
 drivers/input/touchscreen/imagis.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/imagis.c b/drivers/input/touchscreen/imagis.c
index 074dd6c342ec..886bcfc8497a 100644
--- a/drivers/input/touchscreen/imagis.c
+++ b/drivers/input/touchscreen/imagis.c
@@ -120,12 +120,12 @@ static irqreturn_t imagis_interrupt(int irq, void *dev_id)
 
 	for (i = 0; i < finger_count; i++) {
 		if (ts->tdata->protocol_b)
-			error = imagis_i2c_read_reg(ts,
-						    ts->tdata->touch_coord_cmd, &finger_status);
-		else
 			error = imagis_i2c_read_reg(ts,
 						    ts->tdata->touch_coord_cmd + (i * 4),
 						    &finger_status);
+		else
+			error = imagis_i2c_read_reg(ts,
+						    ts->tdata->touch_coord_cmd, &finger_status);
 		if (error) {
 			dev_err(&ts->client->dev,
 				"failed to read coordinates for finger %d: %d\n",
@@ -394,6 +394,7 @@ static const struct imagis_properties imagis_3032c_data = {
 	.whoami_cmd = IST3038C_REG_CHIPID,
 	.whoami_val = IST3032C_WHOAMI,
 	.touch_keys_supported = true,
+	.protocol_b = true,
 };
 
 static const struct imagis_properties imagis_3038b_data = {
@@ -401,7 +402,6 @@ static const struct imagis_properties imagis_3038b_data = {
 	.touch_coord_cmd = IST3038B_REG_STATUS,
 	.whoami_cmd = IST3038B_REG_CHIPID,
 	.whoami_val = IST3038B_WHOAMI,
-	.protocol_b = true,
 };
 
 static const struct imagis_properties imagis_3038c_data = {
@@ -409,6 +409,7 @@ static const struct imagis_properties imagis_3038c_data = {
 	.touch_coord_cmd = IST3038C_REG_TOUCH_COORD,
 	.whoami_cmd = IST3038C_REG_CHIPID,
 	.whoami_val = IST3038C_WHOAMI,
+	.protocol_b = true,
 };
 
 #ifdef CONFIG_OF
-- 
2.39.2



  reply	other threads:[~2024-06-13  2:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-13  2:56 [PATCH v2 0/3] Add support for Imagis IST3038 and clarify the usage of protocol_b Raymond Hackley
2024-06-13  2:56 ` Raymond Hackley [this message]
2024-06-13  2:57 ` [PATCH v2 2/3] dt-bindings: input/touchscreen: imagis: Document ist3038 Raymond Hackley
2024-06-13  9:13   ` Krzysztof Kozlowski
2024-06-13  2:57 ` [PATCH v2 3/3] input/touchscreen: imagis: Add supports for Imagis IST3038 Raymond Hackley
2024-07-08 17:10 ` [PATCH v2 0/3] Add support for Imagis IST3038 and clarify the usage of protocol_b Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240613025631.5425-2-raymondhackley@protonmail.com \
    --to=raymondhackley@protonmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markuss.broks@gmail.com \
    --cc=nikita@trvn.ru \
    --cc=robh+dt@kernel.org \
    --cc=stephan@gerhold.net \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).