mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cameron Gutman <aicommander@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	LuK1337 <priv.luk@gmail.com>
Cc: Richard Fontana <rfontana@redhat.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Allison Randal <allison@lohutok.net>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: xpad - Add custom init packet for Xbox One S controllers
Date: Tue, 21 Apr 2020 17:54:19 -0700	[thread overview]
Message-ID: <92b71dc5-ddd5-7ffd-65f8-65a6610dfe43@gmail.com> (raw)
In-Reply-To: <20200421180851.GA125362@dtor-ws>

On 4/21/20 11:08 AM, Dmitry Torokhov wrote:
> Adding Cameron...
> 
> On Tue, Apr 21, 2020 at 11:24:33AM +0200, LuK1337 wrote:
>> From: Łukasz Patron <priv.luk@gmail.com>
>>
>> Sending [ 0x05, 0x20, 0x02, 0x0f, 0x06 ] packet for
>> Xbox One S controllers fixes an issue where controller
>> is stuck in Bluetooth mode and not sending any inputs.
>>

This one is much better. It's working on both the old 3.1 firmware and the
new 4.8 firmware for the Xbox One S controller.

Just for fun I also decided to test this against my other Xbox One gamepads:
- idVendor=045e, idProduct=02ea, bcdDevice= 3.01
- idVendor=045e, idProduct=02ea, bcdDevice= 4.08
- idVendor=045e, idProduct=02dd, bcdDevice= 2.03
- idVendor=24c6, idProduct=543a, bcdDevice= 1.01

Initialization was successful on all 4 tested gamepads, so this packet looks
well-tolerated across the range of devices.

I think we should also mark this for stable to get this backported to older
kernels, otherwise input will break as users update their firmware. Since you
mentioned you are new to LKML, you can read about stable updates here [0]
and include the Cc tag on v2 of this patch with my suggested changes below
if you agree.

>> Signed-off-by: Łukasz Patron <priv.luk@gmail.com>
>> ---
>>  drivers/input/joystick/xpad.c | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
>> index 6b40a1c68f9f..4e1781968411 100644
>> --- a/drivers/input/joystick/xpad.c
>> +++ b/drivers/input/joystick/xpad.c
>> @@ -458,6 +458,15 @@ static const u8 xboxone_fw2015_init[] = {
>>  	0x05, 0x20, 0x00, 0x01, 0x00
>>  };
>>  
>> +/*
>> + * This packet is required for Xbox One S pads (0x045e:0x02ea)
>> + * to initialize the controller that was previously used in
>> + * Bluetooth mode.
>> + */
>> +static const u8 xboxone_s_init[] = {
>> +	0x05, 0x20, 0x02, 0x0f, 0x06
>> +};

The sequence numbers are populated when the driver sends the init packet, so
you should go ahead and replace that 0x02 with 0x00 to match the other packets.

>> +
>>  /*
>>   * This packet is required for the Titanfall 2 Xbox One pads
>>   * (0x0e6f:0x0165) to finish initialization and for Hori pads
>> @@ -516,6 +525,7 @@ static const struct xboxone_init_packet xboxone_init_packets[] = {
>>  	XBOXONE_INIT_PKT(0x0e6f, 0x0165, xboxone_hori_init),
>>  	XBOXONE_INIT_PKT(0x0f0d, 0x0067, xboxone_hori_init),
>>  	XBOXONE_INIT_PKT(0x0000, 0x0000, xboxone_fw2015_init),
>> +	XBOXONE_INIT_PKT(0x045e, 0x02ea, xboxone_s_init),

Can you also add an entry here for the Xbox One Elite Series 2 (0x045e, 0x0b00)
gamepad? According to [1], it has the same problem as the Xbox One S with the
4.8 firmware when exiting Bluetooth mode.

>>  	XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init1),
>>  	XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init2),
>>  	XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init),
>> -- 
>> 2.26.0
>>
> 

[0]: https://www.kernel.org/doc/html/v5.6/process/stable-kernel-rules.html
[1]: https://github.com/spurious/SDL-mirror/commit/a0f80727972429bad309d7cf6cca949801d11d45

Regards,
Cameron




  reply	other threads:[~2020-04-22  0:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15 18:59 [PATCH] Input: xpad - Update xboxone fw2015 init packet LuK1337
2020-04-19  4:16 ` Dmitry Torokhov
2020-04-19  7:46   ` LuK1337
2020-04-19 18:01     ` Dmitry Torokhov
     [not found]       ` <CAJmEJMzzFO1G=iQy=EfwQ89iWMjpcpupBjBkG29aigqYsc36bA@mail.gmail.com>
2020-04-19 18:22         ` LuK1337
2020-04-21  4:56       ` Cameron Gutman
2020-04-21  9:24         ` [PATCH] Input: xpad - Add custom init packet for Xbox One S controllers LuK1337
2020-04-21 18:08           ` Dmitry Torokhov
2020-04-22  0:54             ` Cameron Gutman [this message]
2020-04-22  7:45               ` LuK1337
2020-04-22  7:46               ` LuK1337
2020-04-22  7:52               ` LuK1337
2020-04-22 17:20                 ` Cameron Gutman
2020-04-22 21:13                   ` Dmitry Torokhov

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=92b71dc5-ddd5-7ffd-65f8-65a6610dfe43@gmail.com \
    --to=aicommander@gmail.com \
    --cc=allison@lohutok.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=priv.luk@gmail.com \
    --cc=rfontana@redhat.com \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome