diff options
Diffstat (limited to 'drivers/input/mouse/alps.c')
-rw-r--r-- | drivers/input/mouse/alps.c | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 99d58764ef03..003587c71f43 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
@@ -23,13 +23,6 @@ | |||
23 | #include "psmouse.h" | 23 | #include "psmouse.h" |
24 | #include "alps.h" | 24 | #include "alps.h" |
25 | 25 | ||
26 | #undef DEBUG | ||
27 | #ifdef DEBUG | ||
28 | #define dbg(format, arg...) printk(KERN_INFO "alps.c: " format "\n", ## arg) | ||
29 | #else | ||
30 | #define dbg(format, arg...) do {} while (0) | ||
31 | #endif | ||
32 | |||
33 | #define ALPS_OLDPROTO 0x01 /* old style input */ | 26 | #define ALPS_OLDPROTO 0x01 /* old style input */ |
34 | #define ALPS_DUALPOINT 0x02 /* touchpad has trackstick */ | 27 | #define ALPS_DUALPOINT 0x02 /* touchpad has trackstick */ |
35 | #define ALPS_PASS 0x04 /* device has a pass-through port */ | 28 | #define ALPS_PASS 0x04 /* device has a pass-through port */ |
@@ -297,10 +290,10 @@ static psmouse_ret_t alps_handle_interleaved_ps2(struct psmouse *psmouse) | |||
297 | psmouse->packet[4] | | 290 | psmouse->packet[4] | |
298 | psmouse->packet[5]) & 0x80) || | 291 | psmouse->packet[5]) & 0x80) || |
299 | (!alps_is_valid_first_byte(priv->i, psmouse->packet[6]))) { | 292 | (!alps_is_valid_first_byte(priv->i, psmouse->packet[6]))) { |
300 | dbg("refusing packet %x %x %x %x " | 293 | psmouse_dbg(psmouse, |
301 | "(suspected interleaved ps/2)\n", | 294 | "refusing packet %x %x %x %x (suspected interleaved ps/2)\n", |
302 | psmouse->packet[3], psmouse->packet[4], | 295 | psmouse->packet[3], psmouse->packet[4], |
303 | psmouse->packet[5], psmouse->packet[6]); | 296 | psmouse->packet[5], psmouse->packet[6]); |
304 | return PSMOUSE_BAD_DATA; | 297 | return PSMOUSE_BAD_DATA; |
305 | } | 298 | } |
306 | 299 | ||
@@ -319,13 +312,13 @@ static psmouse_ret_t alps_handle_interleaved_ps2(struct psmouse *psmouse) | |||
319 | * There is also possibility that we got 6-byte ALPS | 312 | * There is also possibility that we got 6-byte ALPS |
320 | * packet followed by 3-byte packet from trackpoint. We | 313 | * packet followed by 3-byte packet from trackpoint. We |
321 | * can not distinguish between these 2 scenarios but | 314 | * can not distinguish between these 2 scenarios but |
322 | * becase the latter is unlikely to happen in course of | 315 | * because the latter is unlikely to happen in course of |
323 | * normal operation (user would need to press all | 316 | * normal operation (user would need to press all |
324 | * buttons on the pad and start moving trackpoint | 317 | * buttons on the pad and start moving trackpoint |
325 | * without touching the pad surface) we assume former. | 318 | * without touching the pad surface) we assume former. |
326 | * Even if we are wrong the wost thing that would happen | 319 | * Even if we are wrong the wost thing that would happen |
327 | * the cursor would jump but we should not get protocol | 320 | * the cursor would jump but we should not get protocol |
328 | * desynchronization. | 321 | * de-synchronization. |
329 | */ | 322 | */ |
330 | 323 | ||
331 | alps_report_bare_ps2_packet(psmouse, &psmouse->packet[3], | 324 | alps_report_bare_ps2_packet(psmouse, &psmouse->packet[3], |
@@ -361,10 +354,10 @@ static void alps_flush_packet(unsigned long data) | |||
361 | if ((psmouse->packet[3] | | 354 | if ((psmouse->packet[3] | |
362 | psmouse->packet[4] | | 355 | psmouse->packet[4] | |
363 | psmouse->packet[5]) & 0x80) { | 356 | psmouse->packet[5]) & 0x80) { |
364 | dbg("refusing packet %x %x %x " | 357 | psmouse_dbg(psmouse, |
365 | "(suspected interleaved ps/2)\n", | 358 | "refusing packet %x %x %x (suspected interleaved ps/2)\n", |
366 | psmouse->packet[3], psmouse->packet[4], | 359 | psmouse->packet[3], psmouse->packet[4], |
367 | psmouse->packet[5]); | 360 | psmouse->packet[5]); |
368 | } else { | 361 | } else { |
369 | alps_process_packet(psmouse); | 362 | alps_process_packet(psmouse); |
370 | } | 363 | } |
@@ -396,16 +389,18 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse) | |||
396 | } | 389 | } |
397 | 390 | ||
398 | if (!alps_is_valid_first_byte(model, psmouse->packet[0])) { | 391 | if (!alps_is_valid_first_byte(model, psmouse->packet[0])) { |
399 | dbg("refusing packet[0] = %x (mask0 = %x, byte0 = %x)\n", | 392 | psmouse_dbg(psmouse, |
400 | psmouse->packet[0], model->mask0, model->byte0); | 393 | "refusing packet[0] = %x (mask0 = %x, byte0 = %x)\n", |
394 | psmouse->packet[0], model->mask0, model->byte0); | ||
401 | return PSMOUSE_BAD_DATA; | 395 | return PSMOUSE_BAD_DATA; |
402 | } | 396 | } |
403 | 397 | ||
404 | /* Bytes 2 - 6 should have 0 in the highest bit */ | 398 | /* Bytes 2 - 6 should have 0 in the highest bit */ |
405 | if (psmouse->pktcnt >= 2 && psmouse->pktcnt <= 6 && | 399 | if (psmouse->pktcnt >= 2 && psmouse->pktcnt <= 6 && |
406 | (psmouse->packet[psmouse->pktcnt - 1] & 0x80)) { | 400 | (psmouse->packet[psmouse->pktcnt - 1] & 0x80)) { |
407 | dbg("refusing packet[%i] = %x\n", | 401 | psmouse_dbg(psmouse, "refusing packet[%i] = %x\n", |
408 | psmouse->pktcnt - 1, psmouse->packet[psmouse->pktcnt - 1]); | 402 | psmouse->pktcnt - 1, |
403 | psmouse->packet[psmouse->pktcnt - 1]); | ||
409 | return PSMOUSE_BAD_DATA; | 404 | return PSMOUSE_BAD_DATA; |
410 | } | 405 | } |
411 | 406 | ||
@@ -439,7 +434,8 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int | |||
439 | if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) | 434 | if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) |
440 | return NULL; | 435 | return NULL; |
441 | 436 | ||
442 | dbg("E6 report: %2.2x %2.2x %2.2x", param[0], param[1], param[2]); | 437 | psmouse_dbg(psmouse, "E6 report: %2.2x %2.2x %2.2x", |
438 | param[0], param[1], param[2]); | ||
443 | 439 | ||
444 | if (param[0] != 0 || param[1] != 0 || (param[2] != 10 && param[2] != 100)) | 440 | if (param[0] != 0 || param[1] != 0 || (param[2] != 10 && param[2] != 100)) |
445 | return NULL; | 441 | return NULL; |
@@ -459,7 +455,8 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int | |||
459 | if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) | 455 | if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) |
460 | return NULL; | 456 | return NULL; |
461 | 457 | ||
462 | dbg("E7 report: %2.2x %2.2x %2.2x", param[0], param[1], param[2]); | 458 | psmouse_dbg(psmouse, "E7 report: %2.2x %2.2x %2.2x", |
459 | param[0], param[1], param[2]); | ||
463 | 460 | ||
464 | if (version) { | 461 | if (version) { |
465 | for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++) | 462 | for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++) |
@@ -527,7 +524,8 @@ static int alps_get_status(struct psmouse *psmouse, char *param) | |||
527 | ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) | 524 | ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) |
528 | return -1; | 525 | return -1; |
529 | 526 | ||
530 | dbg("Status: %2.2x %2.2x %2.2x", param[0], param[1], param[2]); | 527 | psmouse_dbg(psmouse, "Status: %2.2x %2.2x %2.2x", |
528 | param[0], param[1], param[2]); | ||
531 | 529 | ||
532 | return 0; | 530 | return 0; |
533 | } | 531 | } |
@@ -605,12 +603,12 @@ static int alps_hw_init(struct psmouse *psmouse) | |||
605 | } | 603 | } |
606 | 604 | ||
607 | if (alps_tap_mode(psmouse, true)) { | 605 | if (alps_tap_mode(psmouse, true)) { |
608 | printk(KERN_WARNING "alps.c: Failed to enable hardware tapping\n"); | 606 | psmouse_warn(psmouse, "Failed to enable hardware tapping\n"); |
609 | return -1; | 607 | return -1; |
610 | } | 608 | } |
611 | 609 | ||
612 | if (alps_absolute_mode(psmouse)) { | 610 | if (alps_absolute_mode(psmouse)) { |
613 | printk(KERN_ERR "alps.c: Failed to enable absolute mode\n"); | 611 | psmouse_err(psmouse, "Failed to enable absolute mode\n"); |
614 | return -1; | 612 | return -1; |
615 | } | 613 | } |
616 | 614 | ||
@@ -621,7 +619,7 @@ static int alps_hw_init(struct psmouse *psmouse) | |||
621 | 619 | ||
622 | /* ALPS needs stream mode, otherwise it won't report any data */ | 620 | /* ALPS needs stream mode, otherwise it won't report any data */ |
623 | if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_SETSTREAM)) { | 621 | if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_SETSTREAM)) { |
624 | printk(KERN_ERR "alps.c: Failed to enable stream mode\n"); | 622 | psmouse_err(psmouse, "Failed to enable stream mode\n"); |
625 | return -1; | 623 | return -1; |
626 | } | 624 | } |
627 | 625 | ||