0560-Revert-HID-dragonrise-fix-HID-Descriptor-for-0x0006-.patch 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. From e7b5643bfddd3ce80f4ade03a980da6b8979136d Mon Sep 17 00:00:00 2001
  2. From: Ioan-Adrian Ratiu <adi@adirat.com>
  3. Date: Tue, 27 Sep 2016 21:41:37 +0300
  4. Subject: [PATCH] Revert "HID: dragonrise: fix HID Descriptor for 0x0006 PID"
  5. [ Upstream commit 1bcaa05ebee115213e34f1806cc6a4f7a6175a88 ]
  6. This reverts commit 18339f59c3a6 ("HID: dragonrise: fix HID...") because it
  7. breaks certain dragonrise 0079:0006 gamepads. While it may fix a breakage
  8. caused by commit 79346d620e9d ("HID: input: force generic axis to be mapped
  9. to their user space axis"), it is probable that the manufacturer released
  10. different hardware with the same PID so this fix works for only a subset
  11. and breaks the other gamepads sharing the PID.
  12. What is needed is another more generic solution which fixes 79346d620e9d
  13. ("HID: input: force generic axis ...") breakage for this controller: we
  14. need to add an exception for this driver to make it keep the old behaviour
  15. previous to the initial breakage (this is done in patch 2 of this series).
  16. Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com>
  17. Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
  18. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  19. ---
  20. drivers/hid/hid-dr.c | 58 ----------------------------------------------------
  21. 1 file changed, 58 deletions(-)
  22. --- a/drivers/hid/hid-dr.c
  23. +++ b/drivers/hid/hid-dr.c
  24. @@ -234,58 +234,6 @@ static __u8 pid0011_rdesc_fixed[] = {
  25. 0xC0 /* End Collection */
  26. };
  27. -static __u8 pid0006_rdesc_fixed[] = {
  28. - 0x05, 0x01, /* Usage Page (Generic Desktop) */
  29. - 0x09, 0x04, /* Usage (Joystick) */
  30. - 0xA1, 0x01, /* Collection (Application) */
  31. - 0xA1, 0x02, /* Collection (Logical) */
  32. - 0x75, 0x08, /* Report Size (8) */
  33. - 0x95, 0x05, /* Report Count (5) */
  34. - 0x15, 0x00, /* Logical Minimum (0) */
  35. - 0x26, 0xFF, 0x00, /* Logical Maximum (255) */
  36. - 0x35, 0x00, /* Physical Minimum (0) */
  37. - 0x46, 0xFF, 0x00, /* Physical Maximum (255) */
  38. - 0x09, 0x30, /* Usage (X) */
  39. - 0x09, 0x33, /* Usage (Ry) */
  40. - 0x09, 0x32, /* Usage (Z) */
  41. - 0x09, 0x31, /* Usage (Y) */
  42. - 0x09, 0x34, /* Usage (Ry) */
  43. - 0x81, 0x02, /* Input (Variable) */
  44. - 0x75, 0x04, /* Report Size (4) */
  45. - 0x95, 0x01, /* Report Count (1) */
  46. - 0x25, 0x07, /* Logical Maximum (7) */
  47. - 0x46, 0x3B, 0x01, /* Physical Maximum (315) */
  48. - 0x65, 0x14, /* Unit (Centimeter) */
  49. - 0x09, 0x39, /* Usage (Hat switch) */
  50. - 0x81, 0x42, /* Input (Variable) */
  51. - 0x65, 0x00, /* Unit (None) */
  52. - 0x75, 0x01, /* Report Size (1) */
  53. - 0x95, 0x0C, /* Report Count (12) */
  54. - 0x25, 0x01, /* Logical Maximum (1) */
  55. - 0x45, 0x01, /* Physical Maximum (1) */
  56. - 0x05, 0x09, /* Usage Page (Button) */
  57. - 0x19, 0x01, /* Usage Minimum (0x01) */
  58. - 0x29, 0x0C, /* Usage Maximum (0x0C) */
  59. - 0x81, 0x02, /* Input (Variable) */
  60. - 0x06, 0x00, 0xFF, /* Usage Page (Vendor Defined) */
  61. - 0x75, 0x01, /* Report Size (1) */
  62. - 0x95, 0x08, /* Report Count (8) */
  63. - 0x25, 0x01, /* Logical Maximum (1) */
  64. - 0x45, 0x01, /* Physical Maximum (1) */
  65. - 0x09, 0x01, /* Usage (0x01) */
  66. - 0x81, 0x02, /* Input (Variable) */
  67. - 0xC0, /* End Collection */
  68. - 0xA1, 0x02, /* Collection (Logical) */
  69. - 0x75, 0x08, /* Report Size (8) */
  70. - 0x95, 0x07, /* Report Count (7) */
  71. - 0x46, 0xFF, 0x00, /* Physical Maximum (255) */
  72. - 0x26, 0xFF, 0x00, /* Logical Maximum (255) */
  73. - 0x09, 0x02, /* Usage (0x02) */
  74. - 0x91, 0x02, /* Output (Variable) */
  75. - 0xC0, /* End Collection */
  76. - 0xC0 /* End Collection */
  77. -};
  78. -
  79. static __u8 *dr_report_fixup(struct hid_device *hdev, __u8 *rdesc,
  80. unsigned int *rsize)
  81. {
  82. @@ -296,12 +244,6 @@ static __u8 *dr_report_fixup(struct hid_
  83. *rsize = sizeof(pid0011_rdesc_fixed);
  84. }
  85. break;
  86. - case 0x0006:
  87. - if (*rsize == sizeof(pid0006_rdesc_fixed)) {
  88. - rdesc = pid0006_rdesc_fixed;
  89. - *rsize = sizeof(pid0006_rdesc_fixed);
  90. - }
  91. - break;
  92. }
  93. return rdesc;
  94. }