Skip to content

Commit ab10867

Browse files
linuswdtor
authored andcommitted
Input: mms114 - support MMS134S
The MMS134S like the MMS136 has an event size of 6 bytes. After this patch, the touchscreen on the Samsung SGH-I407 works fine with PostmarketOS. Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent d198b82 commit ab10867

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

drivers/input/touchscreen/mms114.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454

5555
enum mms_type {
5656
TYPE_MMS114 = 114,
57+
TYPE_MMS134S = 134,
5758
TYPE_MMS136 = 136,
5859
TYPE_MMS152 = 152,
5960
TYPE_MMS345L = 345,
@@ -212,7 +213,7 @@ static irqreturn_t mms114_interrupt(int irq, void *dev_id)
212213
goto out;
213214

214215
/* MMS136 has slightly different event size */
215-
if (data->type == TYPE_MMS136)
216+
if (data->type == TYPE_MMS134S || data->type == TYPE_MMS136)
216217
touch_size = packet_size / MMS136_EVENT_SIZE;
217218
else
218219
touch_size = packet_size / MMS114_EVENT_SIZE;
@@ -281,6 +282,7 @@ static int mms114_get_version(struct mms114_data *data)
281282
break;
282283

283284
case TYPE_MMS114:
285+
case TYPE_MMS134S:
284286
case TYPE_MMS136:
285287
error = __mms114_read_reg(data, MMS114_TSP_REV, 6, buf);
286288
if (error)
@@ -304,8 +306,9 @@ static int mms114_setup_regs(struct mms114_data *data)
304306
if (error < 0)
305307
return error;
306308

307-
/* Only MMS114 and MMS136 have configuration and power on registers */
308-
if (data->type != TYPE_MMS114 && data->type != TYPE_MMS136)
309+
/* MMS114, MMS134S and MMS136 have configuration and power on registers */
310+
if (data->type != TYPE_MMS114 && data->type != TYPE_MMS134S &&
311+
data->type != TYPE_MMS136)
309312
return 0;
310313

311314
error = mms114_set_active(data, true);
@@ -487,7 +490,8 @@ static int mms114_probe(struct i2c_client *client,
487490
0, data->props.max_y, 0, 0);
488491
}
489492

490-
if (data->type == TYPE_MMS114 || data->type == TYPE_MMS136) {
493+
if (data->type == TYPE_MMS114 || data->type == TYPE_MMS134S ||
494+
data->type == TYPE_MMS136) {
491495
/*
492496
* The firmware handles movement and pressure fuzz, so
493497
* don't duplicate that in software.
@@ -611,6 +615,9 @@ static const struct of_device_id mms114_dt_match[] = {
611615
{
612616
.compatible = "melfas,mms114",
613617
.data = (void *)TYPE_MMS114,
618+
}, {
619+
.compatible = "melfas,mms134s",
620+
.data = (void *)TYPE_MMS134S,
614621
}, {
615622
.compatible = "melfas,mms136",
616623
.data = (void *)TYPE_MMS136,

0 commit comments

Comments
 (0)