All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] HID: add support for Sony RF receiver with USB product id 0x0374
@ 2013-01-15  3:43 Fernando Luis Vázquez Cao
  2013-01-15  9:36   ` Antonio Ospite
  0 siblings, 1 reply; 21+ messages in thread
From: Fernando Luis Vázquez Cao @ 2013-01-15  3:43 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input, linux-usb, linux-kernel

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

# lsusb -vd 054C:0374
Bus 003 Device 002: ID 054c:0374 Sony Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x054c Sony Corp.
  idProduct          0x0374
  iSerial                 0
[...]
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      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

# sudo usbhid-dump

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-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
---

diff -urNp linux-3.8-rc3-orig/drivers/hid/hid-core.c linux-3.8-rc3/drivers/hid/hid-core.c
--- linux-3.8-rc3-orig/drivers/hid/hid-core.c	2013-01-13 20:54:36.846952518 +0900
+++ linux-3.8-rc3/drivers/hid/hid-core.c	2013-01-13 18:21:19.901347327 +0900
@@ -1697,6 +1697,7 @@ static const struct hid_device_id hid_ha
 	{ 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 -urNp linux-3.8-rc3-orig/drivers/hid/hid-ids.h linux-3.8-rc3/drivers/hid/hid-ids.h
--- linux-3.8-rc3-orig/drivers/hid/hid-ids.h	2013-01-13 20:54:36.850952537 +0900
+++ linux-3.8-rc3/drivers/hid/hid-ids.h	2013-01-13 18:21:19.901347327 +0900
@@ -706,6 +706,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_BDREMOTE		0x0306
 #define USB_DEVICE_ID_SONY_PS3_CONTROLLER	0x0268
 #define USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER	0x042f
diff -urNp linux-3.8-rc3-orig/drivers/hid/hid-sony.c linux-3.8-rc3/drivers/hid/hid-sony.c
--- linux-3.8-rc3-orig/drivers/hid/hid-sony.c	2012-12-11 12:30:57.000000000 +0900
+++ linux-3.8-rc3/drivers/hid/hid-sony.c	2013-01-13 18:21:19.901347327 +0900
@@ -44,19 +44,21 @@ 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) {
-		hid_info(hdev, "Fixing up Sony Vaio VGX report descriptor\n");
+	    *rsize >= 56 && rdesc[54] == 0x81 && rdesc[55] == 0x07) {
+		hid_info(hdev,
+		         "Fixing up Sony RF Receiver report descriptor\n");
 		rdesc[55] = 0x06;
 	}
 
 	/* The HID descriptor exposed over BT has a trailing zero byte */
 	if ((((sc->quirks & SIXAXIS_CONTROLLER_USB) && *rsize == 148) ||
-			((sc->quirks & SIXAXIS_CONTROLLER_BT) && *rsize == 149)) &&
-			rdesc[83] == 0x75) {
+	        ((sc->quirks & SIXAXIS_CONTROLLER_BT) && *rsize == 149)) &&
+	    rdesc[83] == 0x75) {
 		hid_info(hdev, "Fixing up Sony Sixaxis report descriptor\n");
 		memcpy((void *)&rdesc[83], (void *)&sixaxis_rdesc_fixup,
 			sizeof(sixaxis_rdesc_fixup));
 	}
+
 	return rdesc;
 }
 
@@ -217,6 +219,8 @@ static const struct hid_device_id sony_d
 		.driver_data = SIXAXIS_CONTROLLER_BT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE),
 		.driver_data = VAIO_RDESC_CONSTANT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE),
+		.driver_data = VAIO_RDESC_CONSTANT },
 	{ }
 };
 MODULE_DEVICE_TABLE(hid, sony_devices);



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] HID: add support for Sony RF receiver with USB product id 0x0374
  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
  0 siblings, 0 replies; 21+ messages in thread
From: Antonio Ospite @ 2013-01-15  9:36 UTC (permalink / raw)
  To: Fernando Luis Vázquez Cao
  Cc: Jiri Kosina, linux-input, linux-usb, linux-kernel

On Tue, 15 Jan 2013 12:43:48 +0900
Fernando Luis Vázquez Cao  <fernando_b1@lab.ntt.co.jp> wrote:

Hi Fernando,

> 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 consenquence that it is

typo: consequence

> 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.
> 
> # lsusb -vd 054C:0374
> Bus 003 Device 002: ID 054c:0374 Sony Corp.
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               2.00
>   bDeviceClass            0 (Defined at Interface level)
>   bDeviceSubClass         0
>   bDeviceProtocol         0
>   bMaxPacketSize0         8
>   idVendor           0x054c Sony Corp.
>   idProduct          0x0374
>   iSerial                 0
> [...]
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       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
> 
> # sudo usbhid-dump
> 
> 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-usb@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> ---
> 
> diff -urNp linux-3.8-rc3-orig/drivers/hid/hid-core.c linux-3.8-rc3/drivers/hid/hid-core.c
> --- linux-3.8-rc3-orig/drivers/hid/hid-core.c	2013-01-13 20:54:36.846952518 +0900
> +++ linux-3.8-rc3/drivers/hid/hid-core.c	2013-01-13 18:21:19.901347327 +0900
> @@ -1697,6 +1697,7 @@ static const struct hid_device_id hid_ha
>  	{ 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 -urNp linux-3.8-rc3-orig/drivers/hid/hid-ids.h linux-3.8-rc3/drivers/hid/hid-ids.h
> --- linux-3.8-rc3-orig/drivers/hid/hid-ids.h	2013-01-13 20:54:36.850952537 +0900
> +++ linux-3.8-rc3/drivers/hid/hid-ids.h	2013-01-13 18:21:19.901347327 +0900
> @@ -706,6 +706,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_BDREMOTE		0x0306
>  #define USB_DEVICE_ID_SONY_PS3_CONTROLLER	0x0268
>  #define USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER	0x042f
> diff -urNp linux-3.8-rc3-orig/drivers/hid/hid-sony.c linux-3.8-rc3/drivers/hid/hid-sony.c
> --- linux-3.8-rc3-orig/drivers/hid/hid-sony.c	2012-12-11 12:30:57.000000000 +0900
> +++ linux-3.8-rc3/drivers/hid/hid-sony.c	2013-01-13 18:21:19.901347327 +0900
> @@ -44,19 +44,21 @@ 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) {
> -		hid_info(hdev, "Fixing up Sony Vaio VGX report descriptor\n");
> +	    *rsize >= 56 && rdesc[54] == 0x81 && rdesc[55] == 0x07) {
> +		hid_info(hdev,
> +		         "Fixing up Sony RF Receiver report descriptor\n");

Changing the message does make sense, but try to avoid mixing
functional changes with style changes (I am referring to the change of
indentation here).

If you _really_ want to change the style send a separate patch stating
clearly in the commit message that there are no functionality changes.

This makes the review easier for both kind of patches.

>  		rdesc[55] = 0x06;
>  	}
>  
>  	/* The HID descriptor exposed over BT has a trailing zero byte */
>  	if ((((sc->quirks & SIXAXIS_CONTROLLER_USB) && *rsize == 148) ||
> -			((sc->quirks & SIXAXIS_CONTROLLER_BT) && *rsize == 149)) &&
> -			rdesc[83] == 0x75) {
> +	        ((sc->quirks & SIXAXIS_CONTROLLER_BT) && *rsize == 149)) &&
> +	    rdesc[83] == 0x75) {

Ditto, style changes.

>  		hid_info(hdev, "Fixing up Sony Sixaxis report descriptor\n");
>  		memcpy((void *)&rdesc[83], (void *)&sixaxis_rdesc_fixup,
>  			sizeof(sixaxis_rdesc_fixup));
>  	}
> +

Ditto.

>  	return rdesc;
>  }
>  
> @@ -217,6 +219,8 @@ static const struct hid_device_id sony_d
>  		.driver_data = SIXAXIS_CONTROLLER_BT },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE),
>  		.driver_data = VAIO_RDESC_CONSTANT },
> +	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE),
> +		.driver_data = VAIO_RDESC_CONSTANT },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(hid, sony_devices);
> 
> 

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] HID: add support for Sony RF receiver with USB product id 0x0374
@ 2013-01-15  9:36   ` Antonio Ospite
  0 siblings, 0 replies; 21+ messages in thread
From: Antonio Ospite @ 2013-01-15  9:36 UTC (permalink / raw)
  To: Fernando Luis Vázquez Cao
  Cc: Jiri Kosina, linux-input, linux-usb, linux-kernel

On Tue, 15 Jan 2013 12:43:48 +0900
Fernando Luis Vázquez Cao  <fernando_b1@lab.ntt.co.jp> wrote:

Hi Fernando,

> 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 consenquence that it is

typo: consequence

> 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.
> 
> # lsusb -vd 054C:0374
> Bus 003 Device 002: ID 054c:0374 Sony Corp.
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               2.00
>   bDeviceClass            0 (Defined at Interface level)
>   bDeviceSubClass         0
>   bDeviceProtocol         0
>   bMaxPacketSize0         8
>   idVendor           0x054c Sony Corp.
>   idProduct          0x0374
>   iSerial                 0
> [...]
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       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
> 
> # sudo usbhid-dump
> 
> 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-usb@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> ---
> 
> diff -urNp linux-3.8-rc3-orig/drivers/hid/hid-core.c linux-3.8-rc3/drivers/hid/hid-core.c
> --- linux-3.8-rc3-orig/drivers/hid/hid-core.c	2013-01-13 20:54:36.846952518 +0900
> +++ linux-3.8-rc3/drivers/hid/hid-core.c	2013-01-13 18:21:19.901347327 +0900
> @@ -1697,6 +1697,7 @@ static const struct hid_device_id hid_ha
>  	{ 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 -urNp linux-3.8-rc3-orig/drivers/hid/hid-ids.h linux-3.8-rc3/drivers/hid/hid-ids.h
> --- linux-3.8-rc3-orig/drivers/hid/hid-ids.h	2013-01-13 20:54:36.850952537 +0900
> +++ linux-3.8-rc3/drivers/hid/hid-ids.h	2013-01-13 18:21:19.901347327 +0900
> @@ -706,6 +706,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_BDREMOTE		0x0306
>  #define USB_DEVICE_ID_SONY_PS3_CONTROLLER	0x0268
>  #define USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER	0x042f
> diff -urNp linux-3.8-rc3-orig/drivers/hid/hid-sony.c linux-3.8-rc3/drivers/hid/hid-sony.c
> --- linux-3.8-rc3-orig/drivers/hid/hid-sony.c	2012-12-11 12:30:57.000000000 +0900
> +++ linux-3.8-rc3/drivers/hid/hid-sony.c	2013-01-13 18:21:19.901347327 +0900
> @@ -44,19 +44,21 @@ 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) {
> -		hid_info(hdev, "Fixing up Sony Vaio VGX report descriptor\n");
> +	    *rsize >= 56 && rdesc[54] == 0x81 && rdesc[55] == 0x07) {
> +		hid_info(hdev,
> +		         "Fixing up Sony RF Receiver report descriptor\n");

Changing the message does make sense, but try to avoid mixing
functional changes with style changes (I am referring to the change of
indentation here).

If you _really_ want to change the style send a separate patch stating
clearly in the commit message that there are no functionality changes.

This makes the review easier for both kind of patches.

>  		rdesc[55] = 0x06;
>  	}
>  
>  	/* The HID descriptor exposed over BT has a trailing zero byte */
>  	if ((((sc->quirks & SIXAXIS_CONTROLLER_USB) && *rsize == 148) ||
> -			((sc->quirks & SIXAXIS_CONTROLLER_BT) && *rsize == 149)) &&
> -			rdesc[83] == 0x75) {
> +	        ((sc->quirks & SIXAXIS_CONTROLLER_BT) && *rsize == 149)) &&
> +	    rdesc[83] == 0x75) {

Ditto, style changes.

>  		hid_info(hdev, "Fixing up Sony Sixaxis report descriptor\n");
>  		memcpy((void *)&rdesc[83], (void *)&sixaxis_rdesc_fixup,
>  			sizeof(sixaxis_rdesc_fixup));
>  	}
> +

Ditto.

>  	return rdesc;
>  }
>  
> @@ -217,6 +219,8 @@ static const struct hid_device_id sony_d
>  		.driver_data = SIXAXIS_CONTROLLER_BT },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE),
>  		.driver_data = VAIO_RDESC_CONSTANT },
> +	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE),
> +		.driver_data = VAIO_RDESC_CONSTANT },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(hid, sony_devices);
> 
> 

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] HID: add support for Sony RF receiver with USB product id 0x0374
  2013-01-15  9:36   ` Antonio Ospite
@ 2013-01-15 10:03     ` Fernando Luis Vazquez Cao
  -1 siblings, 0 replies; 21+ messages in thread
From: Fernando Luis Vazquez Cao @ 2013-01-15 10:03 UTC (permalink / raw)
  To: Antonio Ospite; +Cc: Jiri Kosina, linux-input, linux-usb, linux-kernel

Hi Antonio,

On 2013/01/15 18:36, Antonio Ospite wrote:
> On Tue, 15 Jan 2013 12:43:48 +0900 Fernando Luis Vázquez Cao  <fernando_b1@lab.ntt.co.jp> wrote:
>> diff -urNp linux-3.8-rc3-orig/drivers/hid/hid-sony.c linux-3.8-rc3/drivers/hid/hid-sony.c
>> --- linux-3.8-rc3-orig/drivers/hid/hid-sony.c	2012-12-11 12:30:57.000000000 +0900
>> +++ linux-3.8-rc3/drivers/hid/hid-sony.c	2013-01-13 18:21:19.901347327 +0900
>> @@ -44,19 +44,21 @@ 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) {
>> -		hid_info(hdev, "Fixing up Sony Vaio VGX report descriptor\n");
>> +	    *rsize >= 56 && rdesc[54] == 0x81 && rdesc[55] == 0x07) {
>> +		hid_info(hdev,
>> +		         "Fixing up Sony RF Receiver report descriptor\n");
> Changing the message does make sense, but try to avoid mixing
> functional changes with style changes (I am referring to the change of
> indentation here).

Oops, that was unintended. I will be replying to this email with an 
updated version.

Thanks,
Fernando

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] HID: add support for Sony RF receiver with USB product id 0x0374
@ 2013-01-15 10:03     ` Fernando Luis Vazquez Cao
  0 siblings, 0 replies; 21+ messages in thread
From: Fernando Luis Vazquez Cao @ 2013-01-15 10:03 UTC (permalink / raw)
  To: Antonio Ospite; +Cc: Jiri Kosina, linux-input, linux-usb, linux-kernel

Hi Antonio,

On 2013/01/15 18:36, Antonio Ospite wrote:
> On Tue, 15 Jan 2013 12:43:48 +0900 Fernando Luis Vázquez Cao  <fernando_b1@lab.ntt.co.jp> wrote:
>> diff -urNp linux-3.8-rc3-orig/drivers/hid/hid-sony.c linux-3.8-rc3/drivers/hid/hid-sony.c
>> --- linux-3.8-rc3-orig/drivers/hid/hid-sony.c	2012-12-11 12:30:57.000000000 +0900
>> +++ linux-3.8-rc3/drivers/hid/hid-sony.c	2013-01-13 18:21:19.901347327 +0900
>> @@ -44,19 +44,21 @@ 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) {
>> -		hid_info(hdev, "Fixing up Sony Vaio VGX report descriptor\n");
>> +	    *rsize >= 56 && rdesc[54] == 0x81 && rdesc[55] == 0x07) {
>> +		hid_info(hdev,
>> +		         "Fixing up Sony RF Receiver report descriptor\n");
> Changing the message does make sense, but try to avoid mixing
> functional changes with style changes (I am referring to the change of
> indentation here).

Oops, that was unintended. I will be replying to this email with an 
updated version.

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v2] HID: add support for Sony RF receiver with USB product id 0x0374
  2013-01-15 10:03     ` Fernando Luis Vazquez Cao
  (?)
@ 2013-01-15 10:40     ` Fernando Luis Vázquez Cao
  2013-01-15 16:02       ` Jiri Kosina
  -1 siblings, 1 reply; 21+ messages in thread
From: Fernando Luis Vázquez Cao @ 2013-01-15 10:40 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input, linux-usb, linux-kernel, Antonio Ospite

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.

# lsusb -vd 054C:0374
Bus 003 Device 002: ID 054c:0374 Sony Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x054c Sony Corp.
  idProduct          0x0374
  iSerial                 0
[...]
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      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

# usbhid-dump
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-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
---

diff -urNp linux-3.8-rc3-orig/drivers/hid/hid-core.c linux-3.8-rc3/drivers/hid/hid-core.c
--- linux-3.8-rc3-orig/drivers/hid/hid-core.c	2013-01-10 11:59:55.000000000 +0900
+++ linux-3.8-rc3/drivers/hid/hid-core.c	2013-01-15 19:32:22.189574034 +0900
@@ -1697,6 +1697,7 @@ static const struct hid_device_id hid_ha
 	{ 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 -urNp linux-3.8-rc3-orig/drivers/hid/hid-ids.h linux-3.8-rc3/drivers/hid/hid-ids.h
--- linux-3.8-rc3-orig/drivers/hid/hid-ids.h	2013-01-10 11:59:55.000000000 +0900
+++ linux-3.8-rc3/drivers/hid/hid-ids.h	2013-01-15 19:32:22.189574034 +0900
@@ -706,6 +706,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_BDREMOTE		0x0306
 #define USB_DEVICE_ID_SONY_PS3_CONTROLLER	0x0268
 #define USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER	0x042f
diff -urNp linux-3.8-rc3-orig/drivers/hid/hid-sony.c linux-3.8-rc3/drivers/hid/hid-sony.c
--- linux-3.8-rc3-orig/drivers/hid/hid-sony.c	2013-01-10 11:59:55.000000000 +0900
+++ linux-3.8-rc3/drivers/hid/hid-sony.c	2013-01-15 19:35:57.858683185 +0900
@@ -45,7 +45,7 @@ static __u8 *sony_report_fixup(struct hi
 
 	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 up Sony RF Receiver report descriptor\n");
 		rdesc[55] = 0x06;
 	}
 
@@ -217,6 +217,8 @@ static const struct hid_device_id sony_d
 		.driver_data = SIXAXIS_CONTROLLER_BT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE),
 		.driver_data = VAIO_RDESC_CONSTANT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE),
+		.driver_data = VAIO_RDESC_CONSTANT },
 	{ }
 };
 MODULE_DEVICE_TABLE(hid, sony_devices);



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2] HID: add support for Sony RF receiver with USB product id 0x0374
  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-05-01  0:25           ` Fernando Luis Vázquez Cao
  0 siblings, 2 replies; 21+ messages in thread
From: Jiri Kosina @ 2013-01-15 16:02 UTC (permalink / raw)
  To: Fernando Luis Vázquez Cao
  Cc: linux-input, linux-usb, linux-kernel, Antonio Ospite

On Tue, 15 Jan 2013, Fernando Luis Vázquez Cao wrote:

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

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2] HID: add support for Sony RF receiver with USB product id 0x0374
  2013-01-15 16:02       ` Jiri Kosina
@ 2013-01-16  5:17           ` Fernando Luis Vazquez Cao
  2013-05-01  0:25           ` Fernando Luis Vázquez Cao
  1 sibling, 0 replies; 21+ messages in thread
From: Fernando Luis Vazquez Cao @ 2013-01-16  5:17 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input, linux-usb, linux-kernel, Antonio Ospite

Hi Jiri,

On 2013/01/16 01:02, Jiri Kosina wrote:
> On Tue, 15 Jan 2013, Fernando Luis Vázquez Cao wrote:
>
>> 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.
> Applied, thanks.

Thank you.

I noticed that the patch was tagged "for-3.9". Does this mean
that it is too late to get it merged during the current release
cycle?

If possible, I would like to get it backported to 3.7-stable (and
possibly 3.2 stable), since without it a whole family of Sony
desktop computers is unusable under Linux out of the box.
Should I do it myself or do you have a process in place for HID
stable patches?

Regards,
Fernando

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2] HID: add support for Sony RF receiver with USB product id 0x0374
@ 2013-01-16  5:17           ` Fernando Luis Vazquez Cao
  0 siblings, 0 replies; 21+ messages in thread
From: Fernando Luis Vazquez Cao @ 2013-01-16  5:17 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input, linux-usb, linux-kernel, Antonio Ospite

Hi Jiri,

On 2013/01/16 01:02, Jiri Kosina wrote:
> On Tue, 15 Jan 2013, Fernando Luis Vázquez Cao wrote:
>
>> 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.
> Applied, thanks.

Thank you.

I noticed that the patch was tagged "for-3.9". Does this mean
that it is too late to get it merged during the current release
cycle?

If possible, I would like to get it backported to 3.7-stable (and
possibly 3.2 stable), since without it a whole family of Sony
desktop computers is unusable under Linux out of the box.
Should I do it myself or do you have a process in place for HID
stable patches?

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2] HID: add support for Sony RF receiver with USB product id 0x0374
  2013-01-16  5:17           ` Fernando Luis Vazquez Cao
  (?)
@ 2013-01-16 10:44           ` Jiri Kosina
  2013-01-22  5:57               ` Fernando Luis Vazquez Cao
  -1 siblings, 1 reply; 21+ messages in thread
From: Jiri Kosina @ 2013-01-16 10:44 UTC (permalink / raw)
  To: Fernando Luis Vazquez Cao
  Cc: linux-input, linux-usb, linux-kernel, Antonio Ospite

On Wed, 16 Jan 2013, Fernando Luis Vazquez Cao wrote:

> I noticed that the patch was tagged "for-3.9". Does this mean
> that it is too late to get it merged during the current release
> cycle?

I currently don't have anything queued for 3.8, and this particular patch 
doesn't justify a separate pull request.

Once it's in Linus' tree, it can be easily pushed out to all existing 
-stable branches (including 3.8-stable, once it's created).

If I am gfoing to be sending pull request for 3.8 to Linus still due to 
some important bugfix, I will be including this.

> If possible, I would like to get it backported to 3.7-stable (and 
> possibly 3.2 stable), since without it a whole family of Sony desktop 
> computers is unusable under Linux out of the box. Should I do it myself 
> or do you have a process in place for HID stable patches?

If the patch had

	Cc: stable@vger.kernel.org

in it, it'd be picked for -stable queue automatically. Otherwise, anyone 
is free to take it once it's in Linus' tree and sent to to 
stable@vger.kernel.org for inclusion.

Hope this helps,

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2] HID: add support for Sony RF receiver with USB product id 0x0374
@ 2013-01-22  5:57               ` Fernando Luis Vazquez Cao
  0 siblings, 0 replies; 21+ messages in thread
From: Fernando Luis Vazquez Cao @ 2013-01-22  5:57 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input, linux-usb, linux-kernel, Antonio Ospite

On Wed, 2013-01-16 at 11:44 +0100, Jiri Kosina wrote:
> On Wed, 16 Jan 2013, Fernando Luis Vazquez Cao wrote:
>
> > I noticed that the patch was tagged "for-3.9". Does this mean
> > that it is too late to get it merged during the current release
> > cycle?
>
> I currently don't have anything queued for 3.8, and this particular patch
> doesn't justify a separate pull request.
>
> Once it's in Linus' tree, it can be easily pushed out to all existing
> -stable branches (including 3.8-stable, once it's created).
>
> If I am gfoing to be sending pull request for 3.8 to Linus still due to
> some important bugfix, I will be including this.

Ok, thank you for the explanation. I really appreciate it.


> > If possible, I would like to get it backported to 3.7-stable (and
> > possibly 3.2 stable), since without it a whole family of Sony desktop
> > computers is unusable under Linux out of the box. Should I do it myself
> > or do you have a process in place for HID stable patches?
>
> If the patch had
>
> 	Cc: stable@vger.kernel.org
>
> in it, it'd be picked for -stable queue automatically.

I considered doing that but I thought and upstream commit
ID was needed.


> Otherwise, anyone is free to take it once it's in Linus' tree and sent
> to to stable@vger.kernel.org for inclusion.


So it is the standard procedure. I just wanted to make
sure whether you wanted to have all the -stable patches
funnelled through you. I will send the patch to -stable
directly and Cc you as soon as it makes it into Linus'
tree.


By the way, I will be replying to this email with a
follow-up patch that I forgot to send the last time
around. It is just documentation for the quirk.

Thanks,
Fernando

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2] HID: add support for Sony RF receiver with USB product id 0x0374
@ 2013-01-22  5:57               ` Fernando Luis Vazquez Cao
  0 siblings, 0 replies; 21+ messages in thread
From: Fernando Luis Vazquez Cao @ 2013-01-22  5:57 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: linux-input-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Antonio Ospite

On Wed, 2013-01-16 at 11:44 +0100, Jiri Kosina wrote:
> On Wed, 16 Jan 2013, Fernando Luis Vazquez Cao wrote:
>
> > I noticed that the patch was tagged "for-3.9". Does this mean
> > that it is too late to get it merged during the current release
> > cycle?
>
> I currently don't have anything queued for 3.8, and this particular patch
> doesn't justify a separate pull request.
>
> Once it's in Linus' tree, it can be easily pushed out to all existing
> -stable branches (including 3.8-stable, once it's created).
>
> If I am gfoing to be sending pull request for 3.8 to Linus still due to
> some important bugfix, I will be including this.

Ok, thank you for the explanation. I really appreciate it.


> > If possible, I would like to get it backported to 3.7-stable (and
> > possibly 3.2 stable), since without it a whole family of Sony desktop
> > computers is unusable under Linux out of the box. Should I do it myself
> > or do you have a process in place for HID stable patches?
>
> If the patch had
>
> 	Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>
> in it, it'd be picked for -stable queue automatically.

I considered doing that but I thought and upstream commit
ID was needed.


> Otherwise, anyone is free to take it once it's in Linus' tree and sent
> to to stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org for inclusion.


So it is the standard procedure. I just wanted to make
sure whether you wanted to have all the -stable patches
funnelled through you. I will send the patch to -stable
directly and Cc you as soon as it makes it into Linus'
tree.


By the way, I will be replying to this email with a
follow-up patch that I forgot to send the last time
around. It is just documentation for the quirk.

Thanks,
Fernando
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 21+ messages in thread

* HID: clean up quirk for Sony RF receivers
  2013-01-22  5:57               ` Fernando Luis Vazquez Cao
  (?)
@ 2013-01-22  6:20               ` Fernando Luis Vázquez Cao
  2013-01-22 10:08                   ` Jiri Kosina
  -1 siblings, 1 reply; 21+ messages in thread
From: Fernando Luis Vázquez Cao @ 2013-01-22  6:20 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input, linux-usb, linux-kernel, Antonio Ospite

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



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2] HID: add support for Sony RF receiver with USB product id 0x0374
  2013-01-22  5:57               ` Fernando Luis Vazquez Cao
  (?)
  (?)
@ 2013-01-22 10:04               ` Jiri Kosina
  -1 siblings, 0 replies; 21+ messages in thread
From: Jiri Kosina @ 2013-01-22 10:04 UTC (permalink / raw)
  To: Fernando Luis Vazquez Cao
  Cc: linux-input, linux-usb, linux-kernel, Antonio Ospite

On Tue, 22 Jan 2013, Fernando Luis Vazquez Cao wrote:

> > > If possible, I would like to get it backported to 3.7-stable (and
> > > possibly 3.2 stable), since without it a whole family of Sony desktop
> > > computers is unusable under Linux out of the box. Should I do it myself
> > > or do you have a process in place for HID stable patches?
> > 
> > If the patch had
> > 
> > 	Cc: stable@vger.kernel.org
> > 
> > in it, it'd be picked for -stable queue automatically.
> 
> I considered doing that but I thought and upstream commit
> ID was needed.

Yes, that's necessary in case you are cherry-picking a commit already 
present in Linus' tree that doesn't have explicit "Cc: 
stable@vger.kernel.org". Otherwise, -stable tree maintainer is 
automatically picking up commits that appear in Linus tree with this tag.

> 
> > Otherwise, anyone is free to take it once it's in Linus' tree and sent 
> > to to stable@vger.kernel.org for inclusion.
> 
> So it is the standard procedure. I just wanted to make sure whether you 
> wanted to have all the -stable patches funnelled through you. 

It's not strictly necessary. I get copied on them when they are queued in 
-stable queue anyway.

> By the way, I will be replying to this email with a follow-up patch that 
> I forgot to send the last time around. It is just documentation for the 
> quirk.

Ok, thanks.

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: HID: clean up quirk for Sony RF receivers
  2013-01-22  6:20               ` HID: clean up quirk for Sony RF receivers Fernando Luis Vázquez Cao
@ 2013-01-22 10:08                   ` Jiri Kosina
  0 siblings, 0 replies; 21+ messages in thread
From: Jiri Kosina @ 2013-01-22 10:08 UTC (permalink / raw)
  To: Fernando Luis Vázquez Cao
  Cc: linux-input, linux-usb, linux-kernel, Antonio Ospite

On Tue, 22 Jan 2013, Fernando Luis Vázquez Cao wrote:

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

Applied.

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: HID: clean up quirk for Sony RF receivers
@ 2013-01-22 10:08                   ` Jiri Kosina
  0 siblings, 0 replies; 21+ messages in thread
From: Jiri Kosina @ 2013-01-22 10:08 UTC (permalink / raw)
  To: Fernando Luis Vázquez Cao
  Cc: linux-input, linux-usb, linux-kernel, Antonio Ospite

On Tue, 22 Jan 2013, Fernando Luis Vázquez Cao wrote:

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

Applied.

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2] HID: add support for Sony RF receiver with USB product id 0x0374
  2013-01-15 16:02       ` Jiri Kosina
@ 2013-05-01  0:25           ` Fernando Luis Vázquez Cao
  2013-05-01  0:25           ` Fernando Luis Vázquez Cao
  1 sibling, 0 replies; 21+ messages in thread
From: Fernando Luis Vázquez Cao @ 2013-05-01  0:25 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input, linux-usb, linux-kernel, Antonio Ospite

Hi Jiri,

On Tue, 2013-01-15 at 17:02 +0100, Jiri Kosina wrote:
> On Tue, 15 Jan 2013, Fernando Luis Vázquez Cao wrote:
> 
> > 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.
> 
> Applied, thanks.

It looks like after the merge of the the sony and steelseries
branches the hid core hunk was left out, which means that
this fix-up is never applied.

I will be replying to this email with a fix.

Thanks,
Fernando


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2] HID: add support for Sony RF receiver with USB product id 0x0374
@ 2013-05-01  0:25           ` Fernando Luis Vázquez Cao
  0 siblings, 0 replies; 21+ messages in thread
From: Fernando Luis Vázquez Cao @ 2013-05-01  0:25 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input, linux-usb, linux-kernel, Antonio Ospite

Hi Jiri,

On Tue, 2013-01-15 at 17:02 +0100, Jiri Kosina wrote:
> On Tue, 15 Jan 2013, Fernando Luis Vázquez Cao wrote:
> 
> > 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.
> 
> Applied, thanks.

It looks like after the merge of the the sony and steelseries
branches the hid core hunk was left out, which means that
this fix-up is never applied.

I will be replying to this email with a fix.

Thanks,
Fernando

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH] HID: fix botched tree merge that disabled fix-up for certain Sony RF receivers
  2013-05-01  0:25           ` Fernando Luis Vázquez Cao
  (?)
@ 2013-05-01  0:26           ` Fernando Luis Vázquez Cao
  2013-05-01 12:59               ` Jiri Kosina
  -1 siblings, 1 reply; 21+ messages in thread
From: Fernando Luis Vázquez Cao @ 2013-05-01  0:26 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input, linux-usb, linux-kernel, Antonio Ospite

It looks like the manual merge 0d69a3c731e120b05b7da9fb976830475a3fbc01 ("Merge
branches 'for-3.9/sony' and 'for-3.9/steelseries' into for-linus") accidentally
removed Sony RF receiver with USB product id 0x0374 from the "have special
driver" list, effectively nullifying a464918419f94a0043d2f549d6defb4c3f69f68a
("HID: add support for Sony RF receiver with USB product id 0x0374"). Add the
device back to the list.

Cc: stable@vger.kernel.org
Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
---

diff -urNp linux-3.9/drivers/hid/hid-core.c linux-3.9-fix/drivers/hid/hid-core.c
--- linux-3.9/drivers/hid/hid-core.c	2013-04-29 09:36:01.000000000 +0900
+++ linux-3.9-fix/drivers/hid/hid-core.c	2013-04-30 21:53:57.596269692 +0900
@@ -1702,6 +1702,7 @@ static const struct hid_device_id hid_ha
 	{ 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_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_THINGM, USB_DEVICE_ID_BLINK1) },



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] HID: fix botched tree merge that disabled fix-up for certain Sony RF receivers
  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
  0 siblings, 0 replies; 21+ messages in thread
From: Jiri Kosina @ 2013-05-01 12:59 UTC (permalink / raw)
  To: Fernando Luis Vázquez Cao
  Cc: linux-input, linux-usb, linux-kernel, Antonio Ospite

On Wed, 1 May 2013, Fernando Luis Vázquez Cao wrote:

> It looks like the manual merge 0d69a3c731e120b05b7da9fb976830475a3fbc01 ("Merge
> branches 'for-3.9/sony' and 'for-3.9/steelseries' into for-linus") accidentally
> removed Sony RF receiver with USB product id 0x0374 from the "have special
> driver" list, effectively nullifying a464918419f94a0043d2f549d6defb4c3f69f68a
> ("HID: add support for Sony RF receiver with USB product id 0x0374"). Add the
> device back to the list.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> ---
> 
> diff -urNp linux-3.9/drivers/hid/hid-core.c linux-3.9-fix/drivers/hid/hid-core.c
> --- linux-3.9/drivers/hid/hid-core.c	2013-04-29 09:36:01.000000000 +0900
> +++ linux-3.9-fix/drivers/hid/hid-core.c	2013-04-30 21:53:57.596269692 +0900
> @@ -1702,6 +1702,7 @@ static const struct hid_device_id hid_ha
>  	{ 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_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_THINGM, USB_DEVICE_ID_BLINK1) },

Thanks a lot for noticing. Applied.

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] HID: fix botched tree merge that disabled fix-up for certain Sony RF receivers
@ 2013-05-01 12:59               ` Jiri Kosina
  0 siblings, 0 replies; 21+ messages in thread
From: Jiri Kosina @ 2013-05-01 12:59 UTC (permalink / raw)
  To: Fernando Luis Vázquez Cao
  Cc: linux-input, linux-usb, linux-kernel, Antonio Ospite

On Wed, 1 May 2013, Fernando Luis Vázquez Cao wrote:

> It looks like the manual merge 0d69a3c731e120b05b7da9fb976830475a3fbc01 ("Merge
> branches 'for-3.9/sony' and 'for-3.9/steelseries' into for-linus") accidentally
> removed Sony RF receiver with USB product id 0x0374 from the "have special
> driver" list, effectively nullifying a464918419f94a0043d2f549d6defb4c3f69f68a
> ("HID: add support for Sony RF receiver with USB product id 0x0374"). Add the
> device back to the list.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> ---
> 
> diff -urNp linux-3.9/drivers/hid/hid-core.c linux-3.9-fix/drivers/hid/hid-core.c
> --- linux-3.9/drivers/hid/hid-core.c	2013-04-29 09:36:01.000000000 +0900
> +++ linux-3.9-fix/drivers/hid/hid-core.c	2013-04-30 21:53:57.596269692 +0900
> @@ -1702,6 +1702,7 @@ static const struct hid_device_id hid_ha
>  	{ 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_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_THINGM, USB_DEVICE_ID_BLINK1) },

Thanks a lot for noticing. Applied.

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2013-05-01 12:59 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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  9:36   ` Antonio Ospite
2013-01-15 10:03   ` Fernando Luis Vazquez Cao
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  5:17           ` Fernando Luis Vazquez Cao
2013-01-16 10:44           ` Jiri Kosina
2013-01-22  5:57             ` Fernando Luis Vazquez Cao
2013-01-22  5:57               ` Fernando Luis Vazquez Cao
2013-01-22  6:20               ` HID: clean up quirk for Sony RF receivers Fernando Luis Vázquez Cao
2013-01-22 10:08                 ` Jiri Kosina
2013-01-22 10:08                   ` 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: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
2013-05-01 12:59               ` Jiri Kosina

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.