aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2015-03-09 01:34:03 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-03-09 02:36:52 -0400
commit06aa374bc70468b517dd36b95c48c8f391c08a27 (patch)
treec46b4adaa583cd28ae68a39b13092d257d4c812f /drivers/input
parentb57a7128be24062b5b5b26032b7cd58f1651547e (diff)
Input: synaptics - retrieve the extended capabilities in query $10
Newer Synaptics touchpads need to get information from the query $10. Retrieve it if available. 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>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/mouse/synaptics.c23
-rw-r--r--drivers/input/mouse/synaptics.h23
2 files changed, 43 insertions, 3 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 2176874a41b1..8f6a153677b9 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -241,11 +241,24 @@ static int synaptics_model_id(struct psmouse *psmouse)
241 return 0; 241 return 0;
242} 242}
243 243
244static int synaptics_more_extended_queries(struct psmouse *psmouse)
245{
246 struct synaptics_data *priv = psmouse->private;
247 unsigned char buf[3];
248
249 if (synaptics_send_cmd(psmouse, SYN_QUE_MEXT_CAPAB_10, buf))
250 return -1;
251
252 priv->ext_cap_10 = (buf[0]<<16) | (buf[1]<<8) | buf[2];
253
254 return 0;
255}
256
244/* 257/*
245 * Read the board id from the touchpad 258 * Read the board id and the "More Extended Queries" from the touchpad
246 * The board id is encoded in the "QUERY MODES" response 259 * The board id is encoded in the "QUERY MODES" response
247 */ 260 */
248static int synaptics_board_id(struct psmouse *psmouse) 261static int synaptics_query_modes(struct psmouse *psmouse)
249{ 262{
250 struct synaptics_data *priv = psmouse->private; 263 struct synaptics_data *priv = psmouse->private;
251 unsigned char bid[3]; 264 unsigned char bid[3];
@@ -257,6 +270,10 @@ static int synaptics_board_id(struct psmouse *psmouse)
257 if (synaptics_send_cmd(psmouse, SYN_QUE_MODES, bid)) 270 if (synaptics_send_cmd(psmouse, SYN_QUE_MODES, bid))
258 return -1; 271 return -1;
259 priv->board_id = ((bid[0] & 0xfc) << 6) | bid[1]; 272 priv->board_id = ((bid[0] & 0xfc) << 6) | bid[1];
273
274 if (SYN_MEXT_CAP_BIT(bid[0]))
275 return synaptics_more_extended_queries(psmouse);
276
260 return 0; 277 return 0;
261} 278}
262 279
@@ -446,7 +463,7 @@ static int synaptics_query_hardware(struct psmouse *psmouse)
446 return -1; 463 return -1;
447 if (synaptics_firmware_id(psmouse)) 464 if (synaptics_firmware_id(psmouse))
448 return -1; 465 return -1;
449 if (synaptics_board_id(psmouse)) 466 if (synaptics_query_modes(psmouse))
450 return -1; 467 return -1;
451 if (synaptics_capability(psmouse)) 468 if (synaptics_capability(psmouse))
452 return -1; 469 return -1;
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
index 1bd01f21783b..8d3761ce8f54 100644
--- a/drivers/input/mouse/synaptics.h
+++ b/drivers/input/mouse/synaptics.h
@@ -22,6 +22,7 @@
22#define SYN_QUE_EXT_CAPAB_0C 0x0c 22#define SYN_QUE_EXT_CAPAB_0C 0x0c
23#define SYN_QUE_EXT_MAX_COORDS 0x0d 23#define SYN_QUE_EXT_MAX_COORDS 0x0d
24#define SYN_QUE_EXT_MIN_COORDS 0x0f 24#define SYN_QUE_EXT_MIN_COORDS 0x0f
25#define SYN_QUE_MEXT_CAPAB_10 0x10
25 26
26/* synatics modes */ 27/* synatics modes */
27#define SYN_BIT_ABSOLUTE_MODE (1 << 7) 28#define SYN_BIT_ABSOLUTE_MODE (1 << 7)
@@ -53,6 +54,7 @@
53#define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20) 54#define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20)
54#define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12) 55#define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12)
55#define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16) 56#define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16)
57#define SYN_MEXT_CAP_BIT(m) ((m) & (1 << 1))
56 58
57/* 59/*
58 * The following describes response for the 0x0c query. 60 * The following describes response for the 0x0c query.
@@ -89,6 +91,26 @@
89#define SYN_CAP_REDUCED_FILTERING(ex0c) ((ex0c) & 0x000400) 91#define SYN_CAP_REDUCED_FILTERING(ex0c) ((ex0c) & 0x000400)
90#define SYN_CAP_IMAGE_SENSOR(ex0c) ((ex0c) & 0x000800) 92#define SYN_CAP_IMAGE_SENSOR(ex0c) ((ex0c) & 0x000800)
91 93
94/*
95 * The following descibes response for the 0x10 query.
96 *
97 * byte mask name meaning
98 * ---- ---- ------- ------------
99 * 1 0x01 ext buttons are stick buttons exported in the extended
100 * capability are actually meant to be used
101 * by the tracktick (pass-through).
102 * 1 0x02 SecurePad the touchpad is a SecurePad, so it
103 * contains a built-in fingerprint reader.
104 * 1 0xe0 more ext count how many more extented queries are
105 * available after this one.
106 * 2 0xff SecurePad width the width of the SecurePad fingerprint
107 * reader.
108 * 3 0xff SecurePad height the height of the SecurePad fingerprint
109 * reader.
110 */
111#define SYN_CAP_EXT_BUTTONS_STICK(ex10) ((ex10) & 0x010000)
112#define SYN_CAP_SECUREPAD(ex10) ((ex10) & 0x020000)
113
92/* synaptics modes query bits */ 114/* synaptics modes query bits */
93#define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7)) 115#define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7))
94#define SYN_MODE_RATE(m) ((m) & (1 << 6)) 116#define SYN_MODE_RATE(m) ((m) & (1 << 6))
@@ -156,6 +178,7 @@ struct synaptics_data {
156 unsigned long int capabilities; /* Capabilities */ 178 unsigned long int capabilities; /* Capabilities */
157 unsigned long int ext_cap; /* Extended Capabilities */ 179 unsigned long int ext_cap; /* Extended Capabilities */
158 unsigned long int ext_cap_0c; /* Ext Caps from 0x0c query */ 180 unsigned long int ext_cap_0c; /* Ext Caps from 0x0c query */
181 unsigned long int ext_cap_10; /* Ext Caps from 0x10 query */
159 unsigned long int identity; /* Identification */ 182 unsigned long int identity; /* Identification */
160 unsigned int x_res, y_res; /* X/Y resolution in units/mm */ 183 unsigned int x_res, y_res; /* X/Y resolution in units/mm */
161 unsigned int x_max, y_max; /* Max coordinates (from FW) */ 184 unsigned int x_max, y_max; /* Max coordinates (from FW) */