Input: xpad - use LED API when identifying wireless controllers
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 16 Dec 2015 22:24:58 +0000 (14:24 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 4 Jan 2016 22:35:15 +0000 (14:35 -0800)
When lighting up the segment identifying wireless controller, Instead of
sending command directly to the controller, let's do it via LED API (usinf
led_set_brightness) so that LED object state is in sync with controller
state and we'll light up the correct segment on resume as well.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/joystick/xpad.c

index fa2612c9799c9fd49238fc34f8449bde16e23628..22e62056ca6b3a9b4051c7aca41962249710a0da 100644 (file)
@@ -1140,7 +1140,7 @@ static void xpad_send_led_command(struct usb_xpad *xpad, int command)
  */
 static void xpad_identify_controller(struct usb_xpad *xpad)
 {
-       xpad_send_led_command(xpad, (xpad->pad_nr % 4) + 2);
+       led_set_brightness(&xpad->led->led_cdev, (xpad->pad_nr % 4) + 2);
 }
 
 static void xpad_led_set(struct led_classdev *led_cdev,