Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Daniel Kurtz and committed by
Dmitry Torokhov
c6bd9d46 98e4d4d6

+39 -2
+36 -2
drivers/input/mouse/synaptics.c
··· 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 + */ 145 + static 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 + */ 159 + static 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 171 * Read the capability-bits from the touchpad 143 172 * see also the SYN_CAP_* macros 144 173 */ ··· 289 260 if (synaptics_identify(psmouse)) 290 261 return -1; 291 262 if (synaptics_model_id(psmouse)) 263 + return -1; 264 + if (synaptics_firmware_id(psmouse)) 265 + return -1; 266 + if (synaptics_board_id(psmouse)) 292 267 return -1; 293 268 if (synaptics_capability(psmouse)) 294 269 return -1; ··· 1468 1435 priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS; 1469 1436 1470 1437 psmouse_info(psmouse, 1471 - "Touchpad model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx\n", 1438 + "Touchpad model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx, board id: %lu, fw id: %lu\n", 1472 1439 SYN_ID_MODEL(priv->identity), 1473 1440 SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity), 1474 1441 priv->model_id, 1475 - priv->capabilities, priv->ext_cap, priv->ext_cap_0c); 1442 + priv->capabilities, priv->ext_cap, priv->ext_cap_0c, 1443 + priv->board_id, priv->firmware_id); 1476 1444 1477 1445 set_input_params(psmouse->dev, priv); 1478 1446
+3
drivers/input/mouse/synaptics.h
··· 18 18 #define SYN_QUE_SERIAL_NUMBER_SUFFIX 0x07 19 19 #define SYN_QUE_RESOLUTION 0x08 20 20 #define SYN_QUE_EXT_CAPAB 0x09 21 + #define SYN_QUE_FIRMWARE_ID 0x0a 21 22 #define SYN_QUE_EXT_CAPAB_0C 0x0c 22 23 #define SYN_QUE_EXT_MAX_COORDS 0x0d 23 24 #define SYN_QUE_EXT_MIN_COORDS 0x0f ··· 149 148 struct synaptics_data { 150 149 /* Data read from the touchpad */ 151 150 unsigned long int model_id; /* Model-ID */ 151 + unsigned long int firmware_id; /* Firmware-ID */ 152 + unsigned long int board_id; /* Board-ID */ 152 153 unsigned long int capabilities; /* Capabilities */ 153 154 unsigned long int ext_cap; /* Extended Capabilities */ 154 155 unsigned long int ext_cap_0c; /* Ext Caps from 0x0c query */