Skip to content

Commit 1134ca2

Browse files
committed
Merge branch 'next' into for-linus
Prepare second round of input updates for 4.9 merge window.
2 parents c758f96 + 930e192 commit 1134ca2

File tree

18 files changed

+411
-59
lines changed

18 files changed

+411
-59
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
* MELFAS MIP4 Touchscreen
2+
3+
Required properties:
4+
- compatible: must be "melfas,mip4_ts"
5+
- reg: I2C slave address of the chip (0x48 or 0x34)
6+
- interrupt-parent: interrupt controller to which the chip is connected
7+
- interrupts: interrupt to which the chip is connected
8+
9+
Optional properties:
10+
- ce-gpios: GPIO connected to the CE (chip enable) pin of the chip
11+
12+
Example:
13+
i2c@00000000 {
14+
touchscreen: melfas_mip4@48 {
15+
compatible = "melfas,mip4_ts";
16+
reg = <0x48>;
17+
interrupt-parent = <&gpio>;
18+
interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
19+
ce-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
20+
};
21+
};

Documentation/devicetree/bindings/vendor-prefixes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ marvell Marvell Technology Group Ltd.
143143
maxim Maxim Integrated Products
144144
mediatek MediaTek Inc.
145145
melexis Melexis N.V.
146+
melfas MELFAS Inc.
146147
merrii Merrii Technology Co., Ltd.
147148
micrel Micrel Inc.
148149
microchip Microchip Technology Inc.

Documentation/input/alps.txt

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,3 +319,60 @@ For touchpad packet, the format is:
319319
otherwise byte 0 bit 4 must be set and byte 0/4/5 are
320320
in NEW fmt
321321
F: Number of fingers - 3, 0 means 3 fingers, 1 means 4 ...
322+
323+
324+
ALPS Absolute Mode - Protocol Version 8
325+
---------------------------------------
326+
327+
Spoken by SS4 (73 03 14) and SS5 (73 03 28) hardware.
328+
329+
The packet type is given by the APD field, bits 4-5 of byte 3.
330+
331+
Touchpad packet (APD = 0x2):
332+
333+
b7 b6 b5 b4 b3 b2 b1 b0
334+
byte 0: SWM SWR SWL 1 1 0 0 X7
335+
byte 1: 0 X6 X5 X4 X3 X2 X1 X0
336+
byte 2: 0 Y6 Y5 Y4 Y3 Y2 Y1 Y0
337+
byte 3: 0 T&P 1 0 1 0 0 Y7
338+
byte 4: 0 Z6 Z5 Z4 Z3 Z2 Z1 Z0
339+
byte 5: 0 0 0 0 0 0 0 0
340+
341+
SWM, SWR, SWL: Middle, Right, and Left button states
342+
343+
Touchpad 1 Finger packet (APD = 0x0):
344+
345+
b7 b6 b5 b4 b3 b2 b1 b0
346+
byte 0: SWM SWR SWL 1 1 X2 X1 X0
347+
byte 1: X9 X8 X7 1 X6 X5 X4 X3
348+
byte 2: 0 X11 X10 LFB Y3 Y2 Y1 Y0
349+
byte 3: Y5 Y4 0 0 1 TAPF2 TAPF1 TAPF0
350+
byte 4: Zv7 Y11 Y10 1 Y9 Y8 Y7 Y6
351+
byte 5: Zv6 Zv5 Zv4 0 Zv3 Zv2 Zv1 Zv0
352+
353+
TAPF: ???
354+
LFB: ???
355+
356+
Touchpad 2 Finger packet (APD = 0x1):
357+
358+
b7 b6 b5 b4 b3 b2 b1 b0
359+
byte 0: SWM SWR SWL 1 1 AX6 AX5 AX4
360+
byte 1: AX11 AX10 AX9 AX8 AX7 AZ1 AY4 AZ0
361+
byte 2: AY11 AY10 AY9 CONT AY8 AY7 AY6 AY5
362+
byte 3: 0 0 0 1 1 BX6 BX5 BX4
363+
byte 4: BX11 BX10 BX9 BX8 BX7 BZ1 BY4 BZ0
364+
byte 5: BY11 BY10 BY9 0 BY8 BY7 BY5 BY5
365+
366+
CONT: A 3-or-4 Finger packet is to follow
367+
368+
Touchpad 3-or-4 Finger packet (APD = 0x3):
369+
370+
b7 b6 b5 b4 b3 b2 b1 b0
371+
byte 0: SWM SWR SWL 1 1 AX6 AX5 AX4
372+
byte 1: AX11 AX10 AX9 AX8 AX7 AZ1 AY4 AZ0
373+
byte 2: AY11 AY10 AY9 OVF AY8 AY7 AY6 AY5
374+
byte 3: 0 0 1 1 1 BX6 BX5 BX4
375+
byte 4: BX11 BX10 BX9 BX8 BX7 BZ1 BY4 BZ0
376+
byte 5: BY11 BY10 BY9 0 BY8 BY7 BY5 BY5
377+
378+
OVF: 5th finger detected

Documentation/kernel-parameters.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
14091409
i8042.nopnp [HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX
14101410
controllers
14111411
i8042.notimeout [HW] Ignore timeout condition signalled by controller
1412-
i8042.reset [HW] Reset the controller during init and cleanup
1412+
i8042.reset [HW] Reset the controller during init, cleanup and
1413+
suspend-to-ram transitions, only during s2r
1414+
transitions, or never reset
1415+
Format: { 1 | Y | y | 0 | N | n }
1416+
1, Y, y: always reset controller
1417+
0, N, n: don't ever reset controller
1418+
Default: only on s2r transitions on x86; most other
1419+
architectures force reset to be always executed
14131420
i8042.unlock [HW] Unlock (ignore) the keylock
14141421
i8042.kbdreset [HW] Reset device connected to KBD port
14151422

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7155,6 +7155,13 @@ F: Documentation/scsi/megaraid.txt
71557155
F: drivers/scsi/megaraid.*
71567156
F: drivers/scsi/megaraid/
71577157

7158+
MELFAS MIP4 TOUCHSCREEN DRIVER
7159+
M: Sangwon Jee <[email protected]>
7160+
W: http://www.melfas.com
7161+
S: Supported
7162+
F: drivers/input/touchscreen/melfas_mip4.c
7163+
F: Documentation/devicetree/bindings/input/touchscreen/melfas_mip4.txt
7164+
71587165
MELLANOX ETHERNET DRIVER (mlx4_en)
71597166
M: Eugenia Emantayev <[email protected]>
71607167

drivers/input/mouse/alps.c

Lines changed: 75 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ static const struct alps_nibble_commands alps_v6_nibble_commands[] = {
103103
6-byte ALPS packet */
104104
#define ALPS_STICK_BITS 0x100 /* separate stick button bits */
105105
#define ALPS_BUTTONPAD 0x200 /* device is a clickpad */
106+
#define ALPS_DUALPOINT_WITH_PRESSURE 0x400 /* device can report trackpoint pressure */
106107

107108
static const struct alps_model_info alps_model_data[] = {
108109
{ { 0x32, 0x02, 0x14 }, 0x00, { ALPS_PROTO_V2, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT } }, /* Toshiba Salellite Pro M10 */
@@ -1156,15 +1157,28 @@ static unsigned char alps_get_pkt_id_ss4_v2(unsigned char *byte)
11561157
{
11571158
unsigned char pkt_id = SS4_PACKET_ID_IDLE;
11581159

1159-
if (byte[0] == 0x18 && byte[1] == 0x10 && byte[2] == 0x00 &&
1160-
(byte[3] & 0x88) == 0x08 && byte[4] == 0x10 && byte[5] == 0x00) {
1161-
pkt_id = SS4_PACKET_ID_IDLE;
1162-
} else if (!(byte[3] & 0x10)) {
1163-
pkt_id = SS4_PACKET_ID_ONE;
1164-
} else if (!(byte[3] & 0x20)) {
1160+
switch (byte[3] & 0x30) {
1161+
case 0x00:
1162+
if (byte[0] == 0x18 && byte[1] == 0x10 && byte[2] == 0x00 &&
1163+
(byte[3] & 0x88) == 0x08 && byte[4] == 0x10 &&
1164+
byte[5] == 0x00) {
1165+
pkt_id = SS4_PACKET_ID_IDLE;
1166+
} else {
1167+
pkt_id = SS4_PACKET_ID_ONE;
1168+
}
1169+
break;
1170+
case 0x10:
1171+
/* two-finger finger positions */
11651172
pkt_id = SS4_PACKET_ID_TWO;
1166-
} else {
1173+
break;
1174+
case 0x20:
1175+
/* stick pointer */
1176+
pkt_id = SS4_PACKET_ID_STICK;
1177+
break;
1178+
case 0x30:
1179+
/* third and fourth finger positions */
11671180
pkt_id = SS4_PACKET_ID_MULTI;
1181+
break;
11681182
}
11691183

11701184
return pkt_id;
@@ -1185,7 +1199,13 @@ static int alps_decode_ss4_v2(struct alps_fields *f,
11851199
f->mt[0].x = SS4_1F_X_V2(p);
11861200
f->mt[0].y = SS4_1F_Y_V2(p);
11871201
f->pressure = ((SS4_1F_Z_V2(p)) * 2) & 0x7f;
1188-
f->fingers = 1;
1202+
/*
1203+
* When a button is held the device will give us events
1204+
* with x, y, and pressure of 0. This causes annoying jumps
1205+
* if a touch is released while the button is held.
1206+
* Handle this by claiming zero contacts.
1207+
*/
1208+
f->fingers = f->pressure > 0 ? 1 : 0;
11891209
f->first_mp = 0;
11901210
f->is_mp = 0;
11911211
break;
@@ -1246,16 +1266,40 @@ static int alps_decode_ss4_v2(struct alps_fields *f,
12461266
}
12471267
break;
12481268

1269+
case SS4_PACKET_ID_STICK:
1270+
if (!(priv->flags & ALPS_DUALPOINT)) {
1271+
psmouse_warn(psmouse,
1272+
"Rejected trackstick packet from non DualPoint device");
1273+
} else {
1274+
int x = (s8)(((p[0] & 1) << 7) | (p[1] & 0x7f));
1275+
int y = (s8)(((p[3] & 1) << 7) | (p[2] & 0x7f));
1276+
int pressure = (s8)(p[4] & 0x7f);
1277+
1278+
input_report_rel(priv->dev2, REL_X, x);
1279+
input_report_rel(priv->dev2, REL_Y, -y);
1280+
input_report_abs(priv->dev2, ABS_PRESSURE, pressure);
1281+
}
1282+
break;
1283+
12491284
case SS4_PACKET_ID_IDLE:
12501285
default:
12511286
memset(f, 0, sizeof(struct alps_fields));
12521287
break;
12531288
}
12541289

1255-
f->left = !!(SS4_BTN_V2(p) & 0x01);
1256-
if (!(priv->flags & ALPS_BUTTONPAD)) {
1257-
f->right = !!(SS4_BTN_V2(p) & 0x02);
1258-
f->middle = !!(SS4_BTN_V2(p) & 0x04);
1290+
/* handle buttons */
1291+
if (pkt_id == SS4_PACKET_ID_STICK) {
1292+
f->ts_left = !!(SS4_BTN_V2(p) & 0x01);
1293+
if (!(priv->flags & ALPS_BUTTONPAD)) {
1294+
f->ts_right = !!(SS4_BTN_V2(p) & 0x02);
1295+
f->ts_middle = !!(SS4_BTN_V2(p) & 0x04);
1296+
}
1297+
} else {
1298+
f->left = !!(SS4_BTN_V2(p) & 0x01);
1299+
if (!(priv->flags & ALPS_BUTTONPAD)) {
1300+
f->right = !!(SS4_BTN_V2(p) & 0x02);
1301+
f->middle = !!(SS4_BTN_V2(p) & 0x04);
1302+
}
12591303
}
12601304

12611305
return 0;
@@ -1266,6 +1310,7 @@ static void alps_process_packet_ss4_v2(struct psmouse *psmouse)
12661310
struct alps_data *priv = psmouse->private;
12671311
unsigned char *packet = psmouse->packet;
12681312
struct input_dev *dev = psmouse->dev;
1313+
struct input_dev *dev2 = priv->dev2;
12691314
struct alps_fields *f = &priv->f;
12701315

12711316
memset(f, 0, sizeof(struct alps_fields));
@@ -1311,6 +1356,13 @@ static void alps_process_packet_ss4_v2(struct psmouse *psmouse)
13111356

13121357
input_report_abs(dev, ABS_PRESSURE, f->pressure);
13131358
input_sync(dev);
1359+
1360+
if (priv->flags & ALPS_DUALPOINT) {
1361+
input_report_key(dev2, BTN_LEFT, f->ts_left);
1362+
input_report_key(dev2, BTN_RIGHT, f->ts_right);
1363+
input_report_key(dev2, BTN_MIDDLE, f->ts_middle);
1364+
input_sync(dev2);
1365+
}
13141366
}
13151367

13161368
static bool alps_is_valid_package_ss4_v2(struct psmouse *psmouse)
@@ -2695,6 +2747,10 @@ static int alps_set_protocol(struct psmouse *psmouse,
26952747
if (alps_set_defaults_ss4_v2(psmouse, priv))
26962748
return -EIO;
26972749

2750+
if (priv->fw_ver[1] == 0x1)
2751+
priv->flags |= ALPS_DUALPOINT |
2752+
ALPS_DUALPOINT_WITH_PRESSURE;
2753+
26982754
break;
26992755
}
27002756

@@ -2767,6 +2823,9 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv)
27672823
} else if (e7[0] == 0x73 && e7[1] == 0x03 &&
27682824
e7[2] == 0x14 && ec[1] == 0x02) {
27692825
protocol = &alps_v8_protocol_data;
2826+
} else if (e7[0] == 0x73 && e7[1] == 0x03 &&
2827+
e7[2] == 0x28 && ec[1] == 0x01) {
2828+
protocol = &alps_v8_protocol_data;
27702829
} else {
27712830
psmouse_dbg(psmouse,
27722831
"Likely not an ALPS touchpad: E7=%3ph, EC=%3ph\n", e7, ec);
@@ -2949,6 +3008,10 @@ int alps_init(struct psmouse *psmouse)
29493008

29503009
input_set_capability(dev2, EV_REL, REL_X);
29513010
input_set_capability(dev2, EV_REL, REL_Y);
3011+
if (priv->flags & ALPS_DUALPOINT_WITH_PRESSURE) {
3012+
input_set_capability(dev2, EV_ABS, ABS_PRESSURE);
3013+
input_set_abs_params(dev2, ABS_PRESSURE, 0, 127, 0, 0);
3014+
}
29523015
input_set_capability(dev2, EV_KEY, BTN_LEFT);
29533016
input_set_capability(dev2, EV_KEY, BTN_RIGHT);
29543017
input_set_capability(dev2, EV_KEY, BTN_MIDDLE);

drivers/input/mouse/alps.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@
3737
* or there's button activities.
3838
* SS4_PACKET_ID_TWO: There's two or more fingers on touchpad
3939
* SS4_PACKET_ID_MULTI: There's three or more fingers on touchpad
40+
* SS4_PACKET_ID_STICK: A stick pointer packet
4041
*/
4142
enum SS4_PACKET_ID {
4243
SS4_PACKET_ID_IDLE = 0,
4344
SS4_PACKET_ID_ONE,
4445
SS4_PACKET_ID_TWO,
4546
SS4_PACKET_ID_MULTI,
47+
SS4_PACKET_ID_STICK,
4648
};
4749

4850
#define SS4_COUNT_PER_ELECTRODE 256

drivers/input/mouse/elantech.c

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ static int elantech_get_resolution_v4(struct psmouse *psmouse,
11341134
* System76 Pangolin 0x250f01 ? 2 hw buttons
11351135
* (*) + 3 trackpoint buttons
11361136
* (**) + 0 trackpoint buttons
1137-
* Note: Lenovo L430 and Lenovo L430 have the same fw_version/caps
1137+
* Note: Lenovo L430 and Lenovo L530 have the same fw_version/caps
11381138
*/
11391139
static void elantech_set_buttonpad_prop(struct psmouse *psmouse)
11401140
{
@@ -1159,6 +1159,13 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = {
11591159
DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H730"),
11601160
},
11611161
},
1162+
{
1163+
/* Fujitsu H760 also has a middle button */
1164+
.matches = {
1165+
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
1166+
DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H760"),
1167+
},
1168+
},
11621169
#endif
11631170
{ }
11641171
};
@@ -1503,10 +1510,10 @@ static const struct dmi_system_id elantech_dmi_force_crc_enabled[] = {
15031510
},
15041511
},
15051512
{
1506-
/* Fujitsu LIFEBOOK E554 does not work with crc_enabled == 0 */
1513+
/* Fujitsu H760 does not work with crc_enabled == 0 */
15071514
.matches = {
15081515
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
1509-
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E554"),
1516+
DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H760"),
15101517
},
15111518
},
15121519
{
@@ -1516,6 +1523,20 @@ static const struct dmi_system_id elantech_dmi_force_crc_enabled[] = {
15161523
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E544"),
15171524
},
15181525
},
1526+
{
1527+
/* Fujitsu LIFEBOOK E554 does not work with crc_enabled == 0 */
1528+
.matches = {
1529+
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
1530+
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E554"),
1531+
},
1532+
},
1533+
{
1534+
/* Fujitsu LIFEBOOK E556 does not work with crc_enabled == 0 */
1535+
.matches = {
1536+
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
1537+
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E556"),
1538+
},
1539+
},
15191540
{
15201541
/* Fujitsu LIFEBOOK U745 does not work with crc_enabled == 0 */
15211542
.matches = {

0 commit comments

Comments
 (0)