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: Martin Buck <mb-tmp-yvahk-vachg@gromit.dyndns.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
parent
afadb8e08c
commit
c91ed059a0
1 changed files with 17 additions and 30 deletions
|
@ -120,40 +120,27 @@ static void alps_report_buttons(struct psmouse *psmouse,
|
||||||
struct input_dev *dev1, struct input_dev *dev2,
|
struct input_dev *dev1, struct input_dev *dev2,
|
||||||
int left, int right, int middle)
|
int left, int right, int middle)
|
||||||
{
|
{
|
||||||
struct alps_data *priv = psmouse->private;
|
struct input_dev *dev;
|
||||||
const struct alps_model_info *model = priv->i;
|
|
||||||
|
|
||||||
if (model->flags & ALPS_PS2_INTERLEAVED) {
|
/*
|
||||||
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);
|
||||||
|
|
||||||
/*
|
dev = test_bit(BTN_RIGHT, dev2->key) ? dev2 : dev1;
|
||||||
* If shared button has already been reported on the
|
input_report_key(dev, BTN_RIGHT, right);
|
||||||
* 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;
|
dev = test_bit(BTN_MIDDLE, dev2->key) ? dev2 : dev1;
|
||||||
input_report_key(dev, BTN_RIGHT, right);
|
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.
|
||||||
/*
|
*/
|
||||||
* Sync the _other_ device now, we'll do the first
|
input_sync(dev2);
|
||||||
* 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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void alps_process_packet(struct psmouse *psmouse)
|
static void alps_process_packet(struct psmouse *psmouse)
|
||||||
|
|
Reference in a new issue