summaryrefslogtreecommitdiffstats
path: root/Input-synaptics-handle-spurious-release-of-trackstic.patch
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@fedoraproject.org>2015-03-11 09:17:47 -0400
committerJosh Boyer <jwboyer@fedoraproject.org>2015-03-11 09:18:03 -0400
commit80e48d0c7e8aced5df19d369961137f58ba97811 (patch)
treed9d7ddc5037d2b2b4189551f3846a868531fec33 /Input-synaptics-handle-spurious-release-of-trackstic.patch
parent73947052943a62125227728baddc88ef6934ae9d (diff)
downloadkernel-80e48d0c7e8aced5df19d369961137f58ba97811.tar.gz
kernel-80e48d0c7e8aced5df19d369961137f58ba97811.tar.xz
kernel-80e48d0c7e8aced5df19d369961137f58ba97811.zip
Patch series to fix Lenovo *40 and Carbon X1 touchpads (rhbz 1200777 1200778)
Diffstat (limited to 'Input-synaptics-handle-spurious-release-of-trackstic.patch')
-rw-r--r--Input-synaptics-handle-spurious-release-of-trackstic.patch77
1 files changed, 77 insertions, 0 deletions
diff --git a/Input-synaptics-handle-spurious-release-of-trackstic.patch b/Input-synaptics-handle-spurious-release-of-trackstic.patch
new file mode 100644
index 000000000..952d44c2e
--- /dev/null
+++ b/Input-synaptics-handle-spurious-release-of-trackstic.patch
@@ -0,0 +1,77 @@
+From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Date: Sun, 8 Mar 2015 22:32:43 -0700
+Subject: [PATCH] Input: synaptics - handle spurious release of trackstick
+ buttons
+
+The Fimware 8.1 has a bug in which the extra buttons are only sent when the
+ExtBit is 1. This should be fixed in a future FW update which should have
+a bump of the minor version.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Acked-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+---
+ drivers/input/mouse/synaptics.c | 33 +++++++++++++++++++++++++--------
+ 1 file changed, 25 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
+index f8df5a518bf3..bd399a72e610 100644
+--- a/drivers/input/mouse/synaptics.c
++++ b/drivers/input/mouse/synaptics.c
+@@ -812,14 +812,36 @@ static void synaptics_report_semi_mt_data(struct input_dev *dev,
+ }
+ }
+
+-static void synaptics_report_buttons(struct psmouse *psmouse,
+- const struct synaptics_hw_state *hw)
++static void synaptics_report_ext_buttons(struct psmouse *psmouse,
++ const struct synaptics_hw_state *hw)
+ {
+ struct input_dev *dev = psmouse->dev;
+ struct synaptics_data *priv = psmouse->private;
+ int ext_bits = (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) + 1) >> 1;
+ int i;
+
++ if (!SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap))
++ return;
++
++ /* Bug in FW 8.1, buttons are reported only when ExtBit is 1 */
++ if (SYN_ID_FULL(priv->identity) == 0x801 &&
++ !((psmouse->packet[0] ^ psmouse->packet[3]) & 0x02))
++ return;
++
++ for (i = 0; i < ext_bits; i++) {
++ input_report_key(dev, BTN_0 + 2 * i,
++ hw->ext_buttons & (1 << i));
++ input_report_key(dev, BTN_1 + 2 * i,
++ hw->ext_buttons & (1 << (i + ext_bits)));
++ }
++}
++
++static void synaptics_report_buttons(struct psmouse *psmouse,
++ const struct synaptics_hw_state *hw)
++{
++ struct input_dev *dev = psmouse->dev;
++ struct synaptics_data *priv = psmouse->private;
++
+ input_report_key(dev, BTN_LEFT, hw->left);
+ input_report_key(dev, BTN_RIGHT, hw->right);
+
+@@ -831,12 +853,7 @@ static void synaptics_report_buttons(struct psmouse *psmouse,
+ input_report_key(dev, BTN_BACK, hw->down);
+ }
+
+- for (i = 0; i < ext_bits; i++) {
+- input_report_key(dev, BTN_0 + 2 * i,
+- hw->ext_buttons & (1 << i));
+- input_report_key(dev, BTN_1 + 2 * i,
+- hw->ext_buttons & (1 << (i + ext_bits)));
+- }
++ synaptics_report_ext_buttons(psmouse, hw);
+ }
+
+ static void synaptics_report_mt_data(struct psmouse *psmouse,
+--
+2.1.0
+