All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Clement Calmels <clement.calmels@free.fr>
Cc: linux-input@vger.kernel.org, Pavel Rojtberg <rojtberg@gmail.com>,
	"Pierre-Loup A. Griffais" <githubpublic@plagman.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: xpad - use LED API when identifying wireless controllers
Date: Sat, 19 Dec 2015 23:55:04 -0800	[thread overview]
Message-ID: <20151220075504.GA35575@dtor-ws> (raw)
In-Reply-To: <20151219221709.5b5947ec@gromit>

On Sat, Dec 19, 2015 at 10:17:09PM +0100, Clement Calmels wrote:
> On Wed, 16 Dec 2015 14:44:08 -0800
> Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> 
> > 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,
> 
> Hi Dimitri,

Hi Clement,

> 
> My hardware: two wireless xpad 360 using a single usb receiver.
> 
> Power on the first gamepad => light the "1" led.
> Power on the second gamepad => light the "2" led.
> 
> Suspend the PC (systemctl suspend): the two gamepads are "disconnected"
> => blinking circle.
> 
> Resume the PC, the two gamepads keep blinking but are working (tested
> with jstest).
> 
> Power off and on the gamepad => still blinking.
> Reload (rmmod/modprobe) the xpad module => still blinking.
> 
> That said, without your patch, the behavior is exactly the same.
> It seems that the suspend/resume broke the led feature. Even using
> the /sys/class/leds/xpad0/brigthness sysfs entry does not work.
> 

OK, so the patch does work (the device is still correctly identified),
but resume requires additional patches. Could you try 'xpad' branch of
my tree on kernel.org [1] and let me know if it works for you?

Thanks!

-- 
Dmitry

[1] git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git

  reply	other threads:[~2015-12-20  7:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151220075504.GA35575@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=clement.calmels@free.fr \
    --cc=githubpublic@plagman.net \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rojtberg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.