aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPozsar Balazs <pozsy@uhulinux.hu>2006-06-26 01:56:08 -0400
committerDmitry Torokhov <dtor_core@ameritech.net>2006-06-26 01:56:08 -0400
commitb0c9ad8e0ff154f8c4730b8c4383f49b846c97c4 (patch)
treebeb295f07520d8df7b100504e2f49effc0b78c26 /drivers
parent0ae051a19092d36112b5ba60ff8b5df7a5d5d23b (diff)
Input: psmouse - add support for Intellimouse 4.0
Add support for the H-Wheel present on Microsoft Intellimouse 4.0 (AKA "tilt mouse") Signed-off-by: Pozsar Balazs <pozsy@uhulinux.hu> Signed-off-by: Vojtech Pavlik <vojtech@suse.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/mouse/psmouse-base.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 5f21532c24f..8bc9f51ae6c 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