diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-12-10 09:19:18 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-12-10 09:19:18 -0500 |
commit | 2ade0c1d9d93b7642212657ef76f4a1e30233711 (patch) | |
tree | 63bc720c0ffe5f4760cac4ed617b9870b050175e /drivers/input/mouse | |
parent | 504499f22c08a03e2e19dc88d31aa0ecd2ac815e (diff) | |
parent | 6313e3c21743cc88bb5bd8aa72948ee1e83937b6 (diff) |
Merge branch 'master' into upstream
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/appletouch.c | 2 | ||||
-rw-r--r-- | drivers/input/mouse/elantech.c | 2 | ||||
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 4 | ||||
-rw-r--r-- | drivers/input/mouse/synaptics.c | 38 | ||||
-rw-r--r-- | drivers/input/mouse/synaptics.h | 5 | ||||
-rw-r--r-- | drivers/input/mouse/trackpoint.c | 2 |
6 files changed, 40 insertions, 13 deletions
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index a9cf76831634..b77f9991278e 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c | |||
@@ -630,7 +630,7 @@ static void atp_complete_geyser_3_4(struct urb *urb) | |||
630 | /* Just update the base values (i.e. touchpad in untouched state) */ | 630 | /* Just update the base values (i.e. touchpad in untouched state) */ |
631 | if (dev->data[dev->info->datalen - 1] & ATP_STATUS_BASE_UPDATE) { | 631 | if (dev->data[dev->info->datalen - 1] & ATP_STATUS_BASE_UPDATE) { |
632 | 632 | ||
633 | dprintk(KERN_DEBUG "appletouch: updated base values\n"); | 633 | dprintk("appletouch: updated base values\n"); |
634 | 634 | ||
635 | memcpy(dev->xy_old, dev->xy_cur, sizeof(dev->xy_old)); | 635 | memcpy(dev->xy_old, dev->xy_cur, sizeof(dev->xy_old)); |
636 | goto exit; | 636 | goto exit; |
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 48311204ba51..04d9bf320a4f 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
@@ -699,7 +699,7 @@ int elantech_init(struct psmouse *psmouse) | |||
699 | 699 | ||
700 | psmouse->private = etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL); | 700 | psmouse->private = etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL); |
701 | if (!etd) | 701 | if (!etd) |
702 | return -1; | 702 | return -ENOMEM; |
703 | 703 | ||
704 | etd->parity[0] = 1; | 704 | etd->parity[0] = 1; |
705 | for (i = 1; i < 256; i++) | 705 | for (i = 1; i < 256; i++) |
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 73a7af2542a8..cd9d0c97e429 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -1584,10 +1584,10 @@ static ssize_t psmouse_attr_set_protocol(struct psmouse *psmouse, void *data, co | |||
1584 | if (!new_dev) | 1584 | if (!new_dev) |
1585 | return -ENOMEM; | 1585 | return -ENOMEM; |
1586 | 1586 | ||
1587 | while (serio->child) { | 1587 | while (!list_empty(&serio->children)) { |
1588 | if (++retry > 3) { | 1588 | if (++retry > 3) { |
1589 | printk(KERN_WARNING | 1589 | printk(KERN_WARNING |
1590 | "psmouse: failed to destroy child port, " | 1590 | "psmouse: failed to destroy children ports, " |
1591 | "protocol change aborted.\n"); | 1591 | "protocol change aborted.\n"); |
1592 | input_free_device(new_dev); | 1592 | input_free_device(new_dev); |
1593 | return -EIO; | 1593 | return -EIO; |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 96b70a43515f..2e300a460556 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -294,7 +294,29 @@ static int synaptics_pt_write(struct serio *serio, unsigned char c) | |||
294 | return 0; | 294 | return 0; |
295 | } | 295 | } |
296 | 296 | ||
297 | static inline int synaptics_is_pt_packet(unsigned char *buf) | 297 | static int synaptics_pt_start(struct serio *serio) |
298 | { | ||
299 | struct psmouse *parent = serio_get_drvdata(serio->parent); | ||
300 | struct synaptics_data *priv = parent->private; | ||
301 | |||
302 | serio_pause_rx(parent->ps2dev.serio); | ||
303 | priv->pt_port = serio; | ||
304 | serio_continue_rx(parent->ps2dev.serio); | ||
305 | |||
306 | return 0; | ||
307 | } | ||
308 | |||
309 | static void synaptics_pt_stop(struct serio *serio) | ||
310 | { | ||
311 | struct psmouse *parent = serio_get_drvdata(serio->parent); | ||
312 | struct synaptics_data *priv = parent->private; | ||
313 | |||
314 | serio_pause_rx(parent->ps2dev.serio); | ||
315 | priv->pt_port = NULL; | ||
316 | serio_continue_rx(parent->ps2dev.serio); | ||
317 | } | ||
318 | |||
319 | static int synaptics_is_pt_packet(unsigned char *buf) | ||
298 | { | 320 | { |
299 | return (buf[0] & 0xFC) == 0x84 && (buf[3] & 0xCC) == 0xC4; | 321 | return (buf[0] & 0xFC) == 0x84 && (buf[3] & 0xCC) == 0xC4; |
300 | } | 322 | } |
@@ -315,9 +337,8 @@ static void synaptics_pass_pt_packet(struct serio *ptport, unsigned char *packet | |||
315 | 337 | ||
316 | static void synaptics_pt_activate(struct psmouse *psmouse) | 338 | static void synaptics_pt_activate(struct psmouse *psmouse) |
317 | { | 339 | { |
318 | struct serio *ptport = psmouse->ps2dev.serio->child; | ||
319 | struct psmouse *child = serio_get_drvdata(ptport); | ||
320 | struct synaptics_data *priv = psmouse->private; | 340 | struct synaptics_data *priv = psmouse->private; |
341 | struct psmouse *child = serio_get_drvdata(priv->pt_port); | ||
321 | 342 | ||
322 | /* adjust the touchpad to child's choice of protocol */ | 343 | /* adjust the touchpad to child's choice of protocol */ |
323 | if (child) { | 344 | if (child) { |
@@ -345,6 +366,8 @@ static void synaptics_pt_create(struct psmouse *psmouse) | |||
345 | strlcpy(serio->name, "Synaptics pass-through", sizeof(serio->name)); | 366 | strlcpy(serio->name, "Synaptics pass-through", sizeof(serio->name)); |
346 | strlcpy(serio->phys, "synaptics-pt/serio0", sizeof(serio->name)); | 367 | strlcpy(serio->phys, "synaptics-pt/serio0", sizeof(serio->name)); |
347 | serio->write = synaptics_pt_write; | 368 | serio->write = synaptics_pt_write; |
369 | serio->start = synaptics_pt_start; | ||
370 | serio->stop = synaptics_pt_stop; | ||
348 | serio->parent = psmouse->ps2dev.serio; | 371 | serio->parent = psmouse->ps2dev.serio; |
349 | 372 | ||
350 | psmouse->pt_activate = synaptics_pt_activate; | 373 | psmouse->pt_activate = synaptics_pt_activate; |
@@ -578,9 +601,10 @@ static psmouse_ret_t synaptics_process_byte(struct psmouse *psmouse) | |||
578 | if (unlikely(priv->pkt_type == SYN_NEWABS)) | 601 | if (unlikely(priv->pkt_type == SYN_NEWABS)) |
579 | priv->pkt_type = synaptics_detect_pkt_type(psmouse); | 602 | priv->pkt_type = synaptics_detect_pkt_type(psmouse); |
580 | 603 | ||
581 | if (SYN_CAP_PASS_THROUGH(priv->capabilities) && synaptics_is_pt_packet(psmouse->packet)) { | 604 | if (SYN_CAP_PASS_THROUGH(priv->capabilities) && |
582 | if (psmouse->ps2dev.serio->child) | 605 | synaptics_is_pt_packet(psmouse->packet)) { |
583 | synaptics_pass_pt_packet(psmouse->ps2dev.serio->child, psmouse->packet); | 606 | if (priv->pt_port) |
607 | synaptics_pass_pt_packet(priv->pt_port, psmouse->packet); | ||
584 | } else | 608 | } else |
585 | synaptics_process_packet(psmouse); | 609 | synaptics_process_packet(psmouse); |
586 | 610 | ||
@@ -731,7 +755,7 @@ int synaptics_init(struct psmouse *psmouse) | |||
731 | 755 | ||
732 | psmouse->private = priv = kzalloc(sizeof(struct synaptics_data), GFP_KERNEL); | 756 | psmouse->private = priv = kzalloc(sizeof(struct synaptics_data), GFP_KERNEL); |
733 | if (!priv) | 757 | if (!priv) |
734 | return -1; | 758 | return -ENOMEM; |
735 | 759 | ||
736 | psmouse_reset(psmouse); | 760 | psmouse_reset(psmouse); |
737 | 761 | ||
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index b6aa7d20d8a3..0aefaa885871 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h | |||
@@ -51,7 +51,8 @@ | |||
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 | #define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100100) | 54 | #define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100000) /* 1-button ClickPad */ |
55 | #define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */ | ||
55 | #define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000) | 56 | #define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000) |
56 | 57 | ||
57 | /* synaptics modes query bits */ | 58 | /* synaptics modes query bits */ |
@@ -110,6 +111,8 @@ struct synaptics_data { | |||
110 | unsigned char pkt_type; /* packet type - old, new, etc */ | 111 | unsigned char pkt_type; /* packet type - old, new, etc */ |
111 | unsigned char mode; /* current mode byte */ | 112 | unsigned char mode; /* current mode byte */ |
112 | int scroll; | 113 | int scroll; |
114 | |||
115 | struct serio *pt_port; /* Pass-through serio port */ | ||
113 | }; | 116 | }; |
114 | 117 | ||
115 | void synaptics_module_init(void); | 118 | void synaptics_module_init(void); |
diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c index 0643e49ca603..54b2fa892e19 100644 --- a/drivers/input/mouse/trackpoint.c +++ b/drivers/input/mouse/trackpoint.c | |||
@@ -303,7 +303,7 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties) | |||
303 | 303 | ||
304 | psmouse->private = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL); | 304 | psmouse->private = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL); |
305 | if (!psmouse->private) | 305 | if (!psmouse->private) |
306 | return -1; | 306 | return -ENOMEM; |
307 | 307 | ||
308 | psmouse->vendor = "IBM"; | 308 | psmouse->vendor = "IBM"; |
309 | psmouse->name = "TrackPoint"; | 309 | psmouse->name = "TrackPoint"; |