Skip to content

Commit

Permalink
Input: xpad - use LED API when identifying wireless controllers
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dtor committed Jan 4, 2016
1 parent 4220f7d commit d9be398
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/joystick/xpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d9be398

Please sign in to comment.