diff options
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/alps.c | 2 | ||||
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 39 | ||||
-rw-r--r-- | drivers/input/mouse/sermouse.c | 2 | ||||
-rw-r--r-- | drivers/input/mouse/vsxxxaa.c | 22 |
4 files changed, 48 insertions, 17 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index a0e2e797c6d5..070d75330afd 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
@@ -470,7 +470,7 @@ int alps_init(struct psmouse *psmouse) | |||
470 | dev1->keybit[LONG(BTN_BACK)] |= BIT(BTN_BACK); | 470 | dev1->keybit[LONG(BTN_BACK)] |= BIT(BTN_BACK); |
471 | } | 471 | } |
472 | 472 | ||
473 | sprintf(priv->phys, "%s/input1", psmouse->ps2dev.serio->phys); | 473 | snprintf(priv->phys, sizeof(priv->phys), "%s/input1", psmouse->ps2dev.serio->phys); |
474 | dev2->phys = priv->phys; | 474 | dev2->phys = priv->phys; |
475 | dev2->name = (priv->i->flags & ALPS_DUALPOINT) ? "DualPoint Stick" : "PS/2 Mouse"; | 475 | dev2->name = (priv->i->flags & ALPS_DUALPOINT) ? "DualPoint Stick" : "PS/2 Mouse"; |
476 | dev2->id.bustype = BUS_I8042; | 476 | dev2->id.bustype = BUS_I8042; |
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 136321a2cfdb..8bc9f51ae6c2 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -150,9 +150,20 @@ static psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse, struct pt_reg | |||
150 | */ | 150 | */ |
151 | 151 | ||
152 | if (psmouse->type == PSMOUSE_IMEX) { | 152 | if (psmouse->type == PSMOUSE_IMEX) { |
153 | input_report_rel(dev, REL_WHEEL, (int) (packet[3] & 8) - (int) (packet[3] & 7)); | 153 | switch (packet[3] & 0xC0) { |
154 | input_report_key(dev, BTN_SIDE, (packet[3] >> 4) & 1); | 154 | case 0x80: /* vertical scroll on IntelliMouse Explorer 4.0 */ |
155 | input_report_key(dev, BTN_EXTRA, (packet[3] >> 5) & 1); | 155 | input_report_rel(dev, REL_WHEEL, (int) (packet[3] & 32) - (int) (packet[3] & 31)); |
156 | break; | ||
157 | case 0x40: /* horizontal scroll on IntelliMouse Explorer 4.0 */ | ||
158 | input_report_rel(dev, REL_HWHEEL, (int) (packet[3] & 32) - (int) (packet[3] & 31)); | ||
159 | break; | ||
160 | case 0x00: | ||
161 | case 0xC0: | ||
162 | input_report_rel(dev, REL_WHEEL, (int) (packet[3] & 8) - (int) (packet[3] & 7)); | ||
163 | input_report_key(dev, BTN_SIDE, (packet[3] >> 4) & 1); | ||
164 | input_report_key(dev, BTN_EXTRA, (packet[3] >> 5) & 1); | ||
165 | break; | ||
166 | } | ||
156 | } | 167 | } |
157 | 168 | ||
158 | /* | 169 | /* |
@@ -466,9 +477,25 @@ static int im_explorer_detect(struct psmouse *psmouse, int set_properties) | |||
466 | if (param[0] != 4) | 477 | if (param[0] != 4) |
467 | return -1; | 478 | return -1; |
468 | 479 | ||
480 | /* Magic to enable horizontal scrolling on IntelliMouse 4.0 */ | ||
481 | param[0] = 200; | ||
482 | ps2_command(ps2dev, param, PSMOUSE_CMD_SETRATE); | ||
483 | param[0] = 80; | ||
484 | ps2_command(ps2dev, param, PSMOUSE_CMD_SETRATE); | ||
485 | param[0] = 40; | ||
486 | ps2_command(ps2dev, param, PSMOUSE_CMD_SETRATE); | ||
487 | |||
488 | param[0] = 200; | ||
489 | ps2_command(ps2dev, param, PSMOUSE_CMD_SETRATE); | ||
490 | param[0] = 200; | ||
491 | ps2_command(ps2dev, param, PSMOUSE_CMD_SETRATE); | ||
492 | param[0] = 60; | ||
493 | ps2_command(ps2dev, param, PSMOUSE_CMD_SETRATE); | ||
494 | |||
469 | if (set_properties) { | 495 | if (set_properties) { |
470 | set_bit(BTN_MIDDLE, psmouse->dev->keybit); | 496 | set_bit(BTN_MIDDLE, psmouse->dev->keybit); |
471 | set_bit(REL_WHEEL, psmouse->dev->relbit); | 497 | set_bit(REL_WHEEL, psmouse->dev->relbit); |
498 | set_bit(REL_HWHEEL, psmouse->dev->relbit); | ||
472 | set_bit(BTN_SIDE, psmouse->dev->keybit); | 499 | set_bit(BTN_SIDE, psmouse->dev->keybit); |
473 | set_bit(BTN_EXTRA, psmouse->dev->keybit); | 500 | set_bit(BTN_EXTRA, psmouse->dev->keybit); |
474 | 501 | ||
@@ -1057,8 +1084,8 @@ static int psmouse_switch_protocol(struct psmouse *psmouse, struct psmouse_proto | |||
1057 | if (psmouse->resync_time && psmouse->poll(psmouse)) | 1084 | if (psmouse->resync_time && psmouse->poll(psmouse)) |
1058 | psmouse->resync_time = 0; | 1085 | psmouse->resync_time = 0; |
1059 | 1086 | ||
1060 | sprintf(psmouse->devname, "%s %s %s", | 1087 | snprintf(psmouse->devname, sizeof(psmouse->devname), "%s %s %s", |
1061 | psmouse_protocol_by_type(psmouse->type)->name, psmouse->vendor, psmouse->name); | 1088 | psmouse_protocol_by_type(psmouse->type)->name, psmouse->vendor, psmouse->name); |
1062 | 1089 | ||
1063 | input_dev->name = psmouse->devname; | 1090 | input_dev->name = psmouse->devname; |
1064 | input_dev->phys = psmouse->phys; | 1091 | input_dev->phys = psmouse->phys; |
@@ -1099,7 +1126,7 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv) | |||
1099 | ps2_init(&psmouse->ps2dev, serio); | 1126 | ps2_init(&psmouse->ps2dev, serio); |
1100 | INIT_WORK(&psmouse->resync_work, psmouse_resync, psmouse); | 1127 | INIT_WORK(&psmouse->resync_work, psmouse_resync, psmouse); |
1101 | psmouse->dev = input_dev; | 1128 | psmouse->dev = input_dev; |
1102 | sprintf(psmouse->phys, "%s/input0", serio->phys); | 1129 | snprintf(psmouse->phys, sizeof(psmouse->phys), "%s/input0", serio->phys); |
1103 | 1130 | ||
1104 | psmouse_set_state(psmouse, PSMOUSE_INITIALIZING); | 1131 | psmouse_set_state(psmouse, PSMOUSE_INITIALIZING); |
1105 | 1132 | ||
diff --git a/drivers/input/mouse/sermouse.c b/drivers/input/mouse/sermouse.c index 2f9a04ae725f..a89742431717 100644 --- a/drivers/input/mouse/sermouse.c +++ b/drivers/input/mouse/sermouse.c | |||
@@ -254,7 +254,7 @@ static int sermouse_connect(struct serio *serio, struct serio_driver *drv) | |||
254 | goto fail; | 254 | goto fail; |
255 | 255 | ||
256 | sermouse->dev = input_dev; | 256 | sermouse->dev = input_dev; |
257 | sprintf(sermouse->phys, "%s/input0", serio->phys); | 257 | snprintf(sermouse->phys, sizeof(sermouse->phys), "%s/input0", serio->phys); |
258 | sermouse->type = serio->id.proto; | 258 | sermouse->type = serio->id.proto; |
259 | 259 | ||
260 | input_dev->name = sermouse_protocols[sermouse->type]; | 260 | input_dev->name = sermouse_protocols[sermouse->type]; |
diff --git a/drivers/input/mouse/vsxxxaa.c b/drivers/input/mouse/vsxxxaa.c index 36e9442a16b2..7b85bc21ae4a 100644 --- a/drivers/input/mouse/vsxxxaa.c +++ b/drivers/input/mouse/vsxxxaa.c | |||
@@ -153,22 +153,25 @@ vsxxxaa_detection_done (struct vsxxxaa *mouse) | |||
153 | { | 153 | { |
154 | switch (mouse->type) { | 154 | switch (mouse->type) { |
155 | case 0x02: | 155 | case 0x02: |
156 | sprintf (mouse->name, "DEC VSXXX-AA/-GA mouse"); | 156 | strlcpy (mouse->name, "DEC VSXXX-AA/-GA mouse", |
157 | sizeof (mouse->name)); | ||
157 | break; | 158 | break; |
158 | 159 | ||
159 | case 0x04: | 160 | case 0x04: |
160 | sprintf (mouse->name, "DEC VSXXX-AB digitizer"); | 161 | strlcpy (mouse->name, "DEC VSXXX-AB digitizer", |
162 | sizeof (mouse->name)); | ||
161 | break; | 163 | break; |
162 | 164 | ||
163 | default: | 165 | default: |
164 | sprintf (mouse->name, "unknown DEC pointer device " | 166 | snprintf (mouse->name, sizeof (mouse->name), |
165 | "(type = 0x%02x)", mouse->type); | 167 | "unknown DEC pointer device (type = 0x%02x)", |
168 | mouse->type); | ||
166 | break; | 169 | break; |
167 | } | 170 | } |
168 | 171 | ||
169 | printk (KERN_INFO "Found %s version 0x%02x from country 0x%02x " | 172 | printk (KERN_INFO |
170 | "on port %s\n", mouse->name, mouse->version, | 173 | "Found %s version 0x%02x from country 0x%02x on port %s\n", |
171 | mouse->country, mouse->phys); | 174 | mouse->name, mouse->version, mouse->country, mouse->phys); |
172 | } | 175 | } |
173 | 176 | ||
174 | /* | 177 | /* |
@@ -503,8 +506,9 @@ vsxxxaa_connect (struct serio *serio, struct serio_driver *drv) | |||
503 | 506 | ||
504 | mouse->dev = input_dev; | 507 | mouse->dev = input_dev; |
505 | mouse->serio = serio; | 508 | mouse->serio = serio; |
506 | sprintf (mouse->name, "DEC VSXXX-AA/-GA mouse or VSXXX-AB digitizer"); | 509 | strlcat (mouse->name, "DEC VSXXX-AA/-GA mouse or VSXXX-AB digitizer", |
507 | sprintf (mouse->phys, "%s/input0", serio->phys); | 510 | sizeof (mouse->name)); |
511 | snprintf (mouse->phys, sizeof (mouse->phys), "%s/input0", serio->phys); | ||
508 | 512 | ||
509 | input_dev->name = mouse->name; | 513 | input_dev->name = mouse->name; |
510 | input_dev->phys = mouse->phys; | 514 | input_dev->phys = mouse->phys; |