Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58464
b: refs/heads/master
c: aea6a46
h: refs/heads/master
v: v3
  • Loading branch information
Aristeu Rozanski authored and Dmitry Torokhov committed Jul 10, 2007
1 parent 523ffa7 commit 61bc254
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e01a06e8df239de0ffd4ee37d296c7bc3f57e817
refs/heads/master: aea6a46122a0ce65a831fd93cac6d2084ac666f9
29 changes: 29 additions & 0 deletions trunk/drivers/input/mouse/psmouse-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,15 @@ static psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse)
packet[1] |= (packet[0] & 0x40) << 1;
}

/*
* Cortron PS2 Trackball reports SIDE button on the 4th bit of the first
* byte.
*/
if (psmouse->type == PSMOUSE_CORTRON) {
input_report_key(dev, BTN_SIDE, (packet[0] >> 3) & 1);
packet[0] |= 0x08;
}

/*
* Generic PS/2 Mouse
*/
Expand Down Expand Up @@ -539,6 +548,20 @@ static int ps2bare_detect(struct psmouse *psmouse, int set_properties)
return 0;
}

/*
* Cortron PS/2 protocol detection. There's no special way to detect it, so it
* must be forced by sysfs protocol writing.
*/
static int cortron_detect(struct psmouse *psmouse, int set_properties)
{
if (set_properties) {
psmouse->vendor = "Cortron";
psmouse->name = "PS/2 Trackball";
set_bit(BTN_SIDE, psmouse->dev->keybit);
}

return 0;
}

/*
* psmouse_extensions() probes for any extensions to the basic PS/2 protocol
Expand Down Expand Up @@ -739,6 +762,12 @@ static const struct psmouse_protocol psmouse_protocols[] = {
.detect = touchkit_ps2_detect,
},
#endif
{
.type = PSMOUSE_CORTRON,
.name = "CortronPS/2",
.alias = "cortps",
.detect = cortron_detect,
},
{
.type = PSMOUSE_AUTO,
.name = "auto",
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/input/mouse/psmouse.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ enum psmouse_type {
PSMOUSE_LIFEBOOK,
PSMOUSE_TRACKPOINT,
PSMOUSE_TOUCHKIT_PS2,
PSMOUSE_CORTRON,
PSMOUSE_AUTO /* This one should always be last */
};

Expand Down

0 comments on commit 61bc254

Please sign in to comment.