aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/synaptics.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/mouse/synaptics.c')
-rw-r--r--drivers/input/mouse/synaptics.c38
1 files changed, 31 insertions, 7 deletions
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
297static inline int synaptics_is_pt_packet(unsigned char *buf) 297static 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
309static 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
319static 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
316static void synaptics_pt_activate(struct psmouse *psmouse) 338static 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