Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input fixes from Dmitry Torokhov:
"Updates for the input subsystem - two more tweaks for ALPS driver to
work out kinks after splitting the touchpad, trackstick, and potential
external PS/2 mouse into separate input devices.

Changes to support ALPS SS4 devices (protocol V8) will be coming in
4.1..."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: alps - document stick behavior for protocol V2
Input: alps - report V2 Dualpoint Stick events via the right evdev node
Input: alps - report interleaved bare PS/2 packets via dev3

Changed files
+31 -14
Documentation
input
drivers
input
mouse
+8
Documentation/input/alps.txt
··· 114 114 byte 4: 0 y6 y5 y4 y3 y2 y1 y0 115 115 byte 5: 0 z6 z5 z4 z3 z2 z1 z0 116 116 117 + Protocol Version 2 DualPoint devices send standard PS/2 mouse packets for 118 + the DualPoint Stick. 119 + 117 120 Dualpoint device -- interleaved packet format 118 121 --------------------------------------------- 119 122 ··· 129 126 byte 6: 0 y9 y8 y7 1 m r l 130 127 byte 7: 0 y6 y5 y4 y3 y2 y1 y0 131 128 byte 8: 0 z6 z5 z4 z3 z2 z1 z0 129 + 130 + Devices which use the interleaving format normally send standard PS/2 mouse 131 + packets for the DualPoint Stick + ALPS Absolute Mode packets for the 132 + touchpad, switching to the interleaved packet format when both the stick and 133 + the touchpad are used at the same time. 132 134 133 135 ALPS Absolute Mode - Protocol Version 3 134 136 ---------------------------------------
+23 -14
drivers/input/mouse/alps.c
··· 1154 1154 mutex_unlock(&alps_mutex); 1155 1155 } 1156 1156 1157 - static void alps_report_bare_ps2_packet(struct input_dev *dev, 1157 + static void alps_report_bare_ps2_packet(struct psmouse *psmouse, 1158 1158 unsigned char packet[], 1159 1159 bool report_buttons) 1160 1160 { 1161 + struct alps_data *priv = psmouse->private; 1162 + struct input_dev *dev; 1163 + 1164 + /* Figure out which device to use to report the bare packet */ 1165 + if (priv->proto_version == ALPS_PROTO_V2 && 1166 + (priv->flags & ALPS_DUALPOINT)) { 1167 + /* On V2 devices the DualPoint Stick reports bare packets */ 1168 + dev = priv->dev2; 1169 + } else if (unlikely(IS_ERR_OR_NULL(priv->dev3))) { 1170 + /* Register dev3 mouse if we received PS/2 packet first time */ 1171 + if (!IS_ERR(priv->dev3)) 1172 + psmouse_queue_work(psmouse, &priv->dev3_register_work, 1173 + 0); 1174 + return; 1175 + } else { 1176 + dev = priv->dev3; 1177 + } 1178 + 1161 1179 if (report_buttons) 1162 1180 alps_report_buttons(dev, NULL, 1163 1181 packet[0] & 1, packet[0] & 2, packet[0] & 4); ··· 1250 1232 * de-synchronization. 1251 1233 */ 1252 1234 1253 - alps_report_bare_ps2_packet(priv->dev2, 1254 - &psmouse->packet[3], false); 1235 + alps_report_bare_ps2_packet(psmouse, &psmouse->packet[3], 1236 + false); 1255 1237 1256 1238 /* 1257 1239 * Continue with the standard ALPS protocol handling, ··· 1307 1289 * properly we only do this if the device is fully synchronized. 1308 1290 */ 1309 1291 if (!psmouse->out_of_sync_cnt && (psmouse->packet[0] & 0xc8) == 0x08) { 1310 - 1311 - /* Register dev3 mouse if we received PS/2 packet first time */ 1312 - if (unlikely(!priv->dev3)) 1313 - psmouse_queue_work(psmouse, 1314 - &priv->dev3_register_work, 0); 1315 - 1316 1292 if (psmouse->pktcnt == 3) { 1317 - /* Once dev3 mouse device is registered report data */ 1318 - if (likely(!IS_ERR_OR_NULL(priv->dev3))) 1319 - alps_report_bare_ps2_packet(priv->dev3, 1320 - psmouse->packet, 1321 - true); 1293 + alps_report_bare_ps2_packet(psmouse, psmouse->packet, 1294 + true); 1322 1295 return PSMOUSE_FULL_PACKET; 1323 1296 } 1324 1297 return PSMOUSE_GOOD_DATA;