My USB joystick "Primax Raptor 3D USB" worked improperly. I found out a
wrong usb report descriptor. Below you find a patch to correct this.
Unfortunately I don't know anyone with the same hardware for co-testing.
If you have access to this hardware, please check the patch and reply
results. Thank you!
The base of the patch ist the rpm version kernel-source-2.6.27.23-0.1.1 of
my system OpenSuse 11.1
kind regards!
Ralf
*** include/linux/hid.h~ Wed May 27 10:37:29 2009
--- include/linux/hid.h Thu Jul 23 16:59:41 2009
***************
*** 299,304 ****
--- 299,305 ----
#define HID_QUIRK_RDESC_MICROSOFT_RECV_1028 0x00000080
#define HID_QUIRK_RDESC_SUNPLUS_WDESKTOP 0x00000100
#define HID_QUIRK_RDESC_SONY_VAIO_VGX 0x00000200
+ #define HID_QUIRK_RDESC_PRIMAX_RAPTOR3D 0x00000400
/*
* This is the global environment of the parser. This information is
*** drivers/hid/usbhid/hid-quirks.c~ Wed May 27 10:37:29 2009
--- drivers/hid/usbhid/hid-quirks.c Thu Jul 23 16:59:07 2009
***************
*** 426,431 ****
--- 426,434 ----
#define USB_VENDOR_ID_KYE 0x0458
#define USB_DEVICE_ID_KYE_GPEN_560 0x5003
+ #define USB_VENDOR_ID_PRIMAX 0x0461
+ #define USB_DEVICE_ID_PRIMAX_RAPTOR3D 0x4a04
+
/*
* Alphabetically sorted blacklist by quirk type.
*/
***************
*** 766,771 ****
--- 769,775 ----
{ USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1,
HID_QUIRK_RDESC_SWAPPED_MIN_MAX },
{ USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2,
HID_QUIRK_RDESC_SWAPPED_MIN_MAX },
+ { USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_RAPTOR3D,
HID_QUIRK_RDESC_PRIMAX_RAPTOR3D },
{ 0, 0 }
};
***************
*** 1160,1165 ****
--- 1164,1181 ----
}
}
+ /*
+ * Primax Raptor 3D USB joystick reports wrong logical limits for its
x/y axis
+ */
+ static void usbhid_fixup_primax_raptor_descriptor(unsigned char *rdesc,
int rsize)
+ {
+ if (rsize > 19) {
+ printk(KERN_INFO "Fixing up Primax Raptor 3D report descriptor\n");
+ rdesc[17] = 0; /* logical min */
+ rdesc[19] = 255; /* logical max */
+ }
+ }
+
static void __usbhid_fixup_report_descriptor(__u32 quirks, char *rdesc,
unsigned rsize)
{
if ((quirks & HID_QUIRK_RDESC_CYMOTION))
***************
*** 1191,1196 ****
--- 1207,1215 ----
if (quirks & HID_QUIRK_RDESC_SONY_VAIO_VGX)
usbhid_fixup_sony_vaio_vgx(rdesc, rsize);
+
+ if (quirks & HID_QUIRK_RDESC_PRIMAX_RAPTOR3D)
+ usbhid_fixup_primax_raptor_descriptor(rdesc, rsize);
}
/**
kind regards, Ralf
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html