diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-09-02 12:49:18 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-10-11 14:34:42 -0400 |
commit | aa972409951e0675e07918620427517cad5090e0 (patch) | |
tree | bcb20a458d327b5f242b139bc1af125097784c29 | |
parent | 9d93551188069a0a21e664b4bfc89ed4a6df1903 (diff) |
Input: synaptics - gate forcepad support by DMI check
Unfortunately, ForcePad capability is not actually exported over PS/2, so
we have to resort to DMI checks.
Cc: stable@vger.kernel.org
Reported-by: Nicole Faerber <nicole.faerber@kernelconcepts.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/mouse/synaptics.c | 22 | ||||
-rw-r--r-- | drivers/input/mouse/synaptics.h | 8 |
2 files changed, 23 insertions, 7 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 6394d9b5bfd3..9031a0a28ea4 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -607,6 +607,8 @@ static void synaptics_parse_agm(const unsigned char buf[], | |||
607 | priv->agm_pending = true; | 607 | priv->agm_pending = true; |
608 | } | 608 | } |
609 | 609 | ||
610 | static bool is_forcepad; | ||
611 | |||
610 | static int synaptics_parse_hw_state(const unsigned char buf[], | 612 | static int synaptics_parse_hw_state(const unsigned char buf[], |
611 | struct synaptics_data *priv, | 613 | struct synaptics_data *priv, |
612 | struct synaptics_hw_state *hw) | 614 | struct synaptics_hw_state *hw) |
@@ -636,7 +638,7 @@ static int synaptics_parse_hw_state(const unsigned char buf[], | |||
636 | hw->left = (buf[0] & 0x01) ? 1 : 0; | 638 | hw->left = (buf[0] & 0x01) ? 1 : 0; |
637 | hw->right = (buf[0] & 0x02) ? 1 : 0; | 639 | hw->right = (buf[0] & 0x02) ? 1 : 0; |
638 | 640 | ||
639 | if (SYN_CAP_FORCEPAD(priv->ext_cap_0c)) { | 641 | if (is_forcepad) { |
640 | /* | 642 | /* |
641 | * ForcePads, like Clickpads, use middle button | 643 | * ForcePads, like Clickpads, use middle button |
642 | * bits to report primary button clicks. | 644 | * bits to report primary button clicks. |
@@ -1667,11 +1669,29 @@ static const struct dmi_system_id __initconst cr48_dmi_table[] = { | |||
1667 | { } | 1669 | { } |
1668 | }; | 1670 | }; |
1669 | 1671 | ||
1672 | static const struct dmi_system_id forcepad_dmi_table[] __initconst = { | ||
1673 | #if defined(CONFIG_DMI) && defined(CONFIG_X86) | ||
1674 | { | ||
1675 | .matches = { | ||
1676 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
1677 | DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook Folio 1040 G1"), | ||
1678 | }, | ||
1679 | }, | ||
1680 | #endif | ||
1681 | { } | ||
1682 | }; | ||
1683 | |||
1670 | void __init synaptics_module_init(void) | 1684 | void __init synaptics_module_init(void) |
1671 | { | 1685 | { |
1672 | impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table); | 1686 | impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table); |
1673 | broken_olpc_ec = dmi_check_system(olpc_dmi_table); | 1687 | broken_olpc_ec = dmi_check_system(olpc_dmi_table); |
1674 | cr48_profile_sensor = dmi_check_system(cr48_dmi_table); | 1688 | cr48_profile_sensor = dmi_check_system(cr48_dmi_table); |
1689 | |||
1690 | /* | ||
1691 | * Unfortunately ForcePad capability is not exported over PS/2, | ||
1692 | * so we have to resort to checking DMI. | ||
1693 | */ | ||
1694 | is_forcepad = dmi_check_system(forcepad_dmi_table); | ||
1675 | } | 1695 | } |
1676 | 1696 | ||
1677 | static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode) | 1697 | static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode) |
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index fb2e076738ae..1bd01f21783b 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h | |||
@@ -77,12 +77,9 @@ | |||
77 | * for noise. | 77 | * for noise. |
78 | * 2 0x08 image sensor image sensor tracks 5 fingers, but only | 78 | * 2 0x08 image sensor image sensor tracks 5 fingers, but only |
79 | * reports 2. | 79 | * reports 2. |
80 | * 2 0x01 uniform clickpad whole clickpad moves instead of being | ||
81 | * hinged at the top. | ||
80 | * 2 0x20 report min query 0x0f gives min coord reported | 82 | * 2 0x20 report min query 0x0f gives min coord reported |
81 | * 2 0x80 forcepad forcepad is a variant of clickpad that | ||
82 | * does not have physical buttons but rather | ||
83 | * uses pressure above certain threshold to | ||
84 | * report primary clicks. Forcepads also have | ||
85 | * clickpad bit set. | ||
86 | */ | 83 | */ |
87 | #define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100000) /* 1-button ClickPad */ | 84 | #define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100000) /* 1-button ClickPad */ |
88 | #define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */ | 85 | #define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */ |
@@ -91,7 +88,6 @@ | |||
91 | #define SYN_CAP_ADV_GESTURE(ex0c) ((ex0c) & 0x080000) | 88 | #define SYN_CAP_ADV_GESTURE(ex0c) ((ex0c) & 0x080000) |
92 | #define SYN_CAP_REDUCED_FILTERING(ex0c) ((ex0c) & 0x000400) | 89 | #define SYN_CAP_REDUCED_FILTERING(ex0c) ((ex0c) & 0x000400) |
93 | #define SYN_CAP_IMAGE_SENSOR(ex0c) ((ex0c) & 0x000800) | 90 | #define SYN_CAP_IMAGE_SENSOR(ex0c) ((ex0c) & 0x000800) |
94 | #define SYN_CAP_FORCEPAD(ex0c) ((ex0c) & 0x008000) | ||
95 | 91 | ||
96 | /* synaptics modes query bits */ | 92 | /* synaptics modes query bits */ |
97 | #define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7)) | 93 | #define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7)) |