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

David Megginson (david@megginson.com)
Mon, 15 Oct 2001 17:41:53 -0400


[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:

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

--- drivers/usb/hid-input.c.ORIG Tue Sep 25 07:01:26 2001
+++ drivers/usb/hid-input.c Mon Oct 15 17:31:27 2001
@@ -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

-- 
David Megginson
david@megginson.com

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