Commit c91ed059 authored by Martin Buck's avatar Martin Buck Committed by Dmitry Torokhov

Input: ALPS - fix stuck buttons on some touchpads

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: default avatarMartin Buck <mb-tmp-yvahk-vachg@gromit.dyndns.org>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent afadb8e0
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment