[PATCH 3.16.y-ckt 015/126] HID: core: Avoid uninitialized buffer access

2015-12-09 Thread Luis Henriques
3.16.7-ckt21 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Richard Purdie <richard.pur...@linuxfoundation.org>

commit 79b568b9d0c7c5d81932f4486d50b38efdd6da6d upstream.

hid_connect adds various strings to the buffer but they're all
conditional. You can find circumstances where nothing would be written
to it but the kernel will still print the supposedly empty buffer with
printk. This leads to corruption on the console/in the logs.

Ensure buf is initialized to an empty string.

Signed-off-by: Richard Purdie <richard.pur...@linuxfoundation.org>
[dvhart: Initialize string to "" rather than assign buf[0] = NULL;]
Cc: Jiri Kosina <ji...@kernel.org>
Cc: linux-input@vger.kernel.org
Signed-off-by: Darren Hart <dvh...@linux.intel.com>
Signed-off-by: Jiri Kosina <jkos...@suse.cz>
Signed-off-by: Luis Henriques <luis.henriq...@canonical.com>
---
 drivers/hid/hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 5ed3a7b91b4c..fb16c812816a 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1561,7 +1561,7 @@ int hid_connect(struct hid_device *hdev, unsigned int 
connect_mask)
"Multi-Axis Controller"
};
const char *type, *bus;
-   char buf[64];
+   char buf[64] = "";
unsigned int i;
int len;
int ret;
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[3.16.y-ckt stable] Patch "HID: core: Avoid uninitialized buffer access" has been added to staging queue

2015-11-30 Thread Luis Henriques
This is a note to let you know that I have just added a patch titled

HID: core: Avoid uninitialized buffer access

to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree 
which can be found at:

http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.16.y-queue

This patch is scheduled to be released in version 3.16.7-ckt21.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

--

>From 2cbc310d70eb6aeb2c8289291f939e612ea5a830 Mon Sep 17 00:00:00 2001
From: Richard Purdie <richard.pur...@linuxfoundation.org>
Date: Fri, 18 Sep 2015 16:31:33 -0700
Subject: HID: core: Avoid uninitialized buffer access

commit 79b568b9d0c7c5d81932f4486d50b38efdd6da6d upstream.

hid_connect adds various strings to the buffer but they're all
conditional. You can find circumstances where nothing would be written
to it but the kernel will still print the supposedly empty buffer with
printk. This leads to corruption on the console/in the logs.

Ensure buf is initialized to an empty string.

Signed-off-by: Richard Purdie <richard.pur...@linuxfoundation.org>
[dvhart: Initialize string to "" rather than assign buf[0] = NULL;]
Cc: Jiri Kosina <ji...@kernel.org>
Cc: linux-input@vger.kernel.org
Signed-off-by: Darren Hart <dvh...@linux.intel.com>
Signed-off-by: Jiri Kosina <jkos...@suse.cz>
Signed-off-by: Luis Henriques <luis.henriq...@canonical.com>
---
 drivers/hid/hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 5ed3a7b91b4c..fb16c812816a 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1561,7 +1561,7 @@ int hid_connect(struct hid_device *hdev, unsigned int 
connect_mask)
"Multi-Axis Controller"
};
const char *type, *bus;
-   char buf[64];
+   char buf[64] = "";
unsigned int i;
int len;
int ret;
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] Input: i8042 - add mux quirk for HP EliteBook

2014-11-02 Thread Luis Henriques
On Fri, Oct 31, 2014 at 07:57:37PM -0700, Dmitry Torokhov wrote:
 On Tue, Oct 28, 2014 at 04:08:41PM -0700, Dmitry Torokhov wrote:
  On Tue, Oct 28, 2014 at 10:27:12PM +, Luis Henriques wrote:
   This laptop requires active multiplexing to be enabled in order to be able
   to separate the PS/2 mouse and the touchpad.
   
   Signed-off-by: Luis Henriques luis.henriq...@canonical.com
  
  Applied, thank you.
 
 Actually I am reverting the nomux patch, so unapplied ;)

That works for me as well :-)  Thanks!

Cheers,
--
Luís
--
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Input: i8042 - add mux quirk for HP EliteBook 8470p

2014-10-28 Thread Luis Henriques
This laptop requires active multiplexing to be enabled in order to be able
to separate the PS/2 mouse and the touchpad.

Signed-off-by: Luis Henriques luis.henriq...@canonical.com
---
 drivers/input/serio/i8042-x86ia64io.h | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/input/serio/i8042-x86ia64io.h 
b/drivers/input/serio/i8042-x86ia64io.h
index a0bcbb64d06d..34b95e4268eb 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -220,6 +220,13 @@ static const struct dmi_system_id __initconst 
i8042_dmi_mux_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, CF-18),
},
},
+   {
+   /* HP EliteBook 8470p */
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, Hewlett-Packard),
+   DMI_MATCH(DMI_PRODUCT_NAME, HP EliteBook 8470p),
+   },
+   },
{ }
 };
 
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [appleir] BUG: unable to handle kernel NULL pointer dereference

2013-11-22 Thread Luis Henriques
On Fri, Nov 22, 2013 at 01:39:47PM +0100, Jiri Kosina wrote:
 On Thu, 21 Nov 2013, Luis Henriques wrote:
 
Sorry for the delays in testing out the patch.  I have tried a kernel
with the patch applied, and can no longer reproduce the oops.  The
hid-appleir driver appears to be working correctly, generating key
press events in response to the remote, and LIRC functions correctly
via hiddev.

Thanks for the everyone's help with this.
   
   Applied, thanks.
  
  Hi Jiri,
  
  Since this fixes an issue in a 3.11 kernel, could you please tag this
  commit for stable=3.11?  If its too late, I can send the request to
  stable@ once this patch is merged.
 
 Thanks for noticing. It's too late to add the tag, so if you submit it to 
 -stable once it's in Linus' tree, I'll appreciate it; otherwise I'll try 
 to remember to do that myself.

Sure, no problem.  I'll keep an eye on this.

Cheers,
--
Luis
--
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [appleir] BUG: unable to handle kernel NULL pointer dereference

2013-11-21 Thread Luis Henriques
On Thu, Nov 21, 2013 at 09:59:27AM +0100, Jiri Kosina wrote:
 On Thu, 21 Nov 2013, James Henstridge wrote:
 
  Sorry for the delays in testing out the patch.  I have tried a kernel
  with the patch applied, and can no longer reproduce the oops.  The
  hid-appleir driver appears to be working correctly, generating key
  press events in response to the remote, and LIRC functions correctly
  via hiddev.
  
  Thanks for the everyone's help with this.
 
 Applied, thanks.

Hi Jiri,

Since this fixes an issue in a 3.11 kernel, could you please tag this
commit for stable=3.11?  If its too late, I can send the request to
stable@ once this patch is merged.

Cheers,
--
Luis
--
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[appleir] BUG: unable to handle kernel NULL pointer dereference

2013-10-29 Thread Luis Henriques
Hi,

James has reported a NULL pointer dereference[1] on the appleir
driver.  From the bug report[2] it looks like it is 100%
reproducible using a 3.12-rc6 kernel simply by pressing any button on
the IR remote.

From the stack trace, it looks like input_event is invoked with the
input_dev parameter set to NULL, which seems to indicate that
appleir_input_configured is never invoked.

Any ideas?

[1] https://launchpadlibrarian.net/154942024/macmini-oops.jpg
[2] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1244505

Cheers,
--
Luis
--
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][v3.2.y][v3.5.y][3.8.y] Input: elantech - fix for newer hardware versions (v7)

2013-08-05 Thread Luis Henriques
Joseph Salisbury joseph.salisb...@canonical.com writes:

 Hello,

 Please consider including upstream commit
 9eebed7de660c0b5ab129a9de4f89d20b60de68c in the next v3.2.y, v3.5.y and
 v3.8.y releases. 

 It was included upstream as of v3.11-rc1.  It has been tested and
 confirmed to resolve http://bugs.launchpad.net/bugs/1166442 .

 commit 9eebed7de660c0b5ab129a9de4f89d20b60de68c
 Author: Matteo Delfino kendats...@gmail.com
 Date:   Sat Jul 6 21:52:26 2013 -0700

 Input: elantech - fix for newer hardware versions (v7)


 Sincerely,
 Joseph Salisbury

 --
 To unsubscribe from this list: send the line unsubscribe stable in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

Thanks, I'm queuing it for the 3.5 kernel.

Cheers,
-- 
Luis
--
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 054/150] HID: clean up quirk for Sony RF receivers

2013-03-26 Thread Luis Henriques
3.5.7.9 -stable review patch.  If anyone has any objections, please let me know.

--

From: =?UTF-8?q?Fernando=20Luis=20V=C3=A1zquez=20Cao?=

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

Cc: linux-input@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Fernando Luis Vazquez Cao ferna...@oss.ntt.co.jp
Signed-off-by: Jiri Kosina jkos...@suse.cz
Signed-off-by: Luis Henriques luis.henriq...@canonical.com
---
 drivers/hid/hid-sony.c | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 963bda1..4142c21 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -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;
}
 
-- 
1.8.1.2

--
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 053/150] HID: add support for Sony RF receiver with USB product id 0x0374

2013-03-26 Thread Luis Henriques
3.5.7.9 -stable review patch.  If anyone has any objections, please let me know.

--

From: =?UTF-8?q?Fernando=20Luis=20V=C3=A1zquez=20Cao?=

commit a464918419f94a0043d2f549d6defb4c3f69f68a upstream.

Some Vaio desktop computers, among them the VGC-LN51JGB multimedia PC, have
a RF receiver, multi-interface USB device 054c:0374, that is used to connect
a wireless keyboard and a wireless mouse.

The keyboard works flawlessly, but the mouse (VGP-WMS3 in my case) does not
seem to be generating any pointer events. The problem is that the mouse pointer
is wrongly declared as a constant non-data variable in the report descriptor
(see lsusb and usbhid-dump output below), with the consequence that it is
ignored by the HID code.

Add this device to the have-special-driver list and fix up the report
descriptor in the Sony-specific driver which happens to already have a fixup
for a similar firmware bug.

Bus 003 Device 002: ID 054c:0374 Sony Corp.
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 8
  idVendor   0x054c Sony Corp.
  idProduct  0x0374
  iSerial 0
[...]
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber1
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass 3 Human Interface Device
  bInterfaceSubClass  1 Boot Interface Subclass
  bInterfaceProtocol  2 Mouse
  iInterface  2 RF Receiver
[...]
  Report Descriptor: (length is 100)
[...]
Item(Global): Usage Page, data= [ 0x01 ] 1
Generic Desktop Controls
Item(Local ): Usage, data= [ 0x30 ] 48
Direction-X
Item(Local ): Usage, data= [ 0x31 ] 49
Direction-Y
Item(Global): Report Count, data= [ 0x02 ] 2
Item(Global): Report Size, data= [ 0x08 ] 8
Item(Global): Logical Minimum, data= [ 0x81 ] 129
Item(Global): Logical Maximum, data= [ 0x7f ] 127
Item(Main  ): Input, data= [ 0x07 ] 7
Constant Variable Relative No_Wrap Linear
Preferred_State No_Null_Position Non_Volatile 
Bitfield

003:002:001:DESCRIPTOR 1357910009.758544
 05 01 09 02 A1 01 05 01 09 02 A1 02 85 01 09 01
 A1 00 05 09 19 01 29 05 95 05 75 01 15 00 25 01
 81 02 75 03 95 01 81 01 05 01 09 30 09 31 95 02
 75 08 15 81 25 7F 81 07 A1 02 85 01 09 38 35 00
 45 00 15 81 25 7F 95 01 75 08 81 06 C0 A1 02 85
 01 05 0C 15 81 25 7F 95 01 75 08 0A 38 02 81 06
 C0 C0 C0 C0

Cc: linux-input@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Fernando Luis Vazquez Cao ferna...@oss.ntt.co.jp
Signed-off-by: Jiri Kosina jkos...@suse.cz
[ luis: adjusted context ]
Signed-off-by: Luis Henriques luis.henriq...@canonical.com
---
 drivers/hid/hid-core.c | 1 +
 drivers/hid/hid-ids.h  | 1 +
 drivers/hid/hid-sony.c | 4 +++-
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 52bc936..2f85e59 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1641,6 +1641,7 @@ static const struct hid_device_id 
hid_have_special_driver[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, 
USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, 
USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) 
},
+   { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) 
},
{ HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) 
},
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) },
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index de39a12..c04eec3 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -684,6 +684,7 @@
 
 #define USB_VENDOR_ID_SONY 0x054c
 #define USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE  0x024b
+#define USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE  0x0374
 #define USB_DEVICE_ID_SONY_PS3_CONTROLLER  0x0268
 #define USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER   0x042f
 
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 5cd25bd..963bda1 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -46,7 +46,7 @@ static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 
*rdesc,
 
if ((sc-quirks  VAIO_RDESC_CONSTANT) 
*rsize = 56  rdesc[54] == 0x81  rdesc[55] == 0x07) 
{
-   hid_info(hdev, Fixing up Sony Vaio VGX report descriptor\n);
+   hid_info(hdev, Fixing

[ 3.5.y.z extended stable ] Patch HID: add support for Sony RF receiver with USB product id has been added to staging queue

2013-03-21 Thread Luis Henriques
This is a note to let you know that I have just added a patch titled

HID: add support for Sony RF receiver with USB product id

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:

 
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

--

From 751f9ee98fc9233840518f65f72a6232580c08ce Mon Sep 17 00:00:00 2001
From: Fernando Luis Vazquez Cao fernando...@lab.ntt.co.jp
Date: Tue, 15 Jan 2013 19:40:48 +0900
Subject: [PATCH] HID: add support for Sony RF receiver with USB product id
 0x0374

commit a464918419f94a0043d2f549d6defb4c3f69f68a upstream.

Some Vaio desktop computers, among them the VGC-LN51JGB multimedia PC, have
a RF receiver, multi-interface USB device 054c:0374, that is used to connect
a wireless keyboard and a wireless mouse.

The keyboard works flawlessly, but the mouse (VGP-WMS3 in my case) does not
seem to be generating any pointer events. The problem is that the mouse pointer
is wrongly declared as a constant non-data variable in the report descriptor
(see lsusb and usbhid-dump output below), with the consequence that it is
ignored by the HID code.

Add this device to the have-special-driver list and fix up the report
descriptor in the Sony-specific driver which happens to already have a fixup
for a similar firmware bug.

Bus 003 Device 002: ID 054c:0374 Sony Corp.
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 8
  idVendor   0x054c Sony Corp.
  idProduct  0x0374
  iSerial 0
[...]
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber1
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass 3 Human Interface Device
  bInterfaceSubClass  1 Boot Interface Subclass
  bInterfaceProtocol  2 Mouse
  iInterface  2 RF Receiver
[...]
  Report Descriptor: (length is 100)
[...]
Item(Global): Usage Page, data= [ 0x01 ] 1
Generic Desktop Controls
Item(Local ): Usage, data= [ 0x30 ] 48
Direction-X
Item(Local ): Usage, data= [ 0x31 ] 49
Direction-Y
Item(Global): Report Count, data= [ 0x02 ] 2
Item(Global): Report Size, data= [ 0x08 ] 8
Item(Global): Logical Minimum, data= [ 0x81 ] 129
Item(Global): Logical Maximum, data= [ 0x7f ] 127
Item(Main  ): Input, data= [ 0x07 ] 7
Constant Variable Relative No_Wrap Linear
Preferred_State No_Null_Position Non_Volatile 
Bitfield

003:002:001:DESCRIPTOR 1357910009.758544
 05 01 09 02 A1 01 05 01 09 02 A1 02 85 01 09 01
 A1 00 05 09 19 01 29 05 95 05 75 01 15 00 25 01
 81 02 75 03 95 01 81 01 05 01 09 30 09 31 95 02
 75 08 15 81 25 7F 81 07 A1 02 85 01 09 38 35 00
 45 00 15 81 25 7F 95 01 75 08 81 06 C0 A1 02 85
 01 05 0C 15 81 25 7F 95 01 75 08 0A 38 02 81 06
 C0 C0 C0 C0

Cc: linux-input@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Fernando Luis Vazquez Cao ferna...@oss.ntt.co.jp
Signed-off-by: Jiri Kosina jkos...@suse.cz
[ luis: adjusted context ]
Signed-off-by: Luis Henriques luis.henriq...@canonical.com
---
 drivers/hid/hid-core.c | 1 +
 drivers/hid/hid-ids.h  | 1 +
 drivers/hid/hid-sony.c | 4 +++-
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 52bc936..2f85e59 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1641,6 +1641,7 @@ static const struct hid_device_id 
hid_have_special_driver[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, 
USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, 
USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) 
},
+   { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) 
},
{ HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) 
},
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) },
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index de39a12..c04eec3 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -684,6 +684,7 @@

 #define USB_VENDOR_ID_SONY 0x054c
 #define USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE  0x024b
+#define

[ 3.5.y.z extended stable ] Patch HID: clean up quirk for Sony RF receivers has been added to staging queue

2013-03-21 Thread Luis Henriques
This is a note to let you know that I have just added a patch titled

HID: clean up quirk for Sony RF receivers

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:

 
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

--

From 1d7c6a65f33945a0354a4ffb93ff341b74719496 Mon Sep 17 00:00:00 2001
From: Fernando Luis Vazquez Cao fernando...@lab.ntt.co.jp
Date: Tue, 22 Jan 2013 15:20:38 +0900
Subject: [PATCH] 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).

Cc: linux-input@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Fernando Luis Vazquez Cao ferna...@oss.ntt.co.jp
Signed-off-by: Jiri Kosina jkos...@suse.cz
Signed-off-by: Luis Henriques luis.henriq...@canonical.com
---
 drivers/hid/hid-sony.c | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 963bda1..4142c21 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -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;
}

--
1.8.1.2
--
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html