[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <5aa163d00902212131g7cf9218ewd8a6396a7f1c95fd@mail.gmail.com>
Date: Sun, 22 Feb 2009 00:31:27 -0500
From: Mike Murphy <mamurph@...clemson.edu>
To: linux-usb@...r.kernel.org, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Oliver Neukum <oliver@...kum.org>, Greg KH <greg@...ah.com>
Subject: [PATCH] (revision 1) input: xpad.c - Xbox 360 wireless and sysfs
support
Greetings,
Attached is a revised version of my previous patch to
drivers/input/joystick/xpad.c, which should apply without issues to
the current stable tree (2.6.28.7 at the time of this writing). I have
made a number of major changes since the original:
1. Removed kobject and used input device's existing kobject for sysfs
via DEVICE_ATTR. All attributes are part of a game_device group, which
I will document once this patch has been reviewed. Thanks to Greg K-H
for his help with the sysfs interface and helpful feedback. Return
values for sscanf are also now checked, and the ugly strcmp code has
been replaced by a cleaner solution (thanks Oliver Neukum). Wireless
360 controllers now produce an online/offline uevent when
connecting/disconnecting, for later userspace use. Additionally, the
whole sysfs interface is now dependent upon CONFIG_SYSFS (the driver
should continue to work without it).
2. urb submissions while holding mutexes have been reverted to
GFP_KERNEL, and fixes have been made to the shared workqueue code to
account for possible adverse events (such as removal of the device
before the work gets done). Thanks to Oliver Neukum for his feedback.
3. Re-factored the code a bit and split it into two pieces (xpad.h and
xpad.c). The division of the main data structures into a header file
makes development on the main body much easier.
4. After extensive testing and debugging with a popular fighting game
in an emulator (with 3-4 concurrent players on wireless 360
controllers), I changed the original square axis algorithm to an axis
limiting and scaling algorithm that works on a per-stick basis. This
new algorithm is substantially less jumpy when using a square axis,
and it permits the size of the inscribed square to be adjusted on a
per-controller basis. The nominal value to use to achieve the largest
possible inscribed square on "perfect" hardware is 23170, but
manufacturing variations in the controllers might require a smaller
number.
Comments and feedback on this revision are greatly appreciated, and I
plan to test all the supported hardware I can get my hands on (need to
borrow some wired classic and 360 devices) to be sure the new code
doesn't break support for older devices. I will also document the
userspace interface by submitting a Documentation/ABI/testing patch
with the "final" version of the driver, once it has been nailed down.
Thanks,
Mike
--
Mike Murphy
Ph.D. Candidate and NSF Graduate Research Fellow
Clemson University School of Computing
120 McAdams Hall
Clemson, SC 29634-0974 USA
Tel: +1 864.656.2838 Fax: +1 864.656.0145
http://cirg.cs.clemson.edu/~mamurph
View attachment "xpad.patch" of type "text/x-patch" (59382 bytes)
Powered by blists - more mailing lists