aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2018-06-25 15:02:40 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2018-06-26 19:21:45 -0400
commit03ae3a9caf4a59edd32b65c89c375a98ce3ea1ef (patch)
tree3e8c88b9a0835d338cb41ada6d5844eb9a949107
parentdd6bee81c942c0ea01030da9356026afb88f9d18 (diff)
Input: psmouse - fix button reporting for basic protocols
The commit ba667650c568 ("Input: psmouse - clean up code") was pretty brain-dead and broke extra buttons reporting for variety of PS/2 mice: Genius, Thinkmouse and Intellimouse Explorer. We need to actually inspect the data coming from the device when reporting events. Fixes: ba667650c568 ("Input: psmouse - clean up code") Reported-by: Jiri Slaby <jslaby@suse.cz> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/mouse/psmouse-base.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 5ff5b1952be0..d3ff1fc09af7 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -192,8 +192,8 @@ psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse)
192 else 192 else
193 input_report_rel(dev, REL_WHEEL, -wheel); 193 input_report_rel(dev, REL_WHEEL, -wheel);
194 194
195 input_report_key(dev, BTN_SIDE, BIT(4)); 195 input_report_key(dev, BTN_SIDE, packet[3] & BIT(4));
196 input_report_key(dev, BTN_EXTRA, BIT(5)); 196 input_report_key(dev, BTN_EXTRA, packet[3] & BIT(5));
197 break; 197 break;
198 } 198 }
199 break; 199 break;
@@ -203,13 +203,13 @@ psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse)
203 input_report_rel(dev, REL_WHEEL, -(s8) packet[3]); 203 input_report_rel(dev, REL_WHEEL, -(s8) packet[3]);
204 204
205 /* Extra buttons on Genius NewNet 3D */ 205 /* Extra buttons on Genius NewNet 3D */
206 input_report_key(dev, BTN_SIDE, BIT(6)); 206 input_report_key(dev, BTN_SIDE, packet[0] & BIT(6));
207 input_report_key(dev, BTN_EXTRA, BIT(7)); 207 input_report_key(dev, BTN_EXTRA, packet[0] & BIT(7));
208 break; 208 break;
209 209
210 case PSMOUSE_THINKPS: 210 case PSMOUSE_THINKPS:
211 /* Extra button on ThinkingMouse */ 211 /* Extra button on ThinkingMouse */
212 input_report_key(dev, BTN_EXTRA, BIT(3)); 212 input_report_key(dev, BTN_EXTRA, packet[0] & BIT(3));
213 213
214 /* 214 /*
215 * Without this bit of weirdness moving up gives wildly 215 * Without this bit of weirdness moving up gives wildly
@@ -223,7 +223,7 @@ psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse)
223 * Cortron PS2 Trackball reports SIDE button in the 223 * Cortron PS2 Trackball reports SIDE button in the
224 * 4th bit of the first byte. 224 * 4th bit of the first byte.
225 */ 225 */
226 input_report_key(dev, BTN_SIDE, BIT(3)); 226 input_report_key(dev, BTN_SIDE, packet[0] & BIT(3));
227 packet[0] |= BIT(3); 227 packet[0] |= BIT(3);
228 break; 228 break;
229 229