Skip to content

Commit 073e570

Browse files
jwrdegoededtor
authored andcommitted
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 92bac83 ("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>
1 parent b6e2654 commit 073e570

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Documentation/input/alps.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,10 @@ ALPS Absolute Mode - Protocol Version 2
119119
byte 5: 0 z6 z5 z4 z3 z2 z1 z0
120120

121121
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.
124126

125127
Dualpoint device -- interleaved packet format
126128
---------------------------------------------

drivers/input/mouse/alps.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/input/mt.h>
2121
#include <linux/serio.h>
2222
#include <linux/libps2.h>
23+
#include <linux/dmi.h>
2324

2425
#include "psmouse.h"
2526
#include "alps.h"
@@ -99,6 +100,7 @@ static const struct alps_nibble_commands alps_v6_nibble_commands[] = {
99100
#define ALPS_FOUR_BUTTONS 0x40 /* 4 direction button present */
100101
#define ALPS_PS2_INTERLEAVED 0x80 /* 3-byte PS/2 packet interleaved with
101102
6-byte ALPS packet */
103+
#define ALPS_DELL 0x100 /* device is a Dell laptop */
102104
#define ALPS_BUTTONPAD 0x200 /* device is a clickpad */
103105

104106
static const struct alps_model_info alps_model_data[] = {
@@ -251,9 +253,9 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse)
251253
return;
252254
}
253255

254-
/* Non interleaved V2 dualpoint has separate stick button bits */
256+
/* Dell non interleaved V2 dualpoint has separate stick button bits */
255257
if (priv->proto_version == ALPS_PROTO_V2 &&
256-
priv->flags == (ALPS_PASS | ALPS_DUALPOINT)) {
258+
priv->flags == (ALPS_DELL | ALPS_PASS | ALPS_DUALPOINT)) {
257259
left |= packet[0] & 1;
258260
right |= packet[0] & 2;
259261
middle |= packet[0] & 4;
@@ -2550,6 +2552,8 @@ static int alps_set_protocol(struct psmouse *psmouse,
25502552
priv->byte0 = protocol->byte0;
25512553
priv->mask0 = protocol->mask0;
25522554
priv->flags = protocol->flags;
2555+
if (dmi_name_in_vendors("Dell"))
2556+
priv->flags |= ALPS_DELL;
25532557

25542558
priv->x_max = 2000;
25552559
priv->y_max = 1400;

0 commit comments

Comments
 (0)