HID: sony: Corrections for the DualShock 4 HID descriptor
authorFrank Praznik <frank.praznik@oh.rr.com>
Sun, 14 Sep 2014 15:56:38 +0000 (11:56 -0400)
committerJiri Kosina <jkosina@suse.cz>
Mon, 15 Sep 2014 11:34:53 +0000 (13:34 +0200)
Fix a few minor issues in the HID descriptor:
 - A 6 bit entry had a logical maximum of 255 when the largest it can be is 63.
 - A logical max value was incorrectly being set to -1 instead of 255.
 - Set the min/max of the gyroscopes to -8192/8191 as that is the range of
   values which represent the true controller orientation.  Any values beyond
   those extents are just noise.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-sony.c

index ecc6616ab550097f1c78a1bafb345fb6c36d9310..75da56d0cfaca1138419e9ea77357b992585dc4f 100644 (file)
@@ -176,7 +176,7 @@ static u8 dualshock4_usb_rdesc[] = {
        0x75, 0x06,         /*      Report Size (6),                */
        0x95, 0x01,         /*      Report Count (1),               */
        0x15, 0x00,         /*      Logical Minimum (0),            */
-       0x25, 0x7F,         /*      Logical Maximum (127),          */
+       0x25, 0x3F,         /*      Logical Maximum (63),           */
        0x81, 0x02,         /*      Input (Variable),               */
        0x05, 0x01,         /*      Usage Page (Desktop),           */
        0x09, 0x33,         /*      Usage (Rx),                     */
@@ -200,14 +200,14 @@ static u8 dualshock4_usb_rdesc[] = {
        0x81, 0x02,         /*      Input (Variable),               */
        0x19, 0x43,         /*      Usage Minimum (43h),            */
        0x29, 0x45,         /*      Usage Maximum (45h),            */
-       0x16, 0xFF, 0xBF,   /*      Logical Minimum (-16385),       */
-       0x26, 0x00, 0x40,   /*      Logical Maximum (16384),        */
+       0x16, 0x00, 0xE0,   /*      Logical Minimum (-8192),        */
+       0x26, 0xFF, 0x1F,   /*      Logical Maximum (8191),         */
        0x95, 0x03,         /*      Report Count (3),               */
        0x81, 0x02,         /*      Input (Variable),               */
        0x06, 0x00, 0xFF,   /*      Usage Page (FF00h),             */
        0x09, 0x21,         /*      Usage (21h),                    */
        0x15, 0x00,         /*      Logical Minimum (0),            */
-       0x25, 0xFF,         /*      Logical Maximum (255),          */
+       0x26, 0xFF, 0x00,   /*      Logical Maximum (255),          */
        0x75, 0x08,         /*      Report Size (8),                */
        0x95, 0x27,         /*      Report Count (39),              */
        0x81, 0x02,         /*      Input (Variable),               */
@@ -509,8 +509,8 @@ static u8 dualshock4_bt_rdesc[] = {
        0x81, 0x02,         /*      Input (Variable),               */
        0x19, 0x43,         /*      Usage Minimum (43h),            */
        0x29, 0x45,         /*      Usage Maximum (45h),            */
-       0x16, 0xFF, 0xBF,   /*      Logical Minimum (-16385),       */
-       0x26, 0x00, 0x40,   /*      Logical Maximum (16384),        */
+       0x16, 0x00, 0xE0,   /*      Logical Minimum (-8192),        */
+       0x26, 0xFF, 0x1F,   /*      Logical Maximum (8191),         */
        0x95, 0x03,         /*      Report Count (3),               */
        0x81, 0x02,         /*      Input (Variable),               */
        0x06, 0x00, 0xFF,   /*      Usage Page (FF00h),             */