diff options
author | Fernando Luis Vázquez Cao <fernando_b1@lab.ntt.co.jp> | 2013-01-22 01:20:38 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-01-22 05:06:24 -0500 |
commit | 99d249021abd4341771523ed8dd7946276103432 (patch) | |
tree | ff4d0c1c8fa4bdd19bb627aebc3c9789ce0b5844 /drivers/hid/hid-sony.c | |
parent | a464918419f94a0043d2f549d6defb4c3f69f68a (diff) |
HID: clean up quirk for Sony RF receivers
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).
Cc: linux-input@vger.kernel.org
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-sony.c')
-rw-r--r-- | drivers/hid/hid-sony.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 6d2d459e9a5a..9769c0030bcc 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c | |||
@@ -65,9 +65,19 @@ static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
65 | { | 65 | { |
66 | struct sony_sc *sc = hid_get_drvdata(hdev); | 66 | struct sony_sc *sc = hid_get_drvdata(hdev); |
67 | 67 | ||
68 | if ((sc->quirks & VAIO_RDESC_CONSTANT) && | 68 | /* |
69 | *rsize >= 56 && rdesc[54] == 0x81 && rdesc[55] == 0x07) { | 69 | * Some Sony RF receivers wrongly declare the mouse pointer as a |
70 | * a constant non-data variable. | ||
71 | */ | ||
72 | if ((sc->quirks & VAIO_RDESC_CONSTANT) && *rsize >= 56 && | ||
73 | /* usage page: generic desktop controls */ | ||
74 | /* rdesc[0] == 0x05 && rdesc[1] == 0x01 && */ | ||
75 | /* usage: mouse */ | ||
76 | rdesc[2] == 0x09 && rdesc[3] == 0x02 && | ||
77 | /* input (usage page for x,y axes): constant, variable, relative */ | ||
78 | rdesc[54] == 0x81 && rdesc[55] == 0x07) { | ||
70 | hid_info(hdev, "Fixing up Sony RF Receiver report descriptor\n"); | 79 | hid_info(hdev, "Fixing up Sony RF Receiver report descriptor\n"); |
80 | /* input: data, variable, relative */ | ||
71 | rdesc[55] = 0x06; | 81 | rdesc[55] = 0x06; |
72 | } | 82 | } |
73 | 83 | ||