Parent: 1a124e4accb1a0d1a137bd422df3f334186b7acf
Author: Antonio Ospite <ao2@ao2.it>
Committer: Szymon Janc <szymon.janc@gmail.com>
Date: 2014-06-08 15:54:41
Tree: 80e16e56a34d0515b62559ed57b23124eb0d72ca
plugins/sixaxis: Add a set_leds_sysfs() function On recent kernels the hid-sony driver exposes leds class entries in sysfs for setting the Sixaxis LEDs, use this interface and fall back to hidraw in case using sysfs fails (e.g. on older hid-sony versions). Setting the LEDs via sysfs is the preferred way on newer kernels, the rationale behind that is: 1. the Sixaxis uses the same HID output report for setting both LEDs and rumble effects; 2. hid-sony remembers the state of LEDs in order to preserve them when setting rumble effects; 3. when the LEDs are set via hidraw hid-sony has no way to know the new LEDs state and thus can change the LEDs in an inconsistent way when setting rumble effects later. Also require libudev >= 172, this is where udev_enumerate_add_match_parent() has been first introduced. NOTE: using udev_enumerate_add_match_parent() results in a memory leak when enumerating child devices, this has been fixed in udev 207; the commit which fixes the issue is this one: http://cgit.freedesktop.org/systemd/systemd/commit/?id=51cc07576e119dea6e65478eeba9472979fd0936
Diffstat
| M | configure.ac | | | 4 | ++- - |
| M | plugins/sixaxis.c | | | 89 | ++++++++++++++++++++++++++++++++++++++++- - - - |
2 files changed, 87 insertions(+), 6 deletions(-)