diff options
Diffstat (limited to 'drivers/input/mouse/alps.c')
-rw-r--r-- | drivers/input/mouse/alps.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 24474335dfd1..2141501e9f2e 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
@@ -348,6 +348,40 @@ static int alps_tap_mode(struct psmouse *psmouse, int enable) | |||
348 | return 0; | 348 | return 0; |
349 | } | 349 | } |
350 | 350 | ||
351 | /* | ||
352 | * alps_poll() - poll the touchpad for current motion packet. | ||
353 | * Used in resync. | ||
354 | */ | ||
355 | static int alps_poll(struct psmouse *psmouse) | ||
356 | { | ||
357 | struct alps_data *priv = psmouse->private; | ||
358 | unsigned char buf[6]; | ||
359 | int poll_failed; | ||
360 | |||
361 | if (priv->i->flags & ALPS_PASS) | ||
362 | alps_passthrough_mode(psmouse, 1); | ||
363 | |||
364 | poll_failed = ps2_command(&psmouse->ps2dev, buf, | ||
365 | PSMOUSE_CMD_POLL | (psmouse->pktsize << 8)) < 0; | ||
366 | |||
367 | if (priv->i->flags & ALPS_PASS) | ||
368 | alps_passthrough_mode(psmouse, 0); | ||
369 | |||
370 | if (poll_failed || (buf[0] & priv->i->mask0) != priv->i->byte0) | ||
371 | return -1; | ||
372 | |||
373 | if ((psmouse->badbyte & 0xc8) == 0x08) { | ||
374 | /* | ||
375 | * Poll the track stick ... | ||
376 | */ | ||
377 | if (ps2_command(&psmouse->ps2dev, buf, PSMOUSE_CMD_POLL | (3 << 8))) | ||
378 | return -1; | ||
379 | } | ||
380 | |||
381 | memcpy(psmouse->packet, buf, sizeof(buf)); | ||
382 | return 0; | ||
383 | } | ||
384 | |||
351 | static int alps_reconnect(struct psmouse *psmouse) | 385 | static int alps_reconnect(struct psmouse *psmouse) |
352 | { | 386 | { |
353 | struct alps_data *priv = psmouse->private; | 387 | struct alps_data *priv = psmouse->private; |
@@ -451,10 +485,14 @@ int alps_init(struct psmouse *psmouse) | |||
451 | input_register_device(priv->dev2); | 485 | input_register_device(priv->dev2); |
452 | 486 | ||
453 | psmouse->protocol_handler = alps_process_byte; | 487 | psmouse->protocol_handler = alps_process_byte; |
488 | psmouse->poll = alps_poll; | ||
454 | psmouse->disconnect = alps_disconnect; | 489 | psmouse->disconnect = alps_disconnect; |
455 | psmouse->reconnect = alps_reconnect; | 490 | psmouse->reconnect = alps_reconnect; |
456 | psmouse->pktsize = 6; | 491 | psmouse->pktsize = 6; |
457 | 492 | ||
493 | /* We are having trouble resyncing ALPS touchpads so disable it for now */ | ||
494 | psmouse->resync_time = 0; | ||
495 | |||
458 | return 0; | 496 | return 0; |
459 | 497 | ||
460 | init_fail: | 498 | init_fail: |