aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-23 11:11:43 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-23 11:11:43 -0400
commit31f6e1bd3b58c9a67e5ea0c2d372fbf5fc9e326d (patch)
treeb0f75a9353f2e9a82c6839a4f507eeb40ffc5fc5 /drivers/input/mouse
parentad9ddd66c6e8a79630a975ff0bb8d45a11abe630 (diff)
parent230ffc8e348e7841b79fd7c659d16aa5d7ec8a69 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: ads7846 - SPI_CPHA mode bugfix Input: ads7846 - document that it handles tsc2046 too Input: input-polldev - add module info Input: ucb1x00-ts - remove commented out code Input: ucb1400_ts - use sched_setscheduler() Input: ALPS - force stream mode Input: iforce - minor clean-ups Input: iforce - fix force feedback not working Input: adbhid - do not access input_dev->private directly Input: logips2pp - add type 72 (PS/2 TrackMan Marble)
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r--drivers/input/mouse/alps.c58
-rw-r--r--drivers/input/mouse/logips2pp.c1
2 files changed, 32 insertions, 27 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index cf3e4664e72b..2c5f11a4f6b4 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -251,11 +251,15 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
251 251
252 dbg("E7 report: %2.2x %2.2x %2.2x", param[0], param[1], param[2]); 252 dbg("E7 report: %2.2x %2.2x %2.2x", param[0], param[1], param[2]);
253 253
254 for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++); 254 if (version) {
255 *version = (param[0] << 8) | (param[1] << 4) | i; 255 for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++)
256 /* empty */;
257 *version = (param[0] << 8) | (param[1] << 4) | i;
258 }
256 259
257 for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) 260 for (i = 0; i < ARRAY_SIZE(alps_model_data); i++)
258 if (!memcmp(param, alps_model_data[i].signature, sizeof(alps_model_data[i].signature))) 261 if (!memcmp(param, alps_model_data[i].signature,
262 sizeof(alps_model_data[i].signature)))
259 return alps_model_data + i; 263 return alps_model_data + i;
260 264
261 return NULL; 265 return NULL;
@@ -380,32 +384,46 @@ static int alps_poll(struct psmouse *psmouse)
380 return 0; 384 return 0;
381} 385}
382 386
383static int alps_reconnect(struct psmouse *psmouse) 387static int alps_hw_init(struct psmouse *psmouse, int *version)
384{ 388{
385 struct alps_data *priv = psmouse->private; 389 struct alps_data *priv = psmouse->private;
386 int version;
387
388 psmouse_reset(psmouse);
389 390
390 if (!(priv->i = alps_get_model(psmouse, &version))) 391 priv->i = alps_get_model(psmouse, version);
392 if (!priv->i)
391 return -1; 393 return -1;
392 394
393 if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 1)) 395 if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 1))
394 return -1; 396 return -1;
395 397
396 if (alps_tap_mode(psmouse, 1)) { 398 if (alps_tap_mode(psmouse, 1)) {
397 printk(KERN_WARNING "alps.c: Failed to reenable hardware tapping\n"); 399 printk(KERN_WARNING "alps.c: Failed to enable hardware tapping\n");
398 return -1; 400 return -1;
399 } 401 }
400 402
401 if (alps_absolute_mode(psmouse)) { 403 if (alps_absolute_mode(psmouse)) {
402 printk(KERN_ERR "alps.c: Failed to reenable absolute mode\n"); 404 printk(KERN_ERR "alps.c: Failed to enable absolute mode\n");
403 return -1; 405 return -1;
404 } 406 }
405 407
406 if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 0)) 408 if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 0))
407 return -1; 409 return -1;
408 410
411 /* ALPS needs stream mode, otherwise it won't report any data */
412 if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_SETSTREAM)) {
413 printk(KERN_ERR "alps.c: Failed to enable stream mode\n");
414 return -1;
415 }
416
417 return 0;
418}
419
420static int alps_reconnect(struct psmouse *psmouse)
421{
422 psmouse_reset(psmouse);
423
424 if (alps_hw_init(psmouse, NULL))
425 return -1;
426
409 return 0; 427 return 0;
410} 428}
411 429
@@ -430,23 +448,9 @@ int alps_init(struct psmouse *psmouse)
430 goto init_fail; 448 goto init_fail;
431 449
432 priv->dev2 = dev2; 450 priv->dev2 = dev2;
451 psmouse->private = priv;
433 452
434 priv->i = alps_get_model(psmouse, &version); 453 if (alps_hw_init(psmouse, &version))
435 if (!priv->i)
436 goto init_fail;
437
438 if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 1))
439 goto init_fail;
440
441 if (alps_tap_mode(psmouse, 1))
442 printk(KERN_WARNING "alps.c: Failed to enable hardware tapping\n");
443
444 if (alps_absolute_mode(psmouse)) {
445 printk(KERN_ERR "alps.c: Failed to enable absolute mode\n");
446 goto init_fail;
447 }
448
449 if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 0))
450 goto init_fail; 454 goto init_fail;
451 455
452 dev1->evbit[LONG(EV_KEY)] |= BIT(EV_KEY); 456 dev1->evbit[LONG(EV_KEY)] |= BIT(EV_KEY);
@@ -493,13 +497,13 @@ int alps_init(struct psmouse *psmouse)
493 /* We are having trouble resyncing ALPS touchpads so disable it for now */ 497 /* We are having trouble resyncing ALPS touchpads so disable it for now */
494 psmouse->resync_time = 0; 498 psmouse->resync_time = 0;
495 499
496 psmouse->private = priv;
497 return 0; 500 return 0;
498 501
499init_fail: 502init_fail:
500 psmouse_reset(psmouse); 503 psmouse_reset(psmouse);
501 input_free_device(dev2); 504 input_free_device(dev2);
502 kfree(priv); 505 kfree(priv);
506 psmouse->private = NULL;
503 return -1; 507 return -1;
504} 508}
505 509
diff --git a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c
index 9df74b72e6c4..0c5660d28caa 100644
--- a/drivers/input/mouse/logips2pp.c
+++ b/drivers/input/mouse/logips2pp.c
@@ -221,6 +221,7 @@ static const struct ps2pp_info *get_model_info(unsigned char model)
221 { 66, PS2PP_KIND_MX, /* MX3100 reciver */ 221 { 66, PS2PP_KIND_MX, /* MX3100 reciver */
222 PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN | 222 PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
223 PS2PP_EXTRA_BTN | PS2PP_NAV_BTN | PS2PP_HWHEEL }, 223 PS2PP_EXTRA_BTN | PS2PP_NAV_BTN | PS2PP_HWHEEL },
224 { 72, PS2PP_KIND_TRACKMAN, 0 }, /* T-CH11: TrackMan Marble */
224 { 73, 0, PS2PP_SIDE_BTN }, 225 { 73, 0, PS2PP_SIDE_BTN },
225 { 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, 226 { 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL },
226 { 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, 227 { 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL },