mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
HID: clean up quirk for Sony RF receivers
commit 99d249021a
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).
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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8d49f9035f
commit
7d02a653f1
1 changed files with 12 additions and 2 deletions
|
@ -44,9 +44,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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue