All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Input: xpad - use LED API when identifying wireless controllers
@ 2015-12-16 22:44 Dmitry Torokhov
  2015-12-19 21:17 ` Clement Calmels
  0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Torokhov @ 2015-12-16 22:44 UTC (permalink / raw)
  To: linux-input
  Cc: Pavel Rojtberg, Pierre-Loup A. Griffais, Clement Calmels, linux-kernel

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>
---

I do not have the hardware so please try this out.

 drivers/input/joystick/xpad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 36328b3..00a766b 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -1118,7 +1118,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,
-- 
2.6.0.rc2.230.g3dd15c0


-- 
Dmitry

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-01-13 20:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-16 22:44 [PATCH] Input: xpad - use LED API when identifying wireless controllers Dmitry Torokhov
2015-12-19 21:17 ` Clement Calmels
2015-12-20  7:55   ` Dmitry Torokhov
2015-12-20 12:49     ` Pavel Rojtberg
2015-12-21 20:06       ` Dmitry Torokhov
2015-12-22  9:55         ` Clement Calmels
2015-12-24 18:11         ` Pavel Rojtberg
2016-01-05  0:50           ` Dmitry Torokhov
2016-01-12 18:04             ` Dmitry Torokhov
2016-01-13 20:34               ` Clement Calmels

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.