Skip to content

Commit 3619b8f

Browse files
committed
Input: synaptics - relax capability ID checks on newer hardware
Older firmwares fixed the middle byte of the Synaptics capabilities query to 0x47, but starting with firmware 7.5 the middle byte represents submodel ID, sometimes also called "dash number". Reported-and-tested-by: Miroslav Šulc <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 3fea602 commit 3619b8f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

drivers/input/mouse/synaptics.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,13 @@ static int synaptics_capability(struct psmouse *psmouse)
141141
priv->capabilities = (cap[0] << 16) | (cap[1] << 8) | cap[2];
142142
priv->ext_cap = priv->ext_cap_0c = 0;
143143

144-
if (!SYN_CAP_VALID(priv->capabilities))
144+
/*
145+
* Older firmwares had submodel ID fixed to 0x47
146+
*/
147+
if (SYN_ID_FULL(priv->identity) < 0x705 &&
148+
SYN_CAP_SUBMODEL_ID(priv->capabilities) != 0x47) {
145149
return -1;
150+
}
146151

147152
/*
148153
* Unless capExtended is set the rest of the flags should be ignored

drivers/input/mouse/synaptics.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
#define SYN_CAP_FOUR_BUTTON(c) ((c) & (1 << 3))
4848
#define SYN_CAP_MULTIFINGER(c) ((c) & (1 << 1))
4949
#define SYN_CAP_PALMDETECT(c) ((c) & (1 << 0))
50-
#define SYN_CAP_VALID(c) ((((c) & 0x00ff00) >> 8) == 0x47)
50+
#define SYN_CAP_SUBMODEL_ID(c) (((c) & 0x00ff00) >> 8)
5151
#define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20)
5252
#define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12)
5353
#define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16)
@@ -66,6 +66,7 @@
6666
#define SYN_ID_MODEL(i) (((i) >> 4) & 0x0f)
6767
#define SYN_ID_MAJOR(i) ((i) & 0x0f)
6868
#define SYN_ID_MINOR(i) (((i) >> 16) & 0xff)
69+
#define SYN_ID_FULL(i) ((SYN_ID_MAJOR(i) << 8) | SYN_ID_MINOR(i))
6970
#define SYN_ID_IS_SYNAPTICS(i) ((((i) >> 8) & 0xff) == 0x47)
7071

7172
/* synaptics special commands */

0 commit comments

Comments
 (0)