Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188058
b: refs/heads/master
c: c91ed05
h: refs/heads/master
v: v3
  • Loading branch information
Martin Buck authored and Dmitry Torokhov committed Mar 14, 2010
1 parent b4f5e9c commit 55d124e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 31 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: afadb8e08c48d08b75f3caf8404742b13e6b3624
refs/heads/master: c91ed059a080c6f9a7ba525e5027c65d19115d15
47 changes: 17 additions & 30 deletions trunk/drivers/input/mouse/alps.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,40 +120,27 @@ static void alps_report_buttons(struct psmouse *psmouse,
struct input_dev *dev1, struct input_dev *dev2,
int left, int right, int middle)
{
struct alps_data *priv = psmouse->private;
const struct alps_model_info *model = priv->i;

if (model->flags & ALPS_PS2_INTERLEAVED) {
struct input_dev *dev;
struct input_dev *dev;

/*
* If shared button has already been reported on the
* other device (dev2) then this event should be also
* sent through that device.
*/
dev = test_bit(BTN_LEFT, dev2->key) ? dev2 : dev1;
input_report_key(dev, BTN_LEFT, left);
/*
* If shared button has already been reported on the
* other device (dev2) then this event should be also
* sent through that device.
*/
dev = test_bit(BTN_LEFT, dev2->key) ? dev2 : dev1;
input_report_key(dev, BTN_LEFT, left);

dev = test_bit(BTN_RIGHT, dev2->key) ? dev2 : dev1;
input_report_key(dev, BTN_RIGHT, right);
dev = test_bit(BTN_RIGHT, dev2->key) ? dev2 : dev1;
input_report_key(dev, BTN_RIGHT, right);

dev = test_bit(BTN_MIDDLE, dev2->key) ? dev2 : dev1;
input_report_key(dev, BTN_MIDDLE, middle);
dev = test_bit(BTN_MIDDLE, dev2->key) ? dev2 : dev1;
input_report_key(dev, BTN_MIDDLE, middle);

/*
* Sync the _other_ device now, we'll do the first
* device later once we report the rest of the events.
*/
input_sync(dev2);
} else {
/*
* For devices with non-interleaved packets we know what
* device buttons belong to so we can simply report them.
*/
input_report_key(dev1, BTN_LEFT, left);
input_report_key(dev1, BTN_RIGHT, right);
input_report_key(dev1, BTN_MIDDLE, middle);
}
/*
* Sync the _other_ device now, we'll do the first
* device later once we report the rest of the events.
*/
input_sync(dev2);
}

static void alps_process_packet(struct psmouse *psmouse)
Expand Down

0 comments on commit 55d124e

Please sign in to comment.