aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/synaptics.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-14 21:25:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-14 21:25:15 -0400
commit8691c130fae136bb2b7d0554422a2dff4c6ac169 (patch)
tree9c75c86ab04e66d756c55f37e594c3e27a2963d5 /drivers/input/mouse/synaptics.c
parentc3a416a669eb83cfa9ccb52db030e72d654bd105 (diff)
parent85a3685852d9ac7d92be9d824533c915a4597fa4 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input subsystem updates from Dmitry Torokhov: "You will get the following new drivers: - Qualcomm PM8941 power key drver - ChipOne icn8318 touchscreen controller driver - Broadcom iProc touchscreen and keypad drivers - Semtech SX8654 I2C touchscreen controller driver ALPS driver now supports newer SS4 devices; Elantech got a fix that should make it work on some ASUS laptops; and a slew of other enhancements and random fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (51 commits) Input: alps - non interleaved V2 dualpoint has separate stick button bits Input: alps - fix touchpad buttons getting stuck when used with trackpoint Input: atkbd - document "no new force-release quirks" policy Input: ALPS - make alps_get_pkt_id_ss4_v2() and others static Input: ALPS - V7 devices can report 5-finger taps Input: ALPS - add support for SS4 touchpad devices Input: ALPS - refactor alps_set_abs_params_mt() Input: elantech - fix absolute mode setting on some ASUS laptops Input: atmel_mxt_ts - split out touchpad initialisation logic Input: atmel_mxt_ts - implement support for T100 touch object Input: cros_ec_keyb - fix clearing keyboard state on wakeup Input: gscps2 - drop pci_ids dependency Input: synaptics - allocate 3 slots to keep stability in image sensors Input: Revert "Revert "synaptics - use dmax in input_mt_assign_slots"" Input: MT - make slot assignment work for overcovered solutions mfd: tc3589x: enforce device-tree only mode Input: tc3589x - localize platform data Input: tsc2007 - Convert msecs to jiffies only once Input: edt-ft5x06 - remove EV_SYN event report Input: edt-ft5x06 - allow to setting the maximum axes value through the DT ...
Diffstat (limited to 'drivers/input/mouse/synaptics.c')
-rw-r--r--drivers/input/mouse/synaptics.c42
1 files changed, 19 insertions, 23 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 3b06c8a360b6..630af73e98c4 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -67,6 +67,9 @@
67#define X_MAX_POSITIVE 8176 67#define X_MAX_POSITIVE 8176
68#define Y_MAX_POSITIVE 8176 68#define Y_MAX_POSITIVE 8176
69 69
70/* maximum ABS_MT_POSITION displacement (in mm) */
71#define DMAX 10
72
70/***************************************************************************** 73/*****************************************************************************
71 * Stuff we need even when we do not want native Synaptics support 74 * Stuff we need even when we do not want native Synaptics support
72 ****************************************************************************/ 75 ****************************************************************************/
@@ -203,6 +206,13 @@ static const char * const topbuttonpad_pnp_ids[] = {
203 NULL 206 NULL
204}; 207};
205 208
209/* This list has been kindly provided by Synaptics. */
210static const char * const forcepad_pnp_ids[] = {
211 "SYN300D",
212 "SYN3014",
213 NULL
214};
215
206/***************************************************************************** 216/*****************************************************************************
207 * Synaptics communications functions 217 * Synaptics communications functions
208 ****************************************************************************/ 218 ****************************************************************************/
@@ -687,8 +697,6 @@ static void synaptics_parse_ext_buttons(const unsigned char buf[],
687 hw->ext_buttons |= (buf[5] & ext_mask) << ext_bits; 697 hw->ext_buttons |= (buf[5] & ext_mask) << ext_bits;
688} 698}
689 699
690static bool is_forcepad;
691
692static int synaptics_parse_hw_state(const unsigned char buf[], 700static int synaptics_parse_hw_state(const unsigned char buf[],
693 struct synaptics_data *priv, 701 struct synaptics_data *priv,
694 struct synaptics_hw_state *hw) 702 struct synaptics_hw_state *hw)
@@ -718,7 +726,7 @@ static int synaptics_parse_hw_state(const unsigned char buf[],
718 hw->left = (buf[0] & 0x01) ? 1 : 0; 726 hw->left = (buf[0] & 0x01) ? 1 : 0;
719 hw->right = (buf[0] & 0x02) ? 1 : 0; 727 hw->right = (buf[0] & 0x02) ? 1 : 0;
720 728
721 if (is_forcepad) { 729 if (priv->is_forcepad) {
722 /* 730 /*
723 * ForcePads, like Clickpads, use middle button 731 * ForcePads, like Clickpads, use middle button
724 * bits to report primary button clicks. 732 * bits to report primary button clicks.
@@ -917,7 +925,7 @@ static void synaptics_report_mt_data(struct psmouse *psmouse,
917 pos[i].y = synaptics_invert_y(hw[i]->y); 925 pos[i].y = synaptics_invert_y(hw[i]->y);
918 } 926 }
919 927
920 input_mt_assign_slots(dev, slot, pos, nsemi, 0); 928 input_mt_assign_slots(dev, slot, pos, nsemi, DMAX * priv->x_res);
921 929
922 for (i = 0; i < nsemi; i++) { 930 for (i = 0; i < nsemi; i++) {
923 input_mt_slot(dev, slot[i]); 931 input_mt_slot(dev, slot[i]);
@@ -1186,7 +1194,7 @@ static void set_input_params(struct psmouse *psmouse,
1186 ABS_MT_POSITION_Y); 1194 ABS_MT_POSITION_Y);
1187 /* Image sensors can report per-contact pressure */ 1195 /* Image sensors can report per-contact pressure */
1188 input_set_abs_params(dev, ABS_MT_PRESSURE, 0, 255, 0, 0); 1196 input_set_abs_params(dev, ABS_MT_PRESSURE, 0, 255, 0, 0);
1189 input_mt_init_slots(dev, 2, INPUT_MT_POINTER | INPUT_MT_TRACK); 1197 input_mt_init_slots(dev, 3, INPUT_MT_POINTER | INPUT_MT_TRACK);
1190 1198
1191 /* Image sensors can signal 4 and 5 finger clicks */ 1199 /* Image sensors can signal 4 and 5 finger clicks */
1192 __set_bit(BTN_TOOL_QUADTAP, dev->keybit); 1200 __set_bit(BTN_TOOL_QUADTAP, dev->keybit);
@@ -1418,29 +1426,11 @@ static const struct dmi_system_id __initconst cr48_dmi_table[] = {
1418 { } 1426 { }
1419}; 1427};
1420 1428
1421static const struct dmi_system_id forcepad_dmi_table[] __initconst = {
1422#if defined(CONFIG_DMI) && defined(CONFIG_X86)
1423 {
1424 .matches = {
1425 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1426 DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook Folio 1040 G1"),
1427 },
1428 },
1429#endif
1430 { }
1431};
1432
1433void __init synaptics_module_init(void) 1429void __init synaptics_module_init(void)
1434{ 1430{
1435 impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table); 1431 impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table);
1436 broken_olpc_ec = dmi_check_system(olpc_dmi_table); 1432 broken_olpc_ec = dmi_check_system(olpc_dmi_table);
1437 cr48_profile_sensor = dmi_check_system(cr48_dmi_table); 1433 cr48_profile_sensor = dmi_check_system(cr48_dmi_table);
1438
1439 /*
1440 * Unfortunately ForcePad capability is not exported over PS/2,
1441 * so we have to resort to checking DMI.
1442 */
1443 is_forcepad = dmi_check_system(forcepad_dmi_table);
1444} 1434}
1445 1435
1446static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode) 1436static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode)
@@ -1475,6 +1465,12 @@ static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode)
1475 if (SYN_ID_DISGEST_SUPPORTED(priv->identity)) 1465 if (SYN_ID_DISGEST_SUPPORTED(priv->identity))
1476 priv->disable_gesture = true; 1466 priv->disable_gesture = true;
1477 1467
1468 /*
1469 * Unfortunately ForcePad capability is not exported over PS/2,
1470 * so we have to resort to checking PNP IDs.
1471 */
1472 priv->is_forcepad = psmouse_matches_pnp_id(psmouse, forcepad_pnp_ids);
1473
1478 if (synaptics_set_mode(psmouse)) { 1474 if (synaptics_set_mode(psmouse)) {
1479 psmouse_err(psmouse, "Unable to initialize device.\n"); 1475 psmouse_err(psmouse, "Unable to initialize device.\n");
1480 goto init_fail; 1476 goto init_fail;