summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernando Luis Vázquez Cao <fernando_b1@lab.ntt.co.jp>2013-01-22 15:20:38 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-04 06:03:38 +0800
commitd62365d15278c2e3bdd17b413620264c74590ee6 (patch)
tree1da492fa4fb679fd1abb3bb43c413cfe51e9a9fc
parent9637341b0dc61b1f541e6eeb8dd2dfee3c9c8245 (diff)
downloadlinux-stable-d62365d15278c2e3bdd17b413620264c74590ee6.tar.gz
linux-stable-d62365d15278c2e3bdd17b413620264c74590ee6.tar.bz2
linux-stable-d62365d15278c2e3bdd17b413620264c74590ee6.zip
HID: clean up quirk for Sony RF receivers
commit 99d249021abd4341771523ed8dd7946276103432 upstream. Document what the fix-up is does and make it more robust by ensuring that it is only applied to the USB interface that corresponds to the mouse (sony_report_fixup() is called once per interface during probing). Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/hid/hid-sony.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 26eed0232316..126d6aed0021 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -43,9 +43,19 @@ static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
{
struct sony_sc *sc = hid_get_drvdata(hdev);
- if ((sc->quirks & VAIO_RDESC_CONSTANT) &&
- *rsize >= 56 && rdesc[54] == 0x81 && rdesc[55] == 0x07) {
+ /*
+ * Some Sony RF receivers wrongly declare the mouse pointer as a
+ * a constant non-data variable.
+ */
+ if ((sc->quirks & VAIO_RDESC_CONSTANT) && *rsize >= 56 &&
+ /* usage page: generic desktop controls */
+ /* rdesc[0] == 0x05 && rdesc[1] == 0x01 && */
+ /* usage: mouse */
+ rdesc[2] == 0x09 && rdesc[3] == 0x02 &&
+ /* input (usage page for x,y axes): constant, variable, relative */
+ rdesc[54] == 0x81 && rdesc[55] == 0x07) {
hid_info(hdev, "Fixing up Sony RF Receiver report descriptor\n");
+ /* input: data, variable, relative */
rdesc[55] = 0x06;
}