|
Chuck Ebbert |
a2573a1 |
From 35d851df23b093ee027f827fed2213ae5e88fc7a Mon Sep 17 00:00:00 2001
|
|
Chuck Ebbert |
a2573a1 |
From: Jiri Kosina <jkosina@suse.cz>
|
|
Chuck Ebbert |
a2573a1 |
Date: Thu, 25 Aug 2011 14:21:37 +0200
|
|
Chuck Ebbert |
a2573a1 |
Subject: [PATCH] HID: magicmouse: ignore 'ivalid report id' while switching
|
|
Chuck Ebbert |
a2573a1 |
modes, v2
|
|
Chuck Ebbert |
a2573a1 |
|
|
Chuck Ebbert |
a2573a1 |
This is basically a more generic respin of 23746a6 ("HID: magicmouse: ignore
|
|
Chuck Ebbert |
a2573a1 |
'ivalid report id' while switching modes") which got reverted later by
|
|
Chuck Ebbert |
a2573a1 |
c3a492.
|
|
Chuck Ebbert |
a2573a1 |
|
|
Chuck Ebbert |
a2573a1 |
It turns out that on some configurations, this is actually still the case
|
|
Chuck Ebbert |
a2573a1 |
and we are not able to detect in runtime.
|
|
Chuck Ebbert |
a2573a1 |
|
|
Chuck Ebbert |
a2573a1 |
The device reponds with 'invalid report id' when feature report switching it
|
|
Chuck Ebbert |
a2573a1 |
into multitouch mode is sent to it.
|
|
Chuck Ebbert |
a2573a1 |
|
|
Chuck Ebbert |
a2573a1 |
This has been silently ignored before 0825411ade ("HID: bt: Wait for ACK
|
|
Chuck Ebbert |
a2573a1 |
on Sent Reports"), but since this commit, it propagates -EIO from the _raw
|
|
Chuck Ebbert |
a2573a1 |
callback .
|
|
Chuck Ebbert |
a2573a1 |
|
|
Chuck Ebbert |
a2573a1 |
So let the driver ignore -EIO as response to 0xd7,0x01 report, as that's
|
|
Chuck Ebbert |
a2573a1 |
how the device reacts in normal mode.
|
|
Chuck Ebbert |
a2573a1 |
|
|
Chuck Ebbert |
a2573a1 |
Sad, but following reality.
|
|
Chuck Ebbert |
a2573a1 |
|
|
Chuck Ebbert |
a2573a1 |
This fixes https://bugzilla.kernel.org/show_bug.cgi?id=35022
|
|
Chuck Ebbert |
a2573a1 |
|
|
Chuck Ebbert |
a2573a1 |
Reported-by: Chase Douglas <chase.douglas@canonical.com>
|
|
Chuck Ebbert |
a2573a1 |
Reported-by: Jaikumar Ganesh <jaikumarg@android.com>
|
|
Chuck Ebbert |
a2573a1 |
Tested-by: Chase Douglas <chase.douglas@canonical.com>
|
|
Chuck Ebbert |
a2573a1 |
Tested-by: Jaikumar Ganesh <jaikumarg@android.com>
|
|
Chuck Ebbert |
a2573a1 |
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
|
|
Chuck Ebbert |
a2573a1 |
---
|
|
Chuck Ebbert |
a2573a1 |
drivers/hid/hid-magicmouse.c | 10 +++++++++-
|
|
Chuck Ebbert |
a2573a1 |
1 files changed, 9 insertions(+), 1 deletions(-)
|
|
Chuck Ebbert |
a2573a1 |
|
|
Chuck Ebbert |
a2573a1 |
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
|
|
Chuck Ebbert |
a2573a1 |
index b5bdab3..f0fbd7b 100644
|
|
Chuck Ebbert |
a2573a1 |
--- a/drivers/hid/hid-magicmouse.c
|
|
Chuck Ebbert |
a2573a1 |
+++ b/drivers/hid/hid-magicmouse.c
|
|
Chuck Ebbert |
a2573a1 |
@@ -537,9 +537,17 @@ static int magicmouse_probe(struct hid_device *hdev,
|
|
Chuck Ebbert |
a2573a1 |
}
|
|
Chuck Ebbert |
a2573a1 |
report->size = 6;
|
|
Chuck Ebbert |
a2573a1 |
|
|
Chuck Ebbert |
a2573a1 |
+ /*
|
|
Chuck Ebbert |
a2573a1 |
+ * Some devices repond with 'invalid report id' when feature
|
|
Chuck Ebbert |
a2573a1 |
+ * report switching it into multitouch mode is sent to it.
|
|
Chuck Ebbert |
a2573a1 |
+ *
|
|
Chuck Ebbert |
a2573a1 |
+ * This results in -EIO from the _raw low-level transport callback,
|
|
Chuck Ebbert |
a2573a1 |
+ * but there seems to be no other way of switching the mode.
|
|
Chuck Ebbert |
a2573a1 |
+ * Thus the super-ugly hacky success check below.
|
|
Chuck Ebbert |
a2573a1 |
+ */
|
|
Chuck Ebbert |
a2573a1 |
ret = hdev->hid_output_raw_report(hdev, feature, sizeof(feature),
|
|
Chuck Ebbert |
a2573a1 |
HID_FEATURE_REPORT);
|
|
Chuck Ebbert |
a2573a1 |
- if (ret != sizeof(feature)) {
|
|
Chuck Ebbert |
a2573a1 |
+ if (ret != -EIO && ret != sizeof(feature)) {
|
|
Chuck Ebbert |
a2573a1 |
hid_err(hdev, "unable to request touch data (%d)\n", ret);
|
|
Chuck Ebbert |
a2573a1 |
goto err_stop_hw;
|
|
Chuck Ebbert |
a2573a1 |
}
|
|
Chuck Ebbert |
a2573a1 |
--
|
|
Chuck Ebbert |
a2573a1 |
1.7.5.4
|
|
Chuck Ebbert |
a2573a1 |
|