Skip to contentSkip to conversation

Input: xpad - Update xboxone fw2015 init packet

PATCH In review LuK1337 3 participants 14 messages Apr 15, 2020 – Apr 22, 2020 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

LuK1337

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/input/joystick/xpad.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/joystick/xpad.c +2 -1
index 6b40a1c68f9f..894fa81f717a 100644
@@ -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
 };
 
 /*
Signature · 1 line
2.26.0
maintainer
#1 lore raw

Hi,

Quoted 6 lines · 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.

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

Thanks.

Signature · 1 line
Dmitry
author
#2 lore raw

PATCH 1/1 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.

---
 drivers/input/joystick/xpad.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/joystick/xpad.c +2 -1
index 6b40a1c68f9f..894fa81f717a 100644
@@ -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
 };
 
 /*
Signature · 1 line
2.26.0
maintainer
#3 lore raw
Quoted 8 lines · 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.

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?

Quoted 21 lines
---
 drivers/input/joystick/xpad.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/joystick/xpad.c +2 -1
index 6b40a1c68f9f..894fa81f717a 100644
@@ -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
 };
 
 /*
Signature · 1 line
2.26.0

Thanks.

Signature · 1 line
Dmitry

A message that is not in the archive (sent off-list or not yet received): CAJmEJMzzFO1G=iQy=EfwQ89iWMjpcpupBjBkG29aigqYsc36bA@mail.gmail.com

author
#5 lore raw

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)

Quoted 48 lines · 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.

Quoted 42 lines · Dmitry Torokhov
Quoted 8 lines · 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.

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?

Quoted 19 lines
---
 drivers/input/joystick/xpad.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/joystick/xpad.c +2 -2
index 6b40a1c68f9f..894fa81f717a 100644
@@ -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
 };
 
 /*
--
Quoted 2 lines

2.26.0

Thanks.

--
Dmitry

#6 lore raw
In reply to Dmitry Torokhov
Quoted 8 lines · Dmitry Torokhov
Quoted 7 lines · 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.

Quoted 7 lines
Quoted 1 line

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.

Quoted 4 lines
Quoted 4 lines
---
 drivers/input/joystick/xpad.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 12 lines

drivers/input/joystick/xpad.c struct xboxone_init_packet { · line 460

Quoted 12 lines
drivers/input/joystick/xpad.c +2 -1
index 6b40a1c68f9f..894fa81f717a 100644
@@ -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.

Quoted 7 lines
Quoted 4 lines
drivers/input/joystick/xpad.c +0 -0
 /*
Signature · 1 line
2.26.0

Thanks.

Regards,
Cameron

author
#7 lore raw

PATCH 1/1 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.

---
 drivers/input/joystick/xpad.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/input/joystick/xpad.c +10 -0
index 6b40a1c68f9f..4e1781968411 100644
@@ -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),
Signature · 1 line
2.26.0
maintainer
#8 lore raw

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

Adding Cameron...

Quoted 42 lines · 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.

---
 drivers/input/joystick/xpad.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/input/joystick/xpad.c +10 -0
index 6b40a1c68f9f..4e1781968411 100644
@@ -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),
Signature · 1 line
2.26.0
Signature · 1 line
Dmitry
#9 lore raw

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

Quoted 9 lines · Dmitry Torokhov

Adding Cameron...

Quoted 6 lines · 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.

Quoted 13 lines
Quoted 13 lines
---
 drivers/input/joystick/xpad.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/input/joystick/xpad.c +0 -0
index 6b40a1c68f9f..4e1781968411 100644
@@ -458,6 +458,15 @@ static const u8 xboxone_fw2015_init[] = {
 	0x05, 0x20, 0x00, 0x01, 0x00
 };
 
Quoted 8 lines

drivers/input/joystick/xpad.c static const u8 xboxone_fw2015_init[] = { · line 468

Quoted 8 lines
drivers/input/joystick/xpad.c +8 -0
+/*
+ * 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.

Quoted 9 lines

drivers/input/joystick/xpad.c static const struct xboxone_init_packet xboxone_init_packets[] = { · line 528

Quoted 9 lines
drivers/input/joystick/xpad.c +2 -0
+
 /*
  * 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.

Quoted 7 lines
Quoted 6 lines
drivers/input/joystick/xpad.c +0 -0
 	XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init1),
 	XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init2),
 	XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init),
Signature · 1 line
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

author
#10 lore raw

PATCH 1/1 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.

---
 drivers/input/joystick/xpad.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/input/joystick/xpad.c +12 -0
index 6b40a1c68f9f..c77cdb3b62b5 100644
@@ -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),
Signature · 1 line
2.26.0
author
#11 lore raw

PATCH 1/1 Input: xpad - Add custom init packet for Xbox One S controllers

In reply to Cameron Gutman

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.

---
 drivers/input/joystick/xpad.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/input/joystick/xpad.c +12 -0
index 6b40a1c68f9f..c77cdb3b62b5 100644
@@ -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),
Signature · 1 line
2.26.0
author
#12 lore raw

PATCH 1/1 Input: xpad - Add custom init packet for Xbox One S controllers

In reply to Cameron Gutman

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.

---
 drivers/input/joystick/xpad.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/input/joystick/xpad.c +12 -0
index 6b40a1c68f9f..c77cdb3b62b5 100644
@@ -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),
Signature · 1 line
2.26.0
Reviewed-by on v1 1/1
#13 lore raw

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

Quoted 8 lines · 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.

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

Quoted 35 lines
---
 drivers/input/joystick/xpad.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/input/joystick/xpad.c +12 -0
index 6b40a1c68f9f..c77cdb3b62b5 100644
@@ -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),
maintainer Applied
#14 lore raw

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

Quoted 7 lines · Cameron Gutman
Quoted 6 lines · 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.

Quoted 8 lines
Quoted 2 lines

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

Applied, thank you.

Quoted 37 lines
Quoted 36 lines
---
 drivers/input/joystick/xpad.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/input/joystick/xpad.c +12 -0
index 6b40a1c68f9f..c77cdb3b62b5 100644
@@ -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),
Signature · 1 line
Dmitry