From: Anssi Hannula <anssi.hannula@gmail.com>
To: linux-hotplug@vger.kernel.org
Subject: ID_CLASS joystick
Date: Tue, 08 Aug 2006 21:49:00 +0000 [thread overview]
Message-ID: <44D906CC.9010805@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1248 bytes --]
Hi!
I'd like to have "joystick" (or maybe "game_controller") added to the
possible values of ID_CLASS. The possible values are currently "spkr",
"kbd", "mouse", "ir".
Joydev (drivers/input/joydev.c) considers a device to be a joystick when
it has (ABS_X || ABS_WHEEL || ABS_THROTTLE) && !BTN_TOUCH.
Modalias has the necessary info. Example modalias for my sw p2 joystick:
MODALIAS=input:b0003v045Ep0038e0108-e0,1,3,k120,121,122,123,124,125,126,127,ra0,1,5,6,10,11,mlsfw
ABS caps are after "a" and KEY caps are after "k". ABS_X=0, ABS_WHEEL=8,
ABS_THROTTLE=6, BTN_TOUCH=14A.
Then we get the following rule to add into 60-persistent-input.rules:
SYSFS{modalias}=="input:*-*a[068],*|input:*-*a*,[68],*m*",
SYSFS{modalias}!="input:*-*k*14A,*r*", ENV{ID_CLASS}="joystick"
Another possibility would be to match the capabilites flags in sysfs,
but they're bitfields. For example the device in the above example has
"30063" in /capabilities/abs which means 110000000001100011. I don't
know how to parse that easily.
I need this "joystick" value, because it would rather cleanly allow to
easily differentiate joystick evdev device nodes, so that they can be
chowned to the console user by pam.
Patch is attached. Please comment.
--
Anssi Hannula
[-- Attachment #2: udev-096-joystick-class.patch --]
[-- Type: text/x-patch, Size: 697 bytes --]
diff -Nur -x '*~' udev-096/etc/udev/60-persistent-input.rules udev-096-fi/etc/udev/60-persistent-input.rules
--- udev-096/etc/udev/60-persistent-input.rules 2006-07-09 22:48:19.000000000 +0300
+++ udev-096-fi/etc/udev/60-persistent-input.rules 2006-08-06 23:36:10.000000000 +0300
@@ -2,6 +2,9 @@
SUBSYSTEM!="input", GOTO="persistent_input_end"
KERNEL=="input[0-9]*", GOTO="persistent_input_end"
+# joystick devices
+SYSFS{modalias}=="input:*-*a[068],*|input:*-*a*,[68],*m*", SYSFS{modalias}!="input:*-*k*14A,*r*", ENV{ID_CLASS}="joystick"
+
# usb devices
BUS=="usb", IMPORT{program}="usb_id -x"
BUS=="usb", SYSFS{bInterfaceClass}=="03", SYSFS{bInterfaceProtocol}=="01", ENV{ID_CLASS}="kbd"
[-- Attachment #3: Type: text/plain, Size: 373 bytes --]
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
[-- Attachment #4: Type: text/plain, Size: 226 bytes --]
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next reply other threads:[~2006-08-08 21:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-08 21:49 Anssi Hannula [this message]
2006-08-11 14:49 ` ID_CLASS joystick Kay Sievers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44D906CC.9010805@gmail.com \
--to=anssi.hannula@gmail.com \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).