aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMartin Buck <mb-tmp-yvahk-vachg@gromit.dyndns.org>2010-03-14 01:23:58 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-03-14 01:37:43 -0500
commitc91ed059a080c6f9a7ba525e5027c65d19115d15 (patch)
tree771090b98b2421d8796855968cbe6e19a8046fb2 /drivers
parentafadb8e08c48d08b75f3caf8404742b13e6b3624 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/mouse/alps.c47
1 files changed, 17 insertions, 30 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index f6dad83539e0..7490f1da4a53 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -120,40 +120,27 @@ static void alps_report_buttons(struct psmouse *psmouse,
120 struct input_dev *dev1, struct input_dev *dev2, 120 struct input_dev *dev1, struct input_dev *dev2,
121 int left, int right, int middle) 121 int left, int right, int middle)
122{ 122{
123 struct alps_data *priv = psmouse->private; 123 struct input_dev *dev;
124 const struct alps_model_info *model = priv->i;
125
126 if (model->flags & ALPS_PS2_INTERLEAVED) {
127 struct input_dev *dev;
128 124
129 /* 125 /*
130 * If shared button has already been reported on the 126 * If shared button has already been reported on the
131 * other device (dev2) then this event should be also 127 * other device (dev2) then this event should be also
132 * sent through that device. 128 * sent through that device.
133 */ 129 */
134 dev = test_bit(BTN_LEFT, dev2->key) ? dev2 : dev1; 130 dev = test_bit(BTN_LEFT, dev2->key) ? dev2 : dev1;
135 input_report_key(dev, BTN_LEFT, left); 131 input_report_key(dev, BTN_LEFT, left);
136 132
137 dev = test_bit(BTN_RIGHT, dev2->key) ? dev2 : dev1; 133 dev = test_bit(BTN_RIGHT, dev2->key) ? dev2 : dev1;
138 input_report_key(dev, BTN_RIGHT, right); 134 input_report_key(dev, BTN_RIGHT, right);
139 135
140 dev = test_bit(BTN_MIDDLE, dev2->key) ? dev2 : dev1; 136 dev = test_bit(BTN_MIDDLE, dev2->key) ? dev2 : dev1;
141 input_report_key(dev, BTN_MIDDLE, middle); 137 input_report_key(dev, BTN_MIDDLE, middle);
142 138
143 /* 139 /*
144 * Sync the _other_ device now, we'll do the first 140 * Sync the _other_ device now, we'll do the first
145 * device later once we report the rest of the events. 141 * device later once we report the rest of the events.
146 */ 142 */
147 input_sync(dev2); 143 input_sync(dev2);
148 } else {
149 /*
150 * For devices with non-interleaved packets we know what
151 * device buttons belong to so we can simply report them.
152 */
153 input_report_key(dev1, BTN_LEFT, left);
154 input_report_key(dev1, BTN_RIGHT, right);
155 input_report_key(dev1, BTN_MIDDLE, middle);
156 }
157} 144}
158 145
159static void alps_process_packet(struct psmouse *psmouse) 146static void alps_process_packet(struct psmouse *psmouse)