Skip to contentSkip to conversation

Joystick-hat fix for drivers/usb/hid-input.c

PATCH David Megginson 1 participant 1 message Oct 15, 2001

lore
Share & tools
lore
#0 lore raw

[NOTE: I'm not subscribed to linux-kernel -- if you have any questions, please reply directly to me.]

Between 2.4.9 and 2.4.10, drivers/usb/hid.c was replaced by drivers/usb/hid-input.c, and a small typo broke support for USB joystick hats. Here's a patch to 2.4.12 that fixes the problem:

========================================================================

usb/hid-input.c renamed from usb/hid-input.c.ORIG +1 -1
@@ -61,7 +61,7 @@
 static struct {
 	__s32 x;
 	__s32 y;
-}  hid_hat_to_axis[] = {{0, 0}, { 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}};
+}  hid_hat_to_axis[] = {{ 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}, {0,0}};
 
 static void hidinput_configure_usage(struct hid_device *device, struct hid_field *field, struct hid_usage *usage)
 {

========================================================================

You'll notice that the order of the hid_hat_to_axis entries in the patched version is the same as in the original hid.c.

All the best,

David

Signature · 2 lines
David Megginson
[email protected]