Skip to content

Commit ff2f28c

Browse files
Input: imagis - clarify the usage of protocol_b
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> Link: https://lore.kernel.org/r/20240613025631.5425-2-raymondhackley@protonmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 3b42b9a commit ff2f28c

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/input/touchscreen/imagis.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ static irqreturn_t imagis_interrupt(int irq, void *dev_id)
120120

121121
for (i = 0; i < finger_count; i++) {
122122
if (ts->tdata->protocol_b)
123-
error = imagis_i2c_read_reg(ts,
124-
ts->tdata->touch_coord_cmd, &finger_status);
125-
else
126123
error = imagis_i2c_read_reg(ts,
127124
ts->tdata->touch_coord_cmd + (i * 4),
128125
&finger_status);
126+
else
127+
error = imagis_i2c_read_reg(ts,
128+
ts->tdata->touch_coord_cmd, &finger_status);
129129
if (error) {
130130
dev_err(&ts->client->dev,
131131
"failed to read coordinates for finger %d: %d\n",
@@ -394,21 +394,22 @@ static const struct imagis_properties imagis_3032c_data = {
394394
.whoami_cmd = IST3038C_REG_CHIPID,
395395
.whoami_val = IST3032C_WHOAMI,
396396
.touch_keys_supported = true,
397+
.protocol_b = true,
397398
};
398399

399400
static const struct imagis_properties imagis_3038b_data = {
400401
.interrupt_msg_cmd = IST3038B_REG_STATUS,
401402
.touch_coord_cmd = IST3038B_REG_STATUS,
402403
.whoami_cmd = IST3038B_REG_CHIPID,
403404
.whoami_val = IST3038B_WHOAMI,
404-
.protocol_b = true,
405405
};
406406

407407
static const struct imagis_properties imagis_3038c_data = {
408408
.interrupt_msg_cmd = IST3038C_REG_INTR_MESSAGE,
409409
.touch_coord_cmd = IST3038C_REG_TOUCH_COORD,
410410
.whoami_cmd = IST3038C_REG_CHIPID,
411411
.whoami_val = IST3038C_WHOAMI,
412+
.protocol_b = true,
412413
};
413414

414415
#ifdef CONFIG_OF

0 commit comments

Comments
 (0)