aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2014-12-29 17:43:44 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-03-06 14:25:32 -0500
commitde4e374b401a736a2c278babe99b94756060d0e8 (patch)
treef0fe075ac130976e35c6a5eac5f7ec3e3b081d2e /drivers/input
parent99e14c1e23108c34c4216d68c488fcd937310c32 (diff)
Input: synaptics - switch ForcePad detection to PNP IDs
According to Synaptics devices with ForcePads use SYN300D and SYN3014 as PNP IDs, so let's switch from DMI-bases detection scheme to PNP-based one, which should be more reliable. Suggested-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/mouse/synaptics.c35
-rw-r--r--drivers/input/mouse/synaptics.h1
2 files changed, 15 insertions, 21 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index f2cceb6493a0..4c69e3304011 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -194,6 +194,13 @@ static const char * const topbuttonpad_pnp_ids[] = {
194 NULL 194 NULL
195}; 195};
196 196
197/* This list has been kindly provided by Synaptics. */
198static const char * const forcepad_pnp_ids[] = {
199 "SYN300D",
200 "SYN3014",
201 NULL
202};
203
197/***************************************************************************** 204/*****************************************************************************
198 * Synaptics communications functions 205 * Synaptics communications functions
199 ****************************************************************************/ 206 ****************************************************************************/
@@ -605,8 +612,6 @@ static void synaptics_parse_agm(const unsigned char buf[],
605 } 612 }
606} 613}
607 614
608static bool is_forcepad;
609
610static int synaptics_parse_hw_state(const unsigned char buf[], 615static int synaptics_parse_hw_state(const unsigned char buf[],
611 struct synaptics_data *priv, 616 struct synaptics_data *priv,
612 struct synaptics_hw_state *hw) 617 struct synaptics_hw_state *hw)
@@ -636,7 +641,7 @@ static int synaptics_parse_hw_state(const unsigned char buf[],
636 hw->left = (buf[0] & 0x01) ? 1 : 0; 641 hw->left = (buf[0] & 0x01) ? 1 : 0;
637 hw->right = (buf[0] & 0x02) ? 1 : 0; 642 hw->right = (buf[0] & 0x02) ? 1 : 0;
638 643
639 if (is_forcepad) { 644 if (priv->is_forcepad) {
640 /* 645 /*
641 * ForcePads, like Clickpads, use middle button 646 * ForcePads, like Clickpads, use middle button
642 * bits to report primary button clicks. 647 * bits to report primary button clicks.
@@ -1311,29 +1316,11 @@ static const struct dmi_system_id __initconst cr48_dmi_table[] = {
1311 { } 1316 { }
1312}; 1317};
1313 1318
1314static const struct dmi_system_id forcepad_dmi_table[] __initconst = {
1315#if defined(CONFIG_DMI) && defined(CONFIG_X86)
1316 {
1317 .matches = {
1318 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1319 DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook Folio 1040 G1"),
1320 },
1321 },
1322#endif
1323 { }
1324};
1325
1326void __init synaptics_module_init(void) 1319void __init synaptics_module_init(void)
1327{ 1320{
1328 impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table); 1321 impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table);
1329 broken_olpc_ec = dmi_check_system(olpc_dmi_table); 1322 broken_olpc_ec = dmi_check_system(olpc_dmi_table);
1330 cr48_profile_sensor = dmi_check_system(cr48_dmi_table); 1323 cr48_profile_sensor = dmi_check_system(cr48_dmi_table);
1331
1332 /*
1333 * Unfortunately ForcePad capability is not exported over PS/2,
1334 * so we have to resort to checking DMI.
1335 */
1336 is_forcepad = dmi_check_system(forcepad_dmi_table);
1337} 1324}
1338 1325
1339static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode) 1326static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode)
@@ -1368,6 +1355,12 @@ static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode)
1368 if (SYN_ID_DISGEST_SUPPORTED(priv->identity)) 1355 if (SYN_ID_DISGEST_SUPPORTED(priv->identity))
1369 priv->disable_gesture = true; 1356 priv->disable_gesture = true;
1370 1357
1358 /*
1359 * Unfortunately ForcePad capability is not exported over PS/2,
1360 * so we have to resort to checking PNP IDs.
1361 */
1362 priv->is_forcepad = psmouse_matches_pnp_id(psmouse, forcepad_pnp_ids);
1363
1371 if (synaptics_set_mode(psmouse)) { 1364 if (synaptics_set_mode(psmouse)) {
1372 psmouse_err(psmouse, "Unable to initialize device.\n"); 1365 psmouse_err(psmouse, "Unable to initialize device.\n");
1373 goto init_fail; 1366 goto init_fail;
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
index aedc3299b14e..fb3838ca28de 100644
--- a/drivers/input/mouse/synaptics.h
+++ b/drivers/input/mouse/synaptics.h
@@ -168,6 +168,7 @@ struct synaptics_data {
168 unsigned long press_start; 168 unsigned long press_start;
169 bool press; 169 bool press;
170 bool report_press; 170 bool report_press;
171 bool is_forcepad;
171}; 172};
172 173
173void synaptics_module_init(void); 174void synaptics_module_init(void);