Input: alps - only Dell laptops have separate button bits for v2 dualpoint sticks

It turns out that only Dell laptops have the separate button bits for
v2 dualpoint sticks and that commit 92bac83dd79e ("Input: alps - non
interleaved V2 dualpoint has separate stick button bits") causes
regressions on Toshiba laptops.

This commit adds a check for Dell laptops to the code for handling these
extra button bits, fixing this regression.

This patch has been tested on a Dell Latitude D620 to make sure that it
does not reintroduce the original problem.

Reported-and-tested-by: Douglas Christman <douglaschristman@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by Hans de Goede and committed by Dmitry Torokhov 073e570d b6e26546

Changed files
+10 -4
Documentation
input
drivers
input
mouse
+4 -2
Documentation/input/alps.txt
··· 119 119 byte 5: 0 z6 z5 z4 z3 z2 z1 z0 120 120 121 121 Protocol Version 2 DualPoint devices send standard PS/2 mouse packets for 122 - the DualPoint Stick. For non interleaved dualpoint devices the pointingstick 123 - buttons get reported separately in the PSM, PSR and PSL bits. 122 + the DualPoint Stick. The M, R and L bits signal the combined status of both 123 + the pointingstick and touchpad buttons, except for Dell dualpoint devices 124 + where the pointingstick buttons get reported separately in the PSM, PSR 125 + and PSL bits. 124 126 125 127 Dualpoint device -- interleaved packet format 126 128 ---------------------------------------------
+6 -2
drivers/input/mouse/alps.c
··· 20 20 #include <linux/input/mt.h> 21 21 #include <linux/serio.h> 22 22 #include <linux/libps2.h> 23 + #include <linux/dmi.h> 23 24 24 25 #include "psmouse.h" 25 26 #include "alps.h" ··· 100 99 #define ALPS_FOUR_BUTTONS 0x40 /* 4 direction button present */ 101 100 #define ALPS_PS2_INTERLEAVED 0x80 /* 3-byte PS/2 packet interleaved with 102 101 6-byte ALPS packet */ 102 + #define ALPS_DELL 0x100 /* device is a Dell laptop */ 103 103 #define ALPS_BUTTONPAD 0x200 /* device is a clickpad */ 104 104 105 105 static const struct alps_model_info alps_model_data[] = { ··· 253 251 return; 254 252 } 255 253 256 - /* Non interleaved V2 dualpoint has separate stick button bits */ 254 + /* Dell non interleaved V2 dualpoint has separate stick button bits */ 257 255 if (priv->proto_version == ALPS_PROTO_V2 && 258 - priv->flags == (ALPS_PASS | ALPS_DUALPOINT)) { 256 + priv->flags == (ALPS_DELL | ALPS_PASS | ALPS_DUALPOINT)) { 259 257 left |= packet[0] & 1; 260 258 right |= packet[0] & 2; 261 259 middle |= packet[0] & 4; ··· 2552 2550 priv->byte0 = protocol->byte0; 2553 2551 priv->mask0 = protocol->mask0; 2554 2552 priv->flags = protocol->flags; 2553 + if (dmi_name_in_vendors("Dell")) 2554 + priv->flags |= ALPS_DELL; 2555 2555 2556 2556 priv->x_max = 2000; 2557 2557 priv->y_max = 1400;