summaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/synaptics.h
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2017-03-24 01:40:57 +0100
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-04-04 01:23:57 +0200
commit2c6ecbba90d4e909bdc8982b4a2318e99d7fc4f2 (patch)
tree7c6bc00a18f09644f3e6b584766b306338e8f70c /drivers/input/mouse/synaptics.h
parentInput: psmouse - use i2c_client_type to locate i2c clients (diff)
downloadlinux-2c6ecbba90d4e909bdc8982b4a2318e99d7fc4f2.tar.xz
linux-2c6ecbba90d4e909bdc8982b4a2318e99d7fc4f2.zip
Input: synaptics - add synaptics_query_int()
Factor out querying and parsing 3-byte response into an integer value. Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/mouse/synaptics.h')
-rw-r--r--drivers/input/mouse/synaptics.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
index 31652d98b8f7..87fbe5b53803 100644
--- a/drivers/input/mouse/synaptics.h
+++ b/drivers/input/mouse/synaptics.h
@@ -52,7 +52,8 @@
#define SYN_CAP_PALMDETECT(c) ((c) & (1 << 0))
#define SYN_CAP_SUBMODEL_ID(c) (((c) & 0x00ff00) >> 8)
#define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20)
-#define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12)
+#define SYN_CAP_MB_MASK GENMASK(15, 12)
+#define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & SYN_CAP_MB_MASK) >> 12)
#define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16)
#define SYN_MEXT_CAP_BIT(m) ((m) & (1 << 1))