Input: synaptics - fix middle button on Lenovo 2015 products
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 9 Mar 2015 05:30:43 +0000 (22:30 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 9 May 2015 22:16:27 +0000 (23:16 +0100)
commit479e286fb6e54aa95f90cdb92efa9c8a0a188808
tree61bf10173ed2a41c9a9a9554aecff139927a3fa5
parent0708a28277f1b62421ef8001adb7c4f24e3f224c
Input: synaptics - fix middle button on Lenovo 2015 products

commit dc5465dc8a6d5cae8a0e1d8826bdcb2e4cb261ab upstream.

On the X1 Carbon 3rd gen (with a 2015 broadwell cpu), the physical middle
button of the trackstick (attached to the touchpad serio device, of course)
seems to get lost.

Actually, the touchpads reports 3 extra buttons, which falls in the switch
below to the '2' case. Let's handle the case of odd numbers also, so that
the middle button finds its way back.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
[bwh: Backported to 3.2: open-code GENMASK()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/input/mouse/synaptics.c