aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r--drivers/input/mouse/Kconfig10
-rw-r--r--drivers/input/mouse/bcm5974.c30
-rw-r--r--drivers/input/mouse/synaptics.c36
-rw-r--r--drivers/input/mouse/synaptics.h23
-rw-r--r--drivers/input/mouse/synaptics_i2c.c18
-rw-r--r--drivers/input/mouse/vsxxxaa.c2
6 files changed, 90 insertions, 29 deletions
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig
index bf5fd7f6a313..9c1e6ee83531 100644
--- a/drivers/input/mouse/Kconfig
+++ b/drivers/input/mouse/Kconfig
@@ -39,7 +39,7 @@ config MOUSE_PS2
39 module will be called psmouse. 39 module will be called psmouse.
40 40
41config MOUSE_PS2_ALPS 41config MOUSE_PS2_ALPS
42 bool "ALPS PS/2 mouse protocol extension" if EMBEDDED 42 bool "ALPS PS/2 mouse protocol extension" if EXPERT
43 default y 43 default y
44 depends on MOUSE_PS2 44 depends on MOUSE_PS2
45 help 45 help
@@ -49,7 +49,7 @@ config MOUSE_PS2_ALPS
49 If unsure, say Y. 49 If unsure, say Y.
50 50
51config MOUSE_PS2_LOGIPS2PP 51config MOUSE_PS2_LOGIPS2PP
52 bool "Logitech PS/2++ mouse protocol extension" if EMBEDDED 52 bool "Logitech PS/2++ mouse protocol extension" if EXPERT
53 default y 53 default y
54 depends on MOUSE_PS2 54 depends on MOUSE_PS2
55 help 55 help
@@ -59,7 +59,7 @@ config MOUSE_PS2_LOGIPS2PP
59 If unsure, say Y. 59 If unsure, say Y.
60 60
61config MOUSE_PS2_SYNAPTICS 61config MOUSE_PS2_SYNAPTICS
62 bool "Synaptics PS/2 mouse protocol extension" if EMBEDDED 62 bool "Synaptics PS/2 mouse protocol extension" if EXPERT
63 default y 63 default y
64 depends on MOUSE_PS2 64 depends on MOUSE_PS2
65 help 65 help
@@ -69,7 +69,7 @@ config MOUSE_PS2_SYNAPTICS
69 If unsure, say Y. 69 If unsure, say Y.
70 70
71config MOUSE_PS2_LIFEBOOK 71config MOUSE_PS2_LIFEBOOK
72 bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EMBEDDED 72 bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EXPERT
73 default y 73 default y
74 depends on MOUSE_PS2 && X86 && DMI 74 depends on MOUSE_PS2 && X86 && DMI
75 help 75 help
@@ -79,7 +79,7 @@ config MOUSE_PS2_LIFEBOOK
79 If unsure, say Y. 79 If unsure, say Y.
80 80
81config MOUSE_PS2_TRACKPOINT 81config MOUSE_PS2_TRACKPOINT
82 bool "IBM Trackpoint PS/2 mouse protocol extension" if EMBEDDED 82 bool "IBM Trackpoint PS/2 mouse protocol extension" if EXPERT
83 default y 83 default y
84 depends on MOUSE_PS2 84 depends on MOUSE_PS2
85 help 85 help
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index ee82851afe3e..3126983c004a 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -63,6 +63,10 @@
63#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI 0x0242 63#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI 0x0242
64#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO 0x0243 64#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO 0x0243
65#define USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS 0x0244 65#define USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS 0x0244
66/* Macbook8 (unibody, March 2011) */
67#define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI 0x0245
68#define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO 0x0246
69#define USB_DEVICE_ID_APPLE_WELLSPRING5_JIS 0x0247
66 70
67#define BCM5974_DEVICE(prod) { \ 71#define BCM5974_DEVICE(prod) { \
68 .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \ 72 .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \
@@ -96,6 +100,10 @@ static const struct usb_device_id bcm5974_table[] = {
96 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI), 100 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI),
97 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO), 101 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO),
98 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS), 102 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS),
103 /* MacbookPro8 */
104 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI),
105 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_ISO),
106 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_JIS),
99 /* Terminating entry */ 107 /* Terminating entry */
100 {} 108 {}
101}; 109};
@@ -274,6 +282,18 @@ static const struct bcm5974_config bcm5974_config_table[] = {
274 { DIM_X, DIM_X / SN_COORD, -4616, 5112 }, 282 { DIM_X, DIM_X / SN_COORD, -4616, 5112 },
275 { DIM_Y, DIM_Y / SN_COORD, -142, 5234 } 283 { DIM_Y, DIM_Y / SN_COORD, -142, 5234 }
276 }, 284 },
285 {
286 USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI,
287 USB_DEVICE_ID_APPLE_WELLSPRING5_ISO,
288 USB_DEVICE_ID_APPLE_WELLSPRING5_JIS,
289 HAS_INTEGRATED_BUTTON,
290 0x84, sizeof(struct bt_data),
291 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
292 { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 },
293 { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 },
294 { DIM_X, DIM_X / SN_COORD, -4415, 5050 },
295 { DIM_Y, DIM_Y / SN_COORD, -55, 6680 }
296 },
277 {} 297 {}
278}; 298};
279 299
@@ -430,10 +450,6 @@ static int report_tp_state(struct bcm5974 *dev, int size)
430 ptest = int2bound(&c->p, raw_p); 450 ptest = int2bound(&c->p, raw_p);
431 origin = raw2int(f->origin); 451 origin = raw2int(f->origin);
432 452
433 /* set the integrated button if applicable */
434 if (c->tp_type == TYPE2)
435 ibt = raw2int(dev->tp_data[BUTTON_TYPE2]);
436
437 /* while tracking finger still valid, count all fingers */ 453 /* while tracking finger still valid, count all fingers */
438 if (ptest > PRESSURE_LOW && origin) { 454 if (ptest > PRESSURE_LOW && origin) {
439 abs_p = ptest; 455 abs_p = ptest;
@@ -452,6 +468,10 @@ static int report_tp_state(struct bcm5974 *dev, int size)
452 } 468 }
453 } 469 }
454 470
471 /* set the integrated button if applicable */
472 if (c->tp_type == TYPE2)
473 ibt = raw2int(dev->tp_data[BUTTON_TYPE2]);
474
455 if (dev->fingers < nmin) 475 if (dev->fingers < nmin)
456 dev->fingers = nmin; 476 dev->fingers = nmin;
457 if (dev->fingers > nmax) 477 if (dev->fingers > nmax)
@@ -619,7 +639,7 @@ exit:
619 * device, resulting in trackpad malfunction under certain 639 * device, resulting in trackpad malfunction under certain
620 * circumstances. To get around this problem, there is at least one 640 * circumstances. To get around this problem, there is at least one
621 * example that utilizes the USB_QUIRK_RESET_RESUME quirk in order to 641 * example that utilizes the USB_QUIRK_RESET_RESUME quirk in order to
622 * recieve a reset_resume request rather than the normal resume. 642 * receive a reset_resume request rather than the normal resume.
623 * Since the implementation of reset_resume is equal to mode switch 643 * Since the implementation of reset_resume is equal to mode switch
624 * plus start_traffic, it seems easier to always do the switch when 644 * plus start_traffic, it seems easier to always do the switch when
625 * starting traffic on the device. 645 * starting traffic on the device.
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index da392c22fc6c..e06e045bf907 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -755,23 +755,26 @@ static int synaptics_reconnect(struct psmouse *psmouse)
755{ 755{
756 struct synaptics_data *priv = psmouse->private; 756 struct synaptics_data *priv = psmouse->private;
757 struct synaptics_data old_priv = *priv; 757 struct synaptics_data old_priv = *priv;
758 int retry = 0;
759 int error;
758 760
759 psmouse_reset(psmouse); 761 do {
762 psmouse_reset(psmouse);
763 error = synaptics_detect(psmouse, 0);
764 } while (error && ++retry < 3);
760 765
761 if (synaptics_detect(psmouse, 0)) 766 if (error)
762 return -1; 767 return -1;
763 768
769 if (retry > 1)
770 printk(KERN_DEBUG "Synaptics reconnected after %d tries\n",
771 retry);
772
764 if (synaptics_query_hardware(psmouse)) { 773 if (synaptics_query_hardware(psmouse)) {
765 printk(KERN_ERR "Unable to query Synaptics hardware.\n"); 774 printk(KERN_ERR "Unable to query Synaptics hardware.\n");
766 return -1; 775 return -1;
767 } 776 }
768 777
769 if (old_priv.identity != priv->identity ||
770 old_priv.model_id != priv->model_id ||
771 old_priv.capabilities != priv->capabilities ||
772 old_priv.ext_cap != priv->ext_cap)
773 return -1;
774
775 if (synaptics_set_absolute_mode(psmouse)) { 778 if (synaptics_set_absolute_mode(psmouse)) {
776 printk(KERN_ERR "Unable to initialize Synaptics hardware.\n"); 779 printk(KERN_ERR "Unable to initialize Synaptics hardware.\n");
777 return -1; 780 return -1;
@@ -782,6 +785,19 @@ static int synaptics_reconnect(struct psmouse *psmouse)
782 return -1; 785 return -1;
783 } 786 }
784 787
788 if (old_priv.identity != priv->identity ||
789 old_priv.model_id != priv->model_id ||
790 old_priv.capabilities != priv->capabilities ||
791 old_priv.ext_cap != priv->ext_cap) {
792 printk(KERN_ERR "Synaptics hardware appears to be different: "
793 "id(%ld-%ld), model(%ld-%ld), caps(%lx-%lx), ext(%lx-%lx).\n",
794 old_priv.identity, priv->identity,
795 old_priv.model_id, priv->model_id,
796 old_priv.capabilities, priv->capabilities,
797 old_priv.ext_cap, priv->ext_cap);
798 return -1;
799 }
800
785 return 0; 801 return 0;
786} 802}
787 803
@@ -820,8 +836,8 @@ static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
820 }, 836 },
821 837
822 }, 838 },
823 { }
824#endif 839#endif
840 { }
825}; 841};
826 842
827static bool broken_olpc_ec; 843static bool broken_olpc_ec;
@@ -835,8 +851,8 @@ static const struct dmi_system_id __initconst olpc_dmi_table[] = {
835 DMI_MATCH(DMI_PRODUCT_NAME, "XO"), 851 DMI_MATCH(DMI_PRODUCT_NAME, "XO"),
836 }, 852 },
837 }, 853 },
838 { }
839#endif 854#endif
855 { }
840}; 856};
841 857
842void __init synaptics_module_init(void) 858void __init synaptics_module_init(void)
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
index 25e5d042a72c..7453938bf5ef 100644
--- a/drivers/input/mouse/synaptics.h
+++ b/drivers/input/mouse/synaptics.h
@@ -51,6 +51,29 @@
51#define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20) 51#define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20)
52#define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12) 52#define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12)
53#define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16) 53#define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16)
54
55/*
56 * The following describes response for the 0x0c query.
57 *
58 * byte mask name meaning
59 * ---- ---- ------- ------------
60 * 1 0x01 adjustable threshold capacitive button sensitivity
61 * can be adjusted
62 * 1 0x02 report max query 0x0d gives max coord reported
63 * 1 0x04 clearpad sensor is ClearPad product
64 * 1 0x08 advanced gesture not particularly meaningful
65 * 1 0x10 clickpad bit 0 1-button ClickPad
66 * 1 0x60 multifinger mode identifies firmware finger counting
67 * (not reporting!) algorithm.
68 * Not particularly meaningful
69 * 1 0x80 covered pad W clipped to 14, 15 == pad mostly covered
70 * 2 0x01 clickpad bit 1 2-button ClickPad
71 * 2 0x02 deluxe LED controls touchpad support LED commands
72 * ala multimedia control bar
73 * 2 0x04 reduced filtering firmware does less filtering on
74 * position data, driver should watch
75 * for noise.
76 */
54#define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100000) /* 1-button ClickPad */ 77#define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100000) /* 1-button ClickPad */
55#define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */ 78#define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */
56#define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000) 79#define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000)
diff --git a/drivers/input/mouse/synaptics_i2c.c b/drivers/input/mouse/synaptics_i2c.c
index 0ae62f0bcb32..cba3c84d2f21 100644
--- a/drivers/input/mouse/synaptics_i2c.c
+++ b/drivers/input/mouse/synaptics_i2c.c
@@ -18,6 +18,7 @@
18#include <linux/delay.h> 18#include <linux/delay.h>
19#include <linux/workqueue.h> 19#include <linux/workqueue.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/pm.h>
21 22
22#define DRIVER_NAME "synaptics_i2c" 23#define DRIVER_NAME "synaptics_i2c"
23/* maximum product id is 15 characters */ 24/* maximum product id is 15 characters */
@@ -461,7 +462,7 @@ static void synaptics_i2c_work_handler(struct work_struct *work)
461 * While interrupt driven, there is no real need to poll the device. 462 * While interrupt driven, there is no real need to poll the device.
462 * But touchpads are very sensitive, so there could be errors 463 * But touchpads are very sensitive, so there could be errors
463 * related to physical environment and the attention line isn't 464 * related to physical environment and the attention line isn't
464 * neccesarily asserted. In such case we can lose the touchpad. 465 * necessarily asserted. In such case we can lose the touchpad.
465 * We poll the device once in THREAD_IRQ_SLEEP_SECS and 466 * We poll the device once in THREAD_IRQ_SLEEP_SECS and
466 * if error is detected, we try to reset and reconfigure the touchpad. 467 * if error is detected, we try to reset and reconfigure the touchpad.
467 */ 468 */
@@ -619,8 +620,9 @@ static int __devexit synaptics_i2c_remove(struct i2c_client *client)
619} 620}
620 621
621#ifdef CONFIG_PM 622#ifdef CONFIG_PM
622static int synaptics_i2c_suspend(struct i2c_client *client, pm_message_t mesg) 623static int synaptics_i2c_suspend(struct device *dev)
623{ 624{
625 struct i2c_client *client = to_i2c_client(dev);
624 struct synaptics_i2c *touch = i2c_get_clientdata(client); 626 struct synaptics_i2c *touch = i2c_get_clientdata(client);
625 627
626 cancel_delayed_work_sync(&touch->dwork); 628 cancel_delayed_work_sync(&touch->dwork);
@@ -631,9 +633,10 @@ static int synaptics_i2c_suspend(struct i2c_client *client, pm_message_t mesg)
631 return 0; 633 return 0;
632} 634}
633 635
634static int synaptics_i2c_resume(struct i2c_client *client) 636static int synaptics_i2c_resume(struct device *dev)
635{ 637{
636 int ret; 638 int ret;
639 struct i2c_client *client = to_i2c_client(dev);
637 struct synaptics_i2c *touch = i2c_get_clientdata(client); 640 struct synaptics_i2c *touch = i2c_get_clientdata(client);
638 641
639 ret = synaptics_i2c_reset_config(client); 642 ret = synaptics_i2c_reset_config(client);
@@ -645,11 +648,11 @@ static int synaptics_i2c_resume(struct i2c_client *client)
645 648
646 return 0; 649 return 0;
647} 650}
648#else
649#define synaptics_i2c_suspend NULL
650#define synaptics_i2c_resume NULL
651#endif 651#endif
652 652
653static SIMPLE_DEV_PM_OPS(synaptics_i2c_pm, synaptics_i2c_suspend,
654 synaptics_i2c_resume);
655
653static const struct i2c_device_id synaptics_i2c_id_table[] = { 656static const struct i2c_device_id synaptics_i2c_id_table[] = {
654 { "synaptics_i2c", 0 }, 657 { "synaptics_i2c", 0 },
655 { }, 658 { },
@@ -660,13 +663,12 @@ static struct i2c_driver synaptics_i2c_driver = {
660 .driver = { 663 .driver = {
661 .name = DRIVER_NAME, 664 .name = DRIVER_NAME,
662 .owner = THIS_MODULE, 665 .owner = THIS_MODULE,
666 .pm = &synaptics_i2c_pm,
663 }, 667 },
664 668
665 .probe = synaptics_i2c_probe, 669 .probe = synaptics_i2c_probe,
666 .remove = __devexit_p(synaptics_i2c_remove), 670 .remove = __devexit_p(synaptics_i2c_remove),
667 671
668 .suspend = synaptics_i2c_suspend,
669 .resume = synaptics_i2c_resume,
670 .id_table = synaptics_i2c_id_table, 672 .id_table = synaptics_i2c_id_table,
671}; 673};
672 674
diff --git a/drivers/input/mouse/vsxxxaa.c b/drivers/input/mouse/vsxxxaa.c
index bf2c0c80d6cc..eb9a3cfbeefa 100644
--- a/drivers/input/mouse/vsxxxaa.c
+++ b/drivers/input/mouse/vsxxxaa.c
@@ -334,7 +334,7 @@ static void vsxxxaa_handle_POR_packet(struct vsxxxaa *mouse)
334 * M: manufacturer location code 334 * M: manufacturer location code
335 * R: revision code 335 * R: revision code
336 * E: Error code. If it's in the range of 0x00..0x1f, only some 336 * E: Error code. If it's in the range of 0x00..0x1f, only some
337 * minor problem occured. Errors >= 0x20 are considered bad 337 * minor problem occurred. Errors >= 0x20 are considered bad
338 * and the device may not work properly... 338 * and the device may not work properly...
339 * D: <0010> == mouse, <0100> == tablet 339 * D: <0010> == mouse, <0100> == tablet
340 */ 340 */