|
|
80e48d0 |
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
|
|
|
80e48d0 |
Date: Sun, 8 Mar 2015 22:32:43 -0700
|
|
|
80e48d0 |
Subject: [PATCH] Input: synaptics - handle spurious release of trackstick
|
|
|
80e48d0 |
buttons
|
|
|
80e48d0 |
|
|
|
80e48d0 |
The Fimware 8.1 has a bug in which the extra buttons are only sent when the
|
|
|
80e48d0 |
ExtBit is 1. This should be fixed in a future FW update which should have
|
|
|
80e48d0 |
a bump of the minor version.
|
|
|
80e48d0 |
|
|
|
80e48d0 |
Cc: stable@vger.kernel.org
|
|
|
80e48d0 |
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
|
|
|
80e48d0 |
Acked-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
80e48d0 |
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
|
80e48d0 |
---
|
|
|
80e48d0 |
drivers/input/mouse/synaptics.c | 33 +++++++++++++++++++++++++--------
|
|
|
80e48d0 |
1 file changed, 25 insertions(+), 8 deletions(-)
|
|
|
80e48d0 |
|
|
|
80e48d0 |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
|
|
|
80e48d0 |
index f8df5a518bf3..bd399a72e610 100644
|
|
|
80e48d0 |
--- a/drivers/input/mouse/synaptics.c
|
|
|
80e48d0 |
+++ b/drivers/input/mouse/synaptics.c
|
|
|
80e48d0 |
@@ -812,14 +812,36 @@ static void synaptics_report_semi_mt_data(struct input_dev *dev,
|
|
|
80e48d0 |
}
|
|
|
80e48d0 |
}
|
|
|
80e48d0 |
|
|
|
80e48d0 |
-static void synaptics_report_buttons(struct psmouse *psmouse,
|
|
|
80e48d0 |
- const struct synaptics_hw_state *hw)
|
|
|
80e48d0 |
+static void synaptics_report_ext_buttons(struct psmouse *psmouse,
|
|
|
80e48d0 |
+ const struct synaptics_hw_state *hw)
|
|
|
80e48d0 |
{
|
|
|
80e48d0 |
struct input_dev *dev = psmouse->dev;
|
|
|
80e48d0 |
struct synaptics_data *priv = psmouse->private;
|
|
|
80e48d0 |
int ext_bits = (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) + 1) >> 1;
|
|
|
80e48d0 |
int i;
|
|
|
80e48d0 |
|
|
|
80e48d0 |
+ if (!SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap))
|
|
|
80e48d0 |
+ return;
|
|
|
80e48d0 |
+
|
|
|
80e48d0 |
+ /* Bug in FW 8.1, buttons are reported only when ExtBit is 1 */
|
|
|
80e48d0 |
+ if (SYN_ID_FULL(priv->identity) == 0x801 &&
|
|
|
80e48d0 |
+ !((psmouse->packet[0] ^ psmouse->packet[3]) & 0x02))
|
|
|
80e48d0 |
+ return;
|
|
|
80e48d0 |
+
|
|
|
80e48d0 |
+ for (i = 0; i < ext_bits; i++) {
|
|
|
80e48d0 |
+ input_report_key(dev, BTN_0 + 2 * i,
|
|
|
80e48d0 |
+ hw->ext_buttons & (1 << i));
|
|
|
80e48d0 |
+ input_report_key(dev, BTN_1 + 2 * i,
|
|
|
80e48d0 |
+ hw->ext_buttons & (1 << (i + ext_bits)));
|
|
|
80e48d0 |
+ }
|
|
|
80e48d0 |
+}
|
|
|
80e48d0 |
+
|
|
|
80e48d0 |
+static void synaptics_report_buttons(struct psmouse *psmouse,
|
|
|
80e48d0 |
+ const struct synaptics_hw_state *hw)
|
|
|
80e48d0 |
+{
|
|
|
80e48d0 |
+ struct input_dev *dev = psmouse->dev;
|
|
|
80e48d0 |
+ struct synaptics_data *priv = psmouse->private;
|
|
|
80e48d0 |
+
|
|
|
80e48d0 |
input_report_key(dev, BTN_LEFT, hw->left);
|
|
|
80e48d0 |
input_report_key(dev, BTN_RIGHT, hw->right);
|
|
|
80e48d0 |
|
|
|
80e48d0 |
@@ -831,12 +853,7 @@ static void synaptics_report_buttons(struct psmouse *psmouse,
|
|
|
80e48d0 |
input_report_key(dev, BTN_BACK, hw->down);
|
|
|
80e48d0 |
}
|
|
|
80e48d0 |
|
|
|
80e48d0 |
- for (i = 0; i < ext_bits; i++) {
|
|
|
80e48d0 |
- input_report_key(dev, BTN_0 + 2 * i,
|
|
|
80e48d0 |
- hw->ext_buttons & (1 << i));
|
|
|
80e48d0 |
- input_report_key(dev, BTN_1 + 2 * i,
|
|
|
80e48d0 |
- hw->ext_buttons & (1 << (i + ext_bits)));
|
|
|
80e48d0 |
- }
|
|
|
80e48d0 |
+ synaptics_report_ext_buttons(psmouse, hw);
|
|
|
80e48d0 |
}
|
|
|
80e48d0 |
|
|
|
80e48d0 |
static void synaptics_report_mt_data(struct psmouse *psmouse,
|
|
|
80e48d0 |
--
|
|
|
80e48d0 |
2.1.0
|
|
|
80e48d0 |
|