Correct handling of URB for stick axes - closes #1

The le32_to_cpu function doesn't quite work for some reason. Manually
writing the 32-bit conversion seems to fix the axes reporting for
ABS_X, ABS_Y and ABS_RZ.
pull/3/head v0.0.1
Nirenjan Krishnan 2012-10-25 00:01:05 -07:00
parent 75346c745a
commit 2fd5f29ade
1 changed files with 4 additions and 1 deletions

View File

@ -29,7 +29,10 @@
static void x52pro_decode_urb(struct x52_joy *joy, unsigned char *data)
{
struct input_dev *idev = joy->idev;
u32 stick_axis = le32_to_cpu(&data[0]);
u32 stick_axis = data[3];
stick_axis = (stick_axis << 8) | data[2];
stick_axis = (stick_axis << 8) | data[1];
stick_axis = (stick_axis << 8) | data[0];
input_report_key(idev, BTN_TRIGGER_HAPPY1, data[8] & 0x01);
input_report_key(idev, BTN_TRIGGER_HAPPY2, data[8] & 0x02);