diff mbox series

Input: xpad - Update xboxone fw2015 init packet

Message ID 20200419074624.9955-1-priv.luk@gmail.com (mailing list archive)
State Under Review
Headers show
Series Input: xpad - Update xboxone fw2015 init packet | expand

Commit Message

Łukasz Patron April 19, 2020, 7:46 a.m. UTC
From: Łukasz Patron <priv.luk@gmail.com>

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 <priv.luk@gmail.com>
---
 drivers/input/joystick/xpad.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Dmitry Torokhov April 19, 2020, 6:01 p.m. UTC | #1
On Sun, Apr 19, 2020 at 09:46:23AM +0200, LuK1337 wrote:
> From: Łukasz Patron <priv.luk@gmail.com>
> 
> 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 <priv.luk@gmail.com>

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.
Łukasz Patron April 19, 2020, 6:22 p.m. UTC | #2
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 <priv.luk@gmail.com> 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 <dmitry.torokhov@gmail.com> wrote:
>>
>> On Sun, Apr 19, 2020 at 09:46:23AM +0200, LuK1337 wrote:
>> > From: Łukasz Patron <priv.luk@gmail.com>
>> >
>> > 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 <priv.luk@gmail.com>
>>
>> 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
Cameron Gutman April 21, 2020, 4:56 a.m. UTC | #3
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 <priv.luk@gmail.com>
>>
>> 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 <priv.luk@gmail.com>
> 
> 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
diff mbox series

Patch

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
 };
 
 /*