diff options
| -rw-r--r-- | Documentation/input/alps.txt | 8 | ||||
| -rw-r--r-- | drivers/input/mouse/alps.c | 37 |
2 files changed, 31 insertions, 14 deletions
diff --git a/Documentation/input/alps.txt b/Documentation/input/alps.txt index a63e5e013a8c..92ae734c00c3 100644 --- a/Documentation/input/alps.txt +++ b/Documentation/input/alps.txt | |||
| @@ -114,6 +114,9 @@ ALPS Absolute Mode - Protocol Version 2 | |||
| 114 | byte 4: 0 y6 y5 y4 y3 y2 y1 y0 | 114 | byte 4: 0 y6 y5 y4 y3 y2 y1 y0 |
| 115 | byte 5: 0 z6 z5 z4 z3 z2 z1 z0 | 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 | Dualpoint device -- interleaved packet format | 120 | Dualpoint device -- interleaved packet format |
| 118 | --------------------------------------------- | 121 | --------------------------------------------- |
| 119 | 122 | ||
| @@ -127,6 +130,11 @@ Dualpoint device -- interleaved packet format | |||
| 127 | byte 7: 0 y6 y5 y4 y3 y2 y1 y0 | 130 | byte 7: 0 y6 y5 y4 y3 y2 y1 y0 |
| 128 | byte 8: 0 z6 z5 z4 z3 z2 z1 z0 | 131 | byte 8: 0 z6 z5 z4 z3 z2 z1 z0 |
| 129 | 132 | ||
| 133 | Devices which use the interleaving format normally send standard PS/2 mouse | ||
| 134 | packets for the DualPoint Stick + ALPS Absolute Mode packets for the | ||
| 135 | touchpad, switching to the interleaved packet format when both the stick and | ||
| 136 | the touchpad are used at the same time. | ||
| 137 | |||
| 130 | ALPS Absolute Mode - Protocol Version 3 | 138 | ALPS Absolute Mode - Protocol Version 3 |
| 131 | --------------------------------------- | 139 | --------------------------------------- |
| 132 | 140 | ||
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 33198b91bebf..27bcdbc950c9 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
| @@ -1154,10 +1154,28 @@ out: | |||
| 1154 | mutex_unlock(&alps_mutex); | 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 | unsigned char packet[], | 1158 | unsigned char packet[], |
| 1159 | bool report_buttons) | 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 | if (report_buttons) | 1179 | if (report_buttons) |
| 1162 | alps_report_buttons(dev, NULL, | 1180 | alps_report_buttons(dev, NULL, |
| 1163 | packet[0] & 1, packet[0] & 2, packet[0] & 4); | 1181 | packet[0] & 1, packet[0] & 2, packet[0] & 4); |
| @@ -1232,8 +1250,8 @@ static psmouse_ret_t alps_handle_interleaved_ps2(struct psmouse *psmouse) | |||
| 1232 | * de-synchronization. | 1250 | * de-synchronization. |
| 1233 | */ | 1251 | */ |
| 1234 | 1252 | ||
| 1235 | alps_report_bare_ps2_packet(priv->dev2, | 1253 | alps_report_bare_ps2_packet(psmouse, &psmouse->packet[3], |
| 1236 | &psmouse->packet[3], false); | 1254 | false); |
| 1237 | 1255 | ||
| 1238 | /* | 1256 | /* |
| 1239 | * Continue with the standard ALPS protocol handling, | 1257 | * Continue with the standard ALPS protocol handling, |
| @@ -1289,18 +1307,9 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse) | |||
| 1289 | * properly we only do this if the device is fully synchronized. | 1307 | * properly we only do this if the device is fully synchronized. |
| 1290 | */ | 1308 | */ |
| 1291 | if (!psmouse->out_of_sync_cnt && (psmouse->packet[0] & 0xc8) == 0x08) { | 1309 | if (!psmouse->out_of_sync_cnt && (psmouse->packet[0] & 0xc8) == 0x08) { |
| 1292 | |||
| 1293 | /* Register dev3 mouse if we received PS/2 packet first time */ | ||
| 1294 | if (unlikely(!priv->dev3)) | ||
| 1295 | psmouse_queue_work(psmouse, | ||
| 1296 | &priv->dev3_register_work, 0); | ||
| 1297 | |||
| 1298 | if (psmouse->pktcnt == 3) { | 1310 | if (psmouse->pktcnt == 3) { |
| 1299 | /* Once dev3 mouse device is registered report data */ | 1311 | alps_report_bare_ps2_packet(psmouse, psmouse->packet, |
| 1300 | if (likely(!IS_ERR_OR_NULL(priv->dev3))) | 1312 | true); |
| 1301 | alps_report_bare_ps2_packet(priv->dev3, | ||
| 1302 | psmouse->packet, | ||
| 1303 | true); | ||
| 1304 | return PSMOUSE_FULL_PACKET; | 1313 | return PSMOUSE_FULL_PACKET; |
| 1305 | } | 1314 | } |
| 1306 | return PSMOUSE_GOOD_DATA; | 1315 | return PSMOUSE_GOOD_DATA; |
