Comment 28 for bug 492056

Revision history for this message
Oak (oak-brno) wrote :

SOLVED! HALLELUYAH!!!

Simple solution, after all googling... No need to replace kernel!!

Preface: Your joystick is shown in:
# dmesg | grep joy
but doesn't come up i.e. in js_demo. This is apparently due to problem with some 2.6 kernels. The easy solution I tested is to replace a single module joydev.ko (instead of rebuilding and reinstalling all kernel).

0) I had installed kernel sources and stuff to compile it. You MUST find out what kernel you're using:
# uname -r
...and use exactly this kernel. In my case it's "linux-2.6.31.5-0.1-Desktop" which sources I will copy to "linux-2.6.31.5-OAK". In all cases you must replace my kernel version for yours in all commands bellow. "OAK" is just a suffix to my kernel sources copy - you can use other suffix of course.
1) I copied my current kernel to /usr/src/linux-2.6.31.5-OAK so that I can modify the sources safely
# cp /usr/src/linux-2.6.31.5-0.1-Desktop /usr/src/linux-2.6.31.5-OAK
2) Modify the file /usr/src/linux-2.6.31.5-OAK/drivers/input/joydev.c - remove following lines:
---
  .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
    INPUT_DEVICE_ID_MATCH_KEYBIT,
  .evbit = { BIT_MASK(EV_KEY) },
  .keybit = { [BIT_WORD(BTN_DIGI)] = BIT_MASK(BTN_DIGI) },
---
... which are beteween brackets bellow text "}, /* Avoid itouchpads and touchscreens */". This exactl what they are saying in the first post of this thread.
3) I followed tutorial ("http://en.opensuse.org/Configure,_Build_and_Install_a_Custom_Linux_Kernel" for my OpenSUSE) for rebulding the kernel, up to the point where you run "make". This includes few commands:
cd /usr/src/linux-2.6.31.5-OAK
# make clean
# make mrproper
# make cloneconfig
# make xconfig (probably not required for building a module only, but better check the config in xconfig)
... now this is where you would run "make". But instead, build kernel modules for input devices only:
# make SUBDIRS=/usr/src/linux-2.6.31.5-OAK/drivers/input/ modules
... this will take some time, cca 5 minutes on my quad machine. When finished, provided it didn't ended up with an "Error #" statement (install whatever you're missing for kernel building then), replace with your new input.ko module the old one:
# mv /lib/modules/2.6.31.5-0.1-desktop/kernel/drivers/input/joydev.ko /lib/modules/2.6.31.5-0.1-desktop/kernel/drivers/input/joydev.ko.bak
# cp /usr/src/linux-2.6.31.5-OAK/drivers/input/joydev.ko /lib/modules/2.6.31.5-0.1-desktop/kernel/drivers/input/joydev.ko
4) Reboot and ENJOY! Now when you run (with X52 plugged in :-D) js_demo you should see the joystick and it's reactions:
oak@linux:~> js_demo
Joystick test program.
~~~~~~~~~~~~~~~~~~~~~~
Joystick 0: "Saitek Saitek X52 Flight Control System"
Joystick 1 not detected
Joystick 2 not detected
Joystick 3 not detected
Joystick 4 not detected
Joystick 5 not detected
Joystick 6 not detected
Joystick 7 not detected
+--------------------JS.0----------------------+
| Btns Ax:0 Ax:1 Ax:2 Ax:3 Ax:4 Ax:5 Ax:6 Ax:7 Ax:8 Ax:9 Ax:10 |
+----------------------------------------------+
...
I hope it helps.

Regards,

Oak