aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse
diff options
context:
space:
mode:
authorDaniel Kurtz <djkurtz@chromium.org>2012-07-07 21:08:51 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-07-07 21:20:08 -0400
commitc6bd9d465500effa710634876fa9e35581da522d (patch)
tree35439a09bbbe40289c0546d1d39d8a5919ddd9d3 /drivers/input/mouse
parent98e4d4d6bcf130cbf5a684c4f98c345f13e2f28c (diff)
Input: synaptics - print firmware ID and board number at init
Read the Firmware ID and Board Number from a synaptics device at init and display them in the system log. Device behavior is very board and firmware dependent. It may prove useful for users to include this information when providing bug reports or other feedback. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r--drivers/input/mouse/synaptics.c38
-rw-r--r--drivers/input/mouse/synaptics.h3
2 files changed, 39 insertions, 2 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index c703d53be3a0..d5b390f75c9a 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -139,6 +139,35 @@ static int synaptics_model_id(struct psmouse *psmouse)
139} 139}
140 140
141/* 141/*
142 * Read the board id from the touchpad
143 * The board id is encoded in the "QUERY MODES" response
144 */
145static int synaptics_board_id(struct psmouse *psmouse)
146{
147 struct synaptics_data *priv = psmouse->private;
148 unsigned char bid[3];
149
150 if (synaptics_send_cmd(psmouse, SYN_QUE_MODES, bid))
151 return -1;
152 priv->board_id = ((bid[0] & 0xfc) << 6) | bid[1];
153 return 0;
154}
155
156/*
157 * Read the firmware id from the touchpad
158 */
159static int synaptics_firmware_id(struct psmouse *psmouse)
160{
161 struct synaptics_data *priv = psmouse->private;
162 unsigned char fwid[3];
163
164 if (synaptics_send_cmd(psmouse, SYN_QUE_FIRMWARE_ID, fwid))
165 return -1;
166 priv->firmware_id = (fwid[0] << 16) | (fwid[1] << 8) | fwid[2];
167 return 0;
168}
169
170/*
142 * Read the capability-bits from the touchpad 171 * Read the capability-bits from the touchpad
143 * see also the SYN_CAP_* macros 172 * see also the SYN_CAP_* macros
144 */ 173 */
@@ -261,6 +290,10 @@ static int synaptics_query_hardware(struct psmouse *psmouse)
261 return -1; 290 return -1;
262 if (synaptics_model_id(psmouse)) 291 if (synaptics_model_id(psmouse))
263 return -1; 292 return -1;
293 if (synaptics_firmware_id(psmouse))
294 return -1;
295 if (synaptics_board_id(psmouse))
296 return -1;
264 if (synaptics_capability(psmouse)) 297 if (synaptics_capability(psmouse))
265 return -1; 298 return -1;
266 if (synaptics_resolution(psmouse)) 299 if (synaptics_resolution(psmouse))
@@ -1435,11 +1468,12 @@ static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode)
1435 priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS; 1468 priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS;
1436 1469
1437 psmouse_info(psmouse, 1470 psmouse_info(psmouse,
1438 "Touchpad model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx\n", 1471 "Touchpad model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx, board id: %lu, fw id: %lu\n",
1439 SYN_ID_MODEL(priv->identity), 1472 SYN_ID_MODEL(priv->identity),
1440 SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity), 1473 SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity),
1441 priv->model_id, 1474 priv->model_id,
1442 priv->capabilities, priv->ext_cap, priv->ext_cap_0c); 1475 priv->capabilities, priv->ext_cap, priv->ext_cap_0c,
1476 priv->board_id, priv->firmware_id);
1443 1477
1444 set_input_params(psmouse->dev, priv); 1478 set_input_params(psmouse->dev, priv);
1445 1479
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
index fd26ccca13d7..e594af0b264b 100644
--- a/drivers/input/mouse/synaptics.h
+++ b/drivers/input/mouse/synaptics.h
@@ -18,6 +18,7 @@
18#define SYN_QUE_SERIAL_NUMBER_SUFFIX 0x07 18#define SYN_QUE_SERIAL_NUMBER_SUFFIX 0x07
19#define SYN_QUE_RESOLUTION 0x08 19#define SYN_QUE_RESOLUTION 0x08
20#define SYN_QUE_EXT_CAPAB 0x09 20#define SYN_QUE_EXT_CAPAB 0x09
21#define SYN_QUE_FIRMWARE_ID 0x0a
21#define SYN_QUE_EXT_CAPAB_0C 0x0c 22#define SYN_QUE_EXT_CAPAB_0C 0x0c
22#define SYN_QUE_EXT_MAX_COORDS 0x0d 23#define SYN_QUE_EXT_MAX_COORDS 0x0d
23#define SYN_QUE_EXT_MIN_COORDS 0x0f 24#define SYN_QUE_EXT_MIN_COORDS 0x0f
@@ -148,6 +149,8 @@ struct synaptics_hw_state {
148struct synaptics_data { 149struct synaptics_data {
149 /* Data read from the touchpad */ 150 /* Data read from the touchpad */
150 unsigned long int model_id; /* Model-ID */ 151 unsigned long int model_id; /* Model-ID */
152 unsigned long int firmware_id; /* Firmware-ID */
153 unsigned long int board_id; /* Board-ID */
151 unsigned long int capabilities; /* Capabilities */ 154 unsigned long int capabilities; /* Capabilities */
152 unsigned long int ext_cap; /* Extended Capabilities */ 155 unsigned long int ext_cap; /* Extended Capabilities */
153 unsigned long int ext_cap_0c; /* Ext Caps from 0x0c query */ 156 unsigned long int ext_cap_0c; /* Ext Caps from 0x0c query */