[ Apologies for posting to both this and the joystick list - it seemed
kind of appropriate to both. Feel free to heap scorn on my head, if
you're that way inclined... ]
I've been battling with my Gravis Xterminator DC joystick(s) of late:
They aren't recognised by the grip.o driver [kernel 2.4.3-ac5]
when plugged into the gameport [grip.o recognises my blackhawk digital
fine, so I know that part works] - however, when I attach the USB
converter and plug the stick in, it works fine - or I should say, almost
fine, with one slight problem: the hat didn't work right. After some
trawling through jstest.c, I became convinced that the fault lay at least
a level deeper, so I splattered some printk's around, and found that
joydev.o was receiving bad hat events from input.o, which, in turn
appeared to be receiving bad data from hid.o.
After some head scratching, I eventually realised what was wrong:
the wrong values were being read from hid_hat_to_axis[]:
The value is defined as
static struct
{
__s32 x;
__s32 y;
} hid_hat_to_axis[] = {
{ 0,-1},{ 1,-1},{ 1, 0},{ 1, 1},
{ 0, 1},{-1, 1},{-1, 0},{-1,-1},{ 0, 0}
};
Whereas it seems to need to be defined as:
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},{ 0, 0}
};
That one little change seemed to make joystick hat return values make
sense. Have I found bug? Looks like a fencepost error, but maybe the
joystick is sending nonstandard values down the wire I'll back out all the
instrumentation I added and produce a patch, if necessary.
Can anyone else w. a joystick w. a hat, plugged into a USB port, report
success/failure/whatever wrt to hat functionality?
Still no progress on the gameport problem, though: grip_xt_read_packet()
never seems to find the GXDC, maybe I should turn my attention to
gameport_read(), or maybe grip_xt_read_packet() needs to be modified
to recognise the GXDC.
[Obviously, this isn't a problem for me anymore, I can get the thing to
work, even if it means applying a tiny patch just for myself when I
upgrade my kernel, but it would be nice if it worked 'out of the box']
--
"Do you think there's a God?"
"Well, SOMEbody's out to get me!"
-- Calvin and Hobbs
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-users