Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53402
b: refs/heads/master
c: 867d268
h: refs/heads/master
v: v3
  • Loading branch information
Peter Osterlund authored and Dmitry Torokhov committed Mar 16, 2007
1 parent d659c7d commit 43df88e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 54f9e36cb83e7da17dc0596d365fe019a25c226f
refs/heads/master: 867d2682e92a3999e3862f1679cfcb549142d776
16 changes: 12 additions & 4 deletions trunk/drivers/input/mouse/sermouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ static void sermouse_process_msc(struct sermouse *sermouse, signed char data)
switch (sermouse->count) {

case 0:
if ((data & 0xf8) != 0x80) return;
if ((data & 0xf8) != 0x80)
return;
input_report_key(dev, BTN_LEFT, !(data & 4));
input_report_key(dev, BTN_RIGHT, !(data & 1));
input_report_key(dev, BTN_MIDDLE, !(data & 2));
Expand Down Expand Up @@ -107,7 +108,10 @@ static void sermouse_process_ms(struct sermouse *sermouse, signed char data)
struct input_dev *dev = sermouse->dev;
signed char *buf = sermouse->buf;

if (data & 0x40) sermouse->count = 0;
if (data & 0x40)
sermouse->count = 0;
else if (sermouse->count == 0)
return;

switch (sermouse->count) {

Expand Down Expand Up @@ -169,7 +173,8 @@ static void sermouse_process_ms(struct sermouse *sermouse, signed char data)

case 5:
case 7: /* Ignore anything besides MZ++ */
if (sermouse->type != SERIO_MZPP) break;
if (sermouse->type != SERIO_MZPP)
break;

switch (buf[1]) {

Expand Down Expand Up @@ -206,13 +211,16 @@ static irqreturn_t sermouse_interrupt(struct serio *serio,
{
struct sermouse *sermouse = serio_get_drvdata(serio);

if (time_after(jiffies, sermouse->last + HZ/10)) sermouse->count = 0;
if (time_after(jiffies, sermouse->last + HZ/10))
sermouse->count = 0;

sermouse->last = jiffies;

if (sermouse->type > SERIO_SUN)
sermouse_process_ms(sermouse, data);
else
sermouse_process_msc(sermouse, data);

return IRQ_HANDLED;
}

Expand Down

0 comments on commit 43df88e

Please sign in to comment.