Skip to contentSkip to conversation

How can I test a joystick type device?

DISCUSSION Adrian McMenamin 3 participants 6 messages Feb 8, 2008 – Feb 11, 2008 SuperH

lore
Share & tools
lore
#0 lore raw

As below shows I think I have successfully ported the 2.4 Dreamcast controller driver to 2.6 - but how can I test it? Is there a device I should be looking for in /dev that I could just cat?

Sorry for the stupid question, but I'm at a loss on this one. :)

-bash-3.1# tree
.

|-- devices
|   |-- 0:00.1 -> ../../../devices/maple/0:00.1
|   `-- 1:00.40 -> ../../../devices/maple/1:00.40
|-- drivers
|   |-- Dreamcast_controller
|   |   |-- 0:00.1 -> ../../../../devices/maple/0:00.1
|   |   |-- bind
|   |   |-- uevent
|   |   `-- unbind
|   |-- Dreamcast_keyboard
|   |   |-- 1:00.40 -> ../../../../devices/maple/1:00.40
|   |   |-- bind
|   |   |-- uevent
|   |   `-- unbind
|   `-- maple_dummy_driver
|       |-- bind
|       |-- uevent
|       `-- unbind
|-- drivers_autoprobe
|-- drivers_probe

`-- uevent

#1 lore raw
Quoted 3 lines · you

As below shows I think I have successfully ported the 2.4 Dreamcast controller driver to 2.6 - but how can I test it? Is there a device I should be looking for in /dev that I could just cat?

Cool.
if a /dev/input/js? or /dev/js? does not show up you can try:
mknod js0 c 13 0
then you can cat js0 and move the joystick to see if it's working

#2 lore raw
In reply to Adrian McMenamin
Quoted 4 lines · Adrian McMenamin

As below shows I think I have successfully ported the 2.4 Dreamcast controller driver to 2.6 - but how can I test it? Is there a device I should be looking for in /dev that I could just cat?

Other than the existing suggestion, you can also use evdev for just cat'ing and getting the raw events.

#3 lore raw
In reply to Adrian McMenamin
Quoted 8 lines · Paul Mundt
Quoted 4 lines · Adrian McMenamin

As below shows I think I have successfully ported the 2.4 Dreamcast controller driver to 2.6 - but how can I test it? Is there a device I should be looking for in /dev that I could just cat?

Other than the existing suggestion, you can also use evdev for just cat'ing and getting the raw events.
-

I need to get udev to recognise the driver as a joystick and then create a node for it. Not sure how to do that...

#4 lore raw
In reply to Adrian McMenamin
Quoted 8 lines · Harley Laue
Quoted 3 lines · you

As below shows I think I have successfully ported the 2.4 Dreamcast controller driver to 2.6 - but how can I test it? Is there a device I should be looking for in /dev that I could just cat?

Cool.
if a /dev/input/js? or /dev/js? does not show up you can try:
mknod js0 c 13 0
then you can cat js0 and move the joystick to see if it's working

Clearly the porting isn't as simple as I'd hoped: I cannot seem to get a udev rule to recognise the thing and if I create the node manually there is strangeness and an unwillingness to work!

I'll hack away at it, but I obviously need to get a better understanding of the 2.6 input layer also...

-bash-3.1# ls js* -l
crw-r--r-- 1 root 4294967258 13, 0 Feb 10 19:39 js0 -bash-3.1# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda1 189303128 159489980 20197044 89% /

tmpfs                     6852         0      6852   0% /lib/init/rw
udev                     10240         4     10236   1% /dev
tmpfs                     6852         0      6852   0% /dev/shm

/dev/gdrom 189303128 159489980 20197044 89% /mnt
-bash-3.1# mknod js0 c 13 0
mknod: `js0': File exists
-bash-3.1# rm js0
-bash-3.1# mknod js0 c 13
0
-bash-3.1# ls js* -l
crw-r--r-- 1 root 4294967258 13, 0 Feb 10 19:40 js0 -bash-3.1# cat js0
cat: js0: No such device

#5 lore raw
In reply to Adrian McMenamin
Quoted 11 lines · Adrian McMenamin
Quoted 8 lines · Harley Laue
Quoted 3 lines · you

As below shows I think I have successfully ported the 2.4 Dreamcast controller driver to 2.6 - but how can I test it? Is there a device I should be looking for in /dev that I could just cat?

Cool.
if a /dev/input/js? or /dev/js? does not show up you can try:
mknod js0 c 13 0
then you can cat js0 and move the joystick to see if it's working

Quoted 4 lines

Clearly the porting isn't as simple as I'd hoped: I cannot seem to get a udev rule to recognise the thing and if I create the node manually there is strangeness and an unwillingness to work!

worked out what I was doing wrong...not compiling in the userland support. Once that was done everything Just Worked ...afaics any way