Skip to content

Commit bab9752

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input fixes from Dmitry Torokhov: - a tweak to the IBM Trackpoint driver that helps recognizing trackpoints on never Lenovo Carbons - a fix to the ALPS driver solving scroll issues on some Dells - yet another ACPI ID has been added to Elan I2C toucpad driver - quieted diagnostic message in soc_button_array driver * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: ALPS - fix two-finger scroll breakage in right side on ALPS touchpad Input: soc_button_array - silence -ENOENT error on Dell XPS13 9365 Input: trackpoint - add new trackpoint firmware ID Input: elan_i2c - add ELAN0602 ACPI ID to support Lenovo Yoga310
2 parents 9716bdb + 4a64658 commit bab9752

File tree

6 files changed

+45
-13
lines changed

6 files changed

+45
-13
lines changed

drivers/input/misc/soc_button_array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ static int soc_button_probe(struct platform_device *pdev)
331331
error = gpiod_count(dev, NULL);
332332
if (error < 0) {
333333
dev_dbg(dev, "no GPIO attached, ignoring...\n");
334-
return error;
334+
return -ENODEV;
335335
}
336336

337337
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);

drivers/input/mouse/alps.c

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,14 +1215,24 @@ static int alps_decode_ss4_v2(struct alps_fields *f,
12151215

12161216
case SS4_PACKET_ID_TWO:
12171217
if (priv->flags & ALPS_BUTTONPAD) {
1218-
f->mt[0].x = SS4_BTL_MF_X_V2(p, 0);
1218+
if (IS_SS4PLUS_DEV(priv->dev_id)) {
1219+
f->mt[0].x = SS4_PLUS_BTL_MF_X_V2(p, 0);
1220+
f->mt[1].x = SS4_PLUS_BTL_MF_X_V2(p, 1);
1221+
} else {
1222+
f->mt[0].x = SS4_BTL_MF_X_V2(p, 0);
1223+
f->mt[1].x = SS4_BTL_MF_X_V2(p, 1);
1224+
}
12191225
f->mt[0].y = SS4_BTL_MF_Y_V2(p, 0);
1220-
f->mt[1].x = SS4_BTL_MF_X_V2(p, 1);
12211226
f->mt[1].y = SS4_BTL_MF_Y_V2(p, 1);
12221227
} else {
1223-
f->mt[0].x = SS4_STD_MF_X_V2(p, 0);
1228+
if (IS_SS4PLUS_DEV(priv->dev_id)) {
1229+
f->mt[0].x = SS4_PLUS_STD_MF_X_V2(p, 0);
1230+
f->mt[1].x = SS4_PLUS_STD_MF_X_V2(p, 1);
1231+
} else {
1232+
f->mt[0].x = SS4_STD_MF_X_V2(p, 0);
1233+
f->mt[1].x = SS4_STD_MF_X_V2(p, 1);
1234+
}
12241235
f->mt[0].y = SS4_STD_MF_Y_V2(p, 0);
1225-
f->mt[1].x = SS4_STD_MF_X_V2(p, 1);
12261236
f->mt[1].y = SS4_STD_MF_Y_V2(p, 1);
12271237
}
12281238
f->pressure = SS4_MF_Z_V2(p, 0) ? 0x30 : 0;
@@ -1239,16 +1249,27 @@ static int alps_decode_ss4_v2(struct alps_fields *f,
12391249

12401250
case SS4_PACKET_ID_MULTI:
12411251
if (priv->flags & ALPS_BUTTONPAD) {
1242-
f->mt[2].x = SS4_BTL_MF_X_V2(p, 0);
1252+
if (IS_SS4PLUS_DEV(priv->dev_id)) {
1253+
f->mt[0].x = SS4_PLUS_BTL_MF_X_V2(p, 0);
1254+
f->mt[1].x = SS4_PLUS_BTL_MF_X_V2(p, 1);
1255+
} else {
1256+
f->mt[2].x = SS4_BTL_MF_X_V2(p, 0);
1257+
f->mt[3].x = SS4_BTL_MF_X_V2(p, 1);
1258+
}
1259+
12431260
f->mt[2].y = SS4_BTL_MF_Y_V2(p, 0);
1244-
f->mt[3].x = SS4_BTL_MF_X_V2(p, 1);
12451261
f->mt[3].y = SS4_BTL_MF_Y_V2(p, 1);
12461262
no_data_x = SS4_MFPACKET_NO_AX_BL;
12471263
no_data_y = SS4_MFPACKET_NO_AY_BL;
12481264
} else {
1249-
f->mt[2].x = SS4_STD_MF_X_V2(p, 0);
1265+
if (IS_SS4PLUS_DEV(priv->dev_id)) {
1266+
f->mt[0].x = SS4_PLUS_STD_MF_X_V2(p, 0);
1267+
f->mt[1].x = SS4_PLUS_STD_MF_X_V2(p, 1);
1268+
} else {
1269+
f->mt[0].x = SS4_STD_MF_X_V2(p, 0);
1270+
f->mt[1].x = SS4_STD_MF_X_V2(p, 1);
1271+
}
12501272
f->mt[2].y = SS4_STD_MF_Y_V2(p, 0);
1251-
f->mt[3].x = SS4_STD_MF_X_V2(p, 1);
12521273
f->mt[3].y = SS4_STD_MF_Y_V2(p, 1);
12531274
no_data_x = SS4_MFPACKET_NO_AX;
12541275
no_data_y = SS4_MFPACKET_NO_AY;
@@ -2541,8 +2562,8 @@ static int alps_set_defaults_ss4_v2(struct psmouse *psmouse,
25412562

25422563
memset(otp, 0, sizeof(otp));
25432564

2544-
if (alps_get_otp_values_ss4_v2(psmouse, 0, &otp[0][0]) ||
2545-
alps_get_otp_values_ss4_v2(psmouse, 1, &otp[1][0]))
2565+
if (alps_get_otp_values_ss4_v2(psmouse, 1, &otp[1][0]) ||
2566+
alps_get_otp_values_ss4_v2(psmouse, 0, &otp[0][0]))
25462567
return -1;
25472568

25482569
alps_update_device_area_ss4_v2(otp, priv);

drivers/input/mouse/alps.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ enum SS4_PACKET_ID {
100100
((_b[1 + _i * 3] << 5) & 0x1F00) \
101101
)
102102

103+
#define SS4_PLUS_STD_MF_X_V2(_b, _i) (((_b[0 + (_i) * 3] << 4) & 0x0070) | \
104+
((_b[1 + (_i) * 3] << 4) & 0x0F80) \
105+
)
106+
103107
#define SS4_STD_MF_Y_V2(_b, _i) (((_b[1 + (_i) * 3] << 3) & 0x0010) | \
104108
((_b[2 + (_i) * 3] << 5) & 0x01E0) | \
105109
((_b[2 + (_i) * 3] << 4) & 0x0E00) \
@@ -109,6 +113,10 @@ enum SS4_PACKET_ID {
109113
((_b[0 + (_i) * 3] >> 3) & 0x0010) \
110114
)
111115

116+
#define SS4_PLUS_BTL_MF_X_V2(_b, _i) (SS4_PLUS_STD_MF_X_V2(_b, _i) | \
117+
((_b[0 + (_i) * 3] >> 4) & 0x0008) \
118+
)
119+
112120
#define SS4_BTL_MF_Y_V2(_b, _i) (SS4_STD_MF_Y_V2(_b, _i) | \
113121
((_b[0 + (_i) * 3] >> 3) & 0x0008) \
114122
)

drivers/input/mouse/elan_i2c_core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,7 @@ static const struct acpi_device_id elan_acpi_id[] = {
12471247
{ "ELAN0000", 0 },
12481248
{ "ELAN0100", 0 },
12491249
{ "ELAN0600", 0 },
1250+
{ "ELAN0602", 0 },
12501251
{ "ELAN0605", 0 },
12511252
{ "ELAN0608", 0 },
12521253
{ "ELAN0605", 0 },

drivers/input/mouse/trackpoint.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ static int trackpoint_start_protocol(struct psmouse *psmouse, unsigned char *fir
265265
if (ps2_command(&psmouse->ps2dev, param, MAKE_PS2_CMD(0, 2, TP_READ_ID)))
266266
return -1;
267267

268-
if (param[0] != TP_MAGIC_IDENT)
268+
/* add new TP ID. */
269+
if (!(param[0] & TP_MAGIC_IDENT))
269270
return -1;
270271

271272
if (firmware_id)

drivers/input/mouse/trackpoint.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
#define TP_COMMAND 0xE2 /* Commands start with this */
2222

2323
#define TP_READ_ID 0xE1 /* Sent for device identification */
24-
#define TP_MAGIC_IDENT 0x01 /* Sent after a TP_READ_ID followed */
24+
#define TP_MAGIC_IDENT 0x03 /* Sent after a TP_READ_ID followed */
2525
/* by the firmware ID */
26+
/* Firmware ID includes 0x1, 0x2, 0x3 */
2627

2728

2829
/*

0 commit comments

Comments
 (0)