HID: sony: Initialize the controller LEDs with a device ID value
authorFrank Praznik <frank.praznik@oh.rr.com>
Mon, 14 Apr 2014 14:11:35 +0000 (10:11 -0400)
committerJiri Kosina <jkosina@suse.cz>
Thu, 24 Apr 2014 16:53:41 +0000 (18:53 +0200)
commit8025087acf9d2b941bae93b3e0967560e7e03e87
tree469b78c498d5e127461638e1b944f12466a9d6c9
parent314531f18de0063131567c535af0cec3e4969c24
HID: sony: Initialize the controller LEDs with a device ID value

Add an IDA id allocator to assign unique, sequential device ids to Sixaxis and
DualShock 4 controllers.

Use the device ID to initialize the Sixaxis and DualShock 4 controller LEDs to
default values.  The number or color of the controller is set relative to other
connected Sony controllers.

Set the LED class brightness values to the initial values and add the new led to
the array before calling led_classdev_register so that the correct brightness
value shows up in the LED sysfs entry.

Use explicit module init and exit functions since the IDA allocator must be
manually destroyed when the module is unloaded.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-sony.c