diff options
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 29 | ||||
-rw-r--r-- | drivers/input/mouse/psmouse.h | 1 |
2 files changed, 30 insertions, 0 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index f15f695777f8..b9f0fb2530e2 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -178,6 +178,15 @@ static psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse) | |||
178 | } | 178 | } |
179 | 179 | ||
180 | /* | 180 | /* |
181 | * Cortron PS2 Trackball reports SIDE button on the 4th bit of the first | ||
182 | * byte. | ||
183 | */ | ||
184 | if (psmouse->type == PSMOUSE_CORTRON) { | ||
185 | input_report_key(dev, BTN_SIDE, (packet[0] >> 3) & 1); | ||
186 | packet[0] |= 0x08; | ||
187 | } | ||
188 | |||
189 | /* | ||
181 | * Generic PS/2 Mouse | 190 | * Generic PS/2 Mouse |
182 | */ | 191 | */ |
183 | 192 | ||
@@ -539,6 +548,20 @@ static int ps2bare_detect(struct psmouse *psmouse, int set_properties) | |||
539 | return 0; | 548 | return 0; |
540 | } | 549 | } |
541 | 550 | ||
551 | /* | ||
552 | * Cortron PS/2 protocol detection. There's no special way to detect it, so it | ||
553 | * must be forced by sysfs protocol writing. | ||
554 | */ | ||
555 | static int cortron_detect(struct psmouse *psmouse, int set_properties) | ||
556 | { | ||
557 | if (set_properties) { | ||
558 | psmouse->vendor = "Cortron"; | ||
559 | psmouse->name = "PS/2 Trackball"; | ||
560 | set_bit(BTN_SIDE, psmouse->dev->keybit); | ||
561 | } | ||
562 | |||
563 | return 0; | ||
564 | } | ||
542 | 565 | ||
543 | /* | 566 | /* |
544 | * psmouse_extensions() probes for any extensions to the basic PS/2 protocol | 567 | * psmouse_extensions() probes for any extensions to the basic PS/2 protocol |
@@ -740,6 +763,12 @@ static const struct psmouse_protocol psmouse_protocols[] = { | |||
740 | }, | 763 | }, |
741 | #endif | 764 | #endif |
742 | { | 765 | { |
766 | .type = PSMOUSE_CORTRON, | ||
767 | .name = "CortronPS/2", | ||
768 | .alias = "cortps", | ||
769 | .detect = cortron_detect, | ||
770 | }, | ||
771 | { | ||
743 | .type = PSMOUSE_AUTO, | 772 | .type = PSMOUSE_AUTO, |
744 | .name = "auto", | 773 | .name = "auto", |
745 | .alias = "any", | 774 | .alias = "any", |
diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h index 3964e8acbc54..27a68835b5ba 100644 --- a/drivers/input/mouse/psmouse.h +++ b/drivers/input/mouse/psmouse.h | |||
@@ -88,6 +88,7 @@ enum psmouse_type { | |||
88 | PSMOUSE_LIFEBOOK, | 88 | PSMOUSE_LIFEBOOK, |
89 | PSMOUSE_TRACKPOINT, | 89 | PSMOUSE_TRACKPOINT, |
90 | PSMOUSE_TOUCHKIT_PS2, | 90 | PSMOUSE_TOUCHKIT_PS2, |
91 | PSMOUSE_CORTRON, | ||
91 | PSMOUSE_AUTO /* This one should always be last */ | 92 | PSMOUSE_AUTO /* This one should always be last */ |
92 | }; | 93 | }; |
93 | 94 | ||