Skip to content

Commit aa97240

Browse files
committed
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>
1 parent 9d93551 commit aa97240

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

drivers/input/mouse/synaptics.c

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,8 @@ static void synaptics_parse_agm(const unsigned char buf[],
607607
priv->agm_pending = true;
608608
}
609609

610+
static bool is_forcepad;
611+
610612
static int synaptics_parse_hw_state(const unsigned char buf[],
611613
struct synaptics_data *priv,
612614
struct synaptics_hw_state *hw)
@@ -636,7 +638,7 @@ static int synaptics_parse_hw_state(const unsigned char buf[],
636638
hw->left = (buf[0] & 0x01) ? 1 : 0;
637639
hw->right = (buf[0] & 0x02) ? 1 : 0;
638640

639-
if (SYN_CAP_FORCEPAD(priv->ext_cap_0c)) {
641+
if (is_forcepad) {
640642
/*
641643
* ForcePads, like Clickpads, use middle button
642644
* bits to report primary button clicks.
@@ -1667,11 +1669,29 @@ static const struct dmi_system_id __initconst cr48_dmi_table[] = {
16671669
{ }
16681670
};
16691671

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+
16701684
void __init synaptics_module_init(void)
16711685
{
16721686
impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table);
16731687
broken_olpc_ec = dmi_check_system(olpc_dmi_table);
16741688
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);
16751695
}
16761696

16771697
static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode)

drivers/input/mouse/synaptics.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,9 @@
7777
* for noise.
7878
* 2 0x08 image sensor image sensor tracks 5 fingers, but only
7979
* reports 2.
80+
* 2 0x01 uniform clickpad whole clickpad moves instead of being
81+
* hinged at the top.
8082
* 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.
8683
*/
8784
#define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100000) /* 1-button ClickPad */
8885
#define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */
@@ -91,7 +88,6 @@
9188
#define SYN_CAP_ADV_GESTURE(ex0c) ((ex0c) & 0x080000)
9289
#define SYN_CAP_REDUCED_FILTERING(ex0c) ((ex0c) & 0x000400)
9390
#define SYN_CAP_IMAGE_SENSOR(ex0c) ((ex0c) & 0x000800)
94-
#define SYN_CAP_FORCEPAD(ex0c) ((ex0c) & 0x008000)
9591

9692
/* synaptics modes query bits */
9793
#define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7))

0 commit comments

Comments
 (0)