2020-04-16 00:59:47

by LuK1337

[permalink] [raw]
Subject: [PATCH] Input: xpad - Update xboxone fw2015 init packet

Appending { 0x05, 0x20, 0x02, 0x0f, 0x06 } to
xboxone_fw2015_init fixes an issue where the
controller is somewhat stuck in bluetooth
mode until you plug it into Windows PC.

Signed-off-by: LuK1337 <[email protected]>
---
drivers/input/joystick/xpad.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 6b40a1c68f9f..894fa81f717a 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -455,7 +455,8 @@ struct xboxone_init_packet {
* or later firmware installed (or present from the factory).
*/
static const u8 xboxone_fw2015_init[] = {
- 0x05, 0x20, 0x00, 0x01, 0x00
+ 0x05, 0x20, 0x00, 0x01, 0x00,
+ 0x05, 0x20, 0x02, 0x0f, 0x06
};

/*
--
2.26.0


2020-04-19 04:18:35

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH] Input: xpad - Update xboxone fw2015 init packet

Hi,

On Wed, Apr 15, 2020 at 08:59:40PM +0200, LuK1337 wrote:
> Appending { 0x05, 0x20, 0x02, 0x0f, 0x06 } to
> xboxone_fw2015_init fixes an issue where the
> controller is somewhat stuck in bluetooth
> mode until you plug it into Windows PC.
>
> Signed-off-by: LuK1337 <[email protected]>

Thank you for the patch by the signed off needs a real name please.

Thanks.

--
Dmitry

2020-04-19 07:48:57

by LuK1337

[permalink] [raw]
Subject: [PATCH] Input: xpad - Update xboxone fw2015 init packet

From: Łukasz Patron <[email protected]>

Appending { 0x05, 0x20, 0x02, 0x0f, 0x06 } to
xboxone_fw2015_init fixes an issue where the
controller is somewhat stuck in bluetooth
mode until you plug it into Windows PC.

Signed-off-by: Łukasz Patron <[email protected]>
---
drivers/input/joystick/xpad.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 6b40a1c68f9f..894fa81f717a 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -455,7 +455,8 @@ struct xboxone_init_packet {
* or later firmware installed (or present from the factory).
*/
static const u8 xboxone_fw2015_init[] = {
- 0x05, 0x20, 0x00, 0x01, 0x00
+ 0x05, 0x20, 0x00, 0x01, 0x00,
+ 0x05, 0x20, 0x02, 0x0f, 0x06
};

/*
--
2.26.0

2020-04-19 18:24:26

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH] Input: xpad - Update xboxone fw2015 init packet

On Sun, Apr 19, 2020 at 09:46:23AM +0200, LuK1337 wrote:
> From: Łukasz Patron <[email protected]>
>
> Appending { 0x05, 0x20, 0x02, 0x0f, 0x06 } to
> xboxone_fw2015_init fixes an issue where the
> controller is somewhat stuck in bluetooth
> mode until you plug it into Windows PC.
>
> Signed-off-by: Łukasz Patron <[email protected]>

Thank you Łukasz. Could you please tell me what device(s) have you
observed the issue with? I am a bit worried if this may interfere with
other devices that currently work fine with the driver. Cameron, Mark,
do you have any concerns here?

> ---
> drivers/input/joystick/xpad.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index 6b40a1c68f9f..894fa81f717a 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -455,7 +455,8 @@ struct xboxone_init_packet {
> * or later firmware installed (or present from the factory).
> */
> static const u8 xboxone_fw2015_init[] = {
> - 0x05, 0x20, 0x00, 0x01, 0x00
> + 0x05, 0x20, 0x00, 0x01, 0x00,
> + 0x05, 0x20, 0x02, 0x0f, 0x06
> };
>
> /*
> --
> 2.26.0
>

Thanks.

--
Dmitry

2020-04-19 19:02:52

by LuK1337

[permalink] [raw]
Subject: Re: [PATCH] Input: xpad - Update xboxone fw2015 init packet

I had this issue with official Microsoft Xbox One S Controler (model: 1708);
It might also be firmware version related as I recently updated my firmware
to the latest one but I'm not sure about that.

(also sorry for duplicate msgs that you might have received from me;
I'm new to lkml)
On Sun, Apr 19, 2020 at 8:14 PM LuK1337 <[email protected]> wrote:
>
> I had this issue with official Microsoft Xbox One S Controler (model: 1708);
> It might also be firmware version related as I recently updated my firmware
> to the latest one but I'm not sure about that.
>
> On Sun, Apr 19, 2020 at 8:01 PM Dmitry Torokhov <[email protected]> wrote:
>>
>> On Sun, Apr 19, 2020 at 09:46:23AM +0200, LuK1337 wrote:
>> > From: Łukasz Patron <[email protected]>
>> >
>> > Appending { 0x05, 0x20, 0x02, 0x0f, 0x06 } to
>> > xboxone_fw2015_init fixes an issue where the
>> > controller is somewhat stuck in bluetooth
>> > mode until you plug it into Windows PC.
>> >
>> > Signed-off-by: Łukasz Patron <[email protected]>
>>
>> Thank you Łukasz. Could you please tell me what device(s) have you
>> observed the issue with? I am a bit worried if this may interfere with
>> other devices that currently work fine with the driver. Cameron, Mark,
>> do you have any concerns here?
>>
>> > ---
>> > drivers/input/joystick/xpad.c | 3 ++-
>> > 1 file changed, 2 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
>> > index 6b40a1c68f9f..894fa81f717a 100644
>> > --- a/drivers/input/joystick/xpad.c
>> > +++ b/drivers/input/joystick/xpad.c
>> > @@ -455,7 +455,8 @@ struct xboxone_init_packet {
>> > * or later firmware installed (or present from the factory).
>> > */
>> > static const u8 xboxone_fw2015_init[] = {
>> > - 0x05, 0x20, 0x00, 0x01, 0x00
>> > + 0x05, 0x20, 0x00, 0x01, 0x00,
>> > + 0x05, 0x20, 0x02, 0x0f, 0x06
>> > };
>> >
>> > /*
>> > --
>> > 2.26.0
>> >
>>
>> Thanks.
>>
>> --
>> Dmitry

2020-04-21 04:59:04

by Cameron Gutman

[permalink] [raw]
Subject: Re: [PATCH] Input: xpad - Update xboxone fw2015 init packet

On 4/19/20 11:01 AM, Dmitry Torokhov wrote:
> On Sun, Apr 19, 2020 at 09:46:23AM +0200, LuK1337 wrote:
>> From: Łukasz Patron <[email protected]>
>>
>> Appending { 0x05, 0x20, 0x02, 0x0f, 0x06 } to
>> xboxone_fw2015_init fixes an issue where the
>> controller is somewhat stuck in bluetooth
>> mode until you plug it into Windows PC.
>>
>> Signed-off-by: Łukasz Patron <[email protected]>
>
> Thank you Łukasz. Could you please tell me what device(s) have you
> observed the issue with? I am a bit worried if this may interfere with
> other devices that currently work fine with the driver. Cameron, Mark,
> do you have any concerns here?
>

Yes, I gave it a try here, and it looks like there's definitely some
breakages for non-updated controllers. It breaks the Covert Forces
edition Xbox One controller (0x045e, 0x02dd) and also another non-upgraded
Xbox One S controller of the same model as the affected controller
(0x045e, 0x02ea, firmware 3.1.1221.0).

On the plus side, it _does_ seem to fix the issue.

>> ---
>> drivers/input/joystick/xpad.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
>> index 6b40a1c68f9f..894fa81f717a 100644
>> --- a/drivers/input/joystick/xpad.c
>> +++ b/drivers/input/joystick/xpad.c
>> @@ -455,7 +455,8 @@ struct xboxone_init_packet {
>> * or later firmware installed (or present from the factory).
>> */
>> static const u8 xboxone_fw2015_init[] = {
>> - 0x05, 0x20, 0x00, 0x01, 0x00
>> + 0x05, 0x20, 0x00, 0x01, 0x00,
>> + 0x05, 0x20, 0x02, 0x0f, 0x06
>> };

One thing that strikes me as odd about this init packet is that it looks
like 2 packets strung together. Most of the other init packets have 0x20
as their second byte, and there's even something resembling a sequence
number in the third byte (0x02). Maybe these are supposed to be separate
init packets?

Hopefully we can find some init sequence that at least the One S controller
can tolerate on all known firmware versions. If not, the firmware rev is
available to us in bcdDevice, but I'd only like to use an explicit version
check as a last resort.

>> /*
>> --
>> 2.26.0
>>
>
> Thanks.
>

Regards,
Cameron

2020-04-21 09:27:00

by LuK1337

[permalink] [raw]
Subject: [PATCH] Input: xpad - Add custom init packet for Xbox One S controllers

From: Łukasz Patron <[email protected]>

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.

Signed-off-by: Łukasz Patron <[email protected]>
---
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
+};
+
/*
* 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),
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

2020-04-21 18:11:05

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH] Input: xpad - Add custom init packet for Xbox One S controllers

Adding Cameron...

On Tue, Apr 21, 2020 at 11:24:33AM +0200, LuK1337 wrote:
> From: Łukasz Patron <[email protected]>
>
> 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.
>
> Signed-off-by: Łukasz Patron <[email protected]>
> ---
> 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
> +};
> +
> /*
> * 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),
> 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
>

--
Dmitry

2020-04-22 00:56:20

by Cameron Gutman

[permalink] [raw]
Subject: Re: [PATCH] Input: xpad - Add custom init packet for Xbox One S controllers

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 <[email protected]>
>>
>> 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 <[email protected]>
>> ---
>> 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



2020-04-22 07:47:35

by LuK1337

[permalink] [raw]
Subject: [PATCH] Input: xpad - Add custom init packet for Xbox One S controllers

From: Łukasz Patron <[email protected]>

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.

Signed-off-by: Łukasz Patron <[email protected]>
---
drivers/input/joystick/xpad.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 6b40a1c68f9f..c77cdb3b62b5 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -458,6 +458,16 @@ static const u8 xboxone_fw2015_init[] = {
0x05, 0x20, 0x00, 0x01, 0x00
};

+/*
+ * This packet is required for Xbox One S (0x045e:0x02ea)
+ * and Xbox One Elite Series 2 (0x045e:0x0b00) pads to
+ * initialize the controller that was previously used in
+ * Bluetooth mode.
+ */
+static const u8 xboxone_s_init[] = {
+ 0x05, 0x20, 0x00, 0x0f, 0x06
+};
+
/*
* This packet is required for the Titanfall 2 Xbox One pads
* (0x0e6f:0x0165) to finish initialization and for Hori pads
@@ -516,6 +526,8 @@ 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),
+ XBOXONE_INIT_PKT(0x045e, 0x0b00, xboxone_s_init),
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

2020-04-22 07:49:10

by LuK1337

[permalink] [raw]
Subject: [PATCH] Input: xpad - Add custom init packet for Xbox One S controllers

From: Łukasz Patron <[email protected]>

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.

Signed-off-by: Łukasz Patron <[email protected]>
Cc: [email protected]
---
drivers/input/joystick/xpad.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 6b40a1c68f9f..c77cdb3b62b5 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -458,6 +458,16 @@ static const u8 xboxone_fw2015_init[] = {
0x05, 0x20, 0x00, 0x01, 0x00
};

+/*
+ * This packet is required for Xbox One S (0x045e:0x02ea)
+ * and Xbox One Elite Series 2 (0x045e:0x0b00) pads to
+ * initialize the controller that was previously used in
+ * Bluetooth mode.
+ */
+static const u8 xboxone_s_init[] = {
+ 0x05, 0x20, 0x00, 0x0f, 0x06
+};
+
/*
* This packet is required for the Titanfall 2 Xbox One pads
* (0x0e6f:0x0165) to finish initialization and for Hori pads
@@ -516,6 +526,8 @@ 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),
+ XBOXONE_INIT_PKT(0x045e, 0x0b00, xboxone_s_init),
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

2020-04-22 07:54:30

by LuK1337

[permalink] [raw]
Subject: [PATCH] Input: xpad - Add custom init packet for Xbox One S controllers

From: Łukasz Patron <[email protected]>

Sending [ 0x05, 0x20, 0x00, 0x0f, 0x06 ] packet for
Xbox One S controllers fixes an issue where controller
is stuck in Bluetooth mode and not sending any inputs.

Signed-off-by: Łukasz Patron <[email protected]>
Cc: [email protected]
---
drivers/input/joystick/xpad.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 6b40a1c68f9f..c77cdb3b62b5 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -458,6 +458,16 @@ static const u8 xboxone_fw2015_init[] = {
0x05, 0x20, 0x00, 0x01, 0x00
};

+/*
+ * This packet is required for Xbox One S (0x045e:0x02ea)
+ * and Xbox One Elite Series 2 (0x045e:0x0b00) pads to
+ * initialize the controller that was previously used in
+ * Bluetooth mode.
+ */
+static const u8 xboxone_s_init[] = {
+ 0x05, 0x20, 0x00, 0x0f, 0x06
+};
+
/*
* This packet is required for the Titanfall 2 Xbox One pads
* (0x0e6f:0x0165) to finish initialization and for Hori pads
@@ -516,6 +526,8 @@ 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),
+ XBOXONE_INIT_PKT(0x045e, 0x0b00, xboxone_s_init),
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

2020-04-22 17:21:47

by Cameron Gutman

[permalink] [raw]
Subject: Re: [PATCH] Input: xpad - Add custom init packet for Xbox One S controllers

On 4/22/20 12:52 AM, LuK1337 wrote:
> From: Łukasz Patron <[email protected]>
>
> Sending [ 0x05, 0x20, 0x00, 0x0f, 0x06 ] packet for
> Xbox One S controllers fixes an issue where controller
> is stuck in Bluetooth mode and not sending any inputs.
>
> Signed-off-by: Łukasz Patron <[email protected]>
> Cc: [email protected]

LGTM. Tested working on both of my Xbox One S gamepads:
- idVendor=045e, idProduct=02ea, bcdDevice= 3.01
- idVendor=045e, idProduct=02ea, bcdDevice= 4.08

Reviewed-by: Cameron Gutman <[email protected]>

> ---
> drivers/input/joystick/xpad.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index 6b40a1c68f9f..c77cdb3b62b5 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -458,6 +458,16 @@ static const u8 xboxone_fw2015_init[] = {
> 0x05, 0x20, 0x00, 0x01, 0x00
> };
>
> +/*
> + * This packet is required for Xbox One S (0x045e:0x02ea)
> + * and Xbox One Elite Series 2 (0x045e:0x0b00) pads to
> + * initialize the controller that was previously used in
> + * Bluetooth mode.
> + */
> +static const u8 xboxone_s_init[] = {
> + 0x05, 0x20, 0x00, 0x0f, 0x06
> +};
> +
> /*
> * This packet is required for the Titanfall 2 Xbox One pads
> * (0x0e6f:0x0165) to finish initialization and for Hori pads
> @@ -516,6 +526,8 @@ 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),
> + XBOXONE_INIT_PKT(0x045e, 0x0b00, xboxone_s_init),
> XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init1),
> XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init2),
> XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init),
>

2020-04-22 21:16:44

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH] Input: xpad - Add custom init packet for Xbox One S controllers

On Wed, Apr 22, 2020 at 10:20:08AM -0700, Cameron Gutman wrote:
> On 4/22/20 12:52 AM, LuK1337 wrote:
> > From: Łukasz Patron <[email protected]>
> >
> > Sending [ 0x05, 0x20, 0x00, 0x0f, 0x06 ] packet for
> > Xbox One S controllers fixes an issue where controller
> > is stuck in Bluetooth mode and not sending any inputs.
> >
> > Signed-off-by: Łukasz Patron <[email protected]>
> > Cc: [email protected]
>
> LGTM. Tested working on both of my Xbox One S gamepads:
> - idVendor=045e, idProduct=02ea, bcdDevice= 3.01
> - idVendor=045e, idProduct=02ea, bcdDevice= 4.08
>
> Reviewed-by: Cameron Gutman <[email protected]>

Applied, thank you.

>
> > ---
> > drivers/input/joystick/xpad.c | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> > index 6b40a1c68f9f..c77cdb3b62b5 100644
> > --- a/drivers/input/joystick/xpad.c
> > +++ b/drivers/input/joystick/xpad.c
> > @@ -458,6 +458,16 @@ static const u8 xboxone_fw2015_init[] = {
> > 0x05, 0x20, 0x00, 0x01, 0x00
> > };
> >
> > +/*
> > + * This packet is required for Xbox One S (0x045e:0x02ea)
> > + * and Xbox One Elite Series 2 (0x045e:0x0b00) pads to
> > + * initialize the controller that was previously used in
> > + * Bluetooth mode.
> > + */
> > +static const u8 xboxone_s_init[] = {
> > + 0x05, 0x20, 0x00, 0x0f, 0x06
> > +};
> > +
> > /*
> > * This packet is required for the Titanfall 2 Xbox One pads
> > * (0x0e6f:0x0165) to finish initialization and for Hori pads
> > @@ -516,6 +526,8 @@ 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),
> > + XBOXONE_INIT_PKT(0x045e, 0x0b00, xboxone_s_init),
> > XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init1),
> > XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init2),
> > XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init),
> >
>

--
Dmitry