Skip to content

Commit

Permalink
Input: ALPS - fix stuck buttons on some touchpads
Browse files Browse the repository at this point in the history
Enable button release event redirection to the device that got the
button press not only for touchpads with interleaved protocols, but
unconditionally for all Alps touchpads. This is required at least
for the touchpads in Dell Inspiron 8200 and Latitude d630.

Signed-off-by: Martin Buck <mb-tmp-yvahk-vachg@gromit.dyndns.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Martin Buck authored and Dmitry Torokhov committed Mar 14, 2010
1 parent afadb8e commit c91ed05
Showing 1 changed file with 17 additions and 30 deletions.
47 changes: 17 additions & 30 deletions 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 c91ed05

Please sign in to comment.