linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Fernando Luis Vázquez Cao" <fernando_b1@lab.ntt.co.jp>
To: Jiri Kosina <jkosina@suse.cz>
Cc: linux-input@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Antonio Ospite <ospite@studenti.unina.it>
Subject: HID: clean up quirk for Sony RF receivers
Date: Tue, 22 Jan 2013 15:20:38 +0900	[thread overview]
Message-ID: <1358835638.6336.1.camel@nexus.lab.ntt.co.jp> (raw)
In-Reply-To: <50FE2A34.3050607@lab.ntt.co.jp>

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>
---

diff -urNp linux-3.8-rc4-orig/drivers/hid/hid-sony.c linux-3.8-rc4/drivers/hid/hid-sony.c
--- linux-3.8-rc4-orig/drivers/hid/hid-sony.c	2013-01-22 14:21:13.380552283 +0900
+++ linux-3.8-rc4/drivers/hid/hid-sony.c	2013-01-22 14:41:56.316934002 +0900
@@ -43,9 +43,19 @@ static __u8 *sony_report_fixup(struct hi
 {
 	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;
 	}
 



  reply	other threads:[~2013-01-22  6:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-15  3:43 [PATCH] HID: add support for Sony RF receiver with USB product id 0x0374 Fernando Luis Vázquez Cao
2013-01-15  9:36 ` Antonio Ospite
2013-01-15 10:03   ` Fernando Luis Vazquez Cao
2013-01-15 10:40     ` [PATCH v2] " Fernando Luis Vázquez Cao
2013-01-15 16:02       ` Jiri Kosina
2013-01-16  5:17         ` Fernando Luis Vazquez Cao
2013-01-16 10:44           ` Jiri Kosina
     [not found]             ` <alpine.LNX.2.00.1301161141250.14768-ztGlSCb7Y1iN3ZZ/Hiejyg@public.gmane.org>
2013-01-22  5:57               ` Fernando Luis Vazquez Cao
2013-01-22  6:20                 ` Fernando Luis Vázquez Cao [this message]
2013-01-22 10:08                   ` HID: clean up quirk for Sony RF receivers Jiri Kosina
2013-01-22 10:04                 ` [PATCH v2] HID: add support for Sony RF receiver with USB product id 0x0374 Jiri Kosina
2013-05-01  0:25         ` Fernando Luis Vázquez Cao
2013-05-01  0:26           ` [PATCH] HID: fix botched tree merge that disabled fix-up for certain Sony RF receivers Fernando Luis Vázquez Cao
2013-05-01 12:59             ` Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1358835638.6336.1.camel@nexus.lab.ntt.co.jp \
    --to=fernando_b1@lab.ntt.co.jp \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ospite@studenti.unina.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).