Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp170129ybz; Tue, 21 Apr 2020 17:56:20 -0700 (PDT) X-Google-Smtp-Source: APiQypLnf8SN9duLgG+iiqbmXm3ZX77TPciMb4t9p7N1ewz/cv8KUQ9DHn1PD2Lb1G6L8BJtDORU X-Received: by 2002:a50:f298:: with SMTP id f24mr22173357edm.199.1587516980680; Tue, 21 Apr 2020 17:56:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587516980; cv=none; d=google.com; s=arc-20160816; b=Uz5M8/HS/pbWP5d59wWM3tONqEq+1hdW0bDjxJ8lQuNHtxd8iJfhoyo3Vyt4RVfGL0 5Ap5nSA5z+J6XfnkNWXpP67pM7TzbQml6ToDFUWyD1e8JfjlP4d1JtbTmIX7URwJ16N1 1pvNgfiyvJUNRgTWKZoFGFztrB356Ujt+Rml5ZSi09222S5Vt67AIlhH+3npFgf2wWOF md2zPitQ/vW3Jz323pDNoGDZkL00k7P8AHNHV0Ogyn/GrBVd5EYykOeBw3VUdOnMDkC0 vLpJDq1D6n6ZYPVo+ParXzVy37397aOUFsNwQRx7U8+7BSjhhvZPvToTbIGs4+Gto9y7 0pEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=YOdZFvk+6bmIjWVMk3ZS5OgJr20Jdq2fWyo55D6d2YE=; b=W3OnuNABA2wSjGnuxKbY6Rl3DEn39rMijuDb3uUFno1Z99orQUKV2BSmqjHAzZooRH GyYJNhkyf3xZs/gFGkk3kGDZyIsEEvjeqyqgDQ2BIhPWn0Km9igKKI4d9zf5GFQ3ixt3 7locEvZdUiFdtAFxKv8L0bzRyvQEpyjT5q8GLpO3gIfzWq3Alfni1ue7fMr/GruGGcUn CQwGamaIhPQbDmw+bAB3b/o/qMa6DOa/l5bty8EYdB4/BYyzSu0ylFjUKRY1qhCQLvho qEe+ZdjpRiNjD4ex6PLqWfE1dASfpMOH7CXPMrAsEFIRGZT63wRmwem7Q6cGFjhiQIIL UvSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=n9EkAxNz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n16si2780161ejl.134.2020.04.21.17.55.57; Tue, 21 Apr 2020 17:56:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=n9EkAxNz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726423AbgDVAyX (ORCPT + 99 others); Tue, 21 Apr 2020 20:54:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726012AbgDVAyW (ORCPT ); Tue, 21 Apr 2020 20:54:22 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D839C0610D5; Tue, 21 Apr 2020 17:54:22 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id k18so223575pll.6; Tue, 21 Apr 2020 17:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=YOdZFvk+6bmIjWVMk3ZS5OgJr20Jdq2fWyo55D6d2YE=; b=n9EkAxNzxm5oKbg0/6Ld25HxkeLVB5k35B6s0UXQ/yYtU8fx2SqXvyp+vPo2us+ZWy P/zC32Gd6vlT2CbT560rszwyu78rZrM2K2aMP+rmbsAoPvUvSuj+cfJkAhYZF8nZvpy2 Y0a9hQYnxZmSHF4S14x7P/F2cMXH6vmDrX1/IZ8zzdXgihagBZhmyJSmE/NCwcSfrwIg 1V1slQ0FY91qJDjXDay1507ut2oUQQC8K9xSoUgp7U09qnBVZmLzDegJ7Ijwhl+LK484 TmOOLVbL7sxyIQJvLYRVhBOpw2hYQBFrAmNfpF0dD8g7bWmvdQtfXPOyBJAzQLtlFA68 8U1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=YOdZFvk+6bmIjWVMk3ZS5OgJr20Jdq2fWyo55D6d2YE=; b=dusxenv/46FeBM2U0xTl17VwJrqDnrIqkVQ/Kq0namrAO/Y9onMVbXl+MJi1KCvKoB FeiBr3gh717K/BGgSFXX30ET8f/1TUuTll72x2OpydNslHfJIeyafdLgoxj3VjP8QMbD Q/iP70+IF3l5NSi5zbqe946P0Od/8IZQCKUHLWp+gnWP4vweYD9DOuxsWeQjZayTI49l BnzSjg5S0TBSUaGiB2IvGuHiHP8FI1S5130LABOsepeLCq7vp39OuJZXOVRJoaaodCFa Iyu5igRLOglzugxuwgM4H7y9365mQ2g5MyNXVTv2iHSXrtnNYs2kcVVidH4SecNvdywO yJOg== X-Gm-Message-State: AGi0PubQWbl2CBu7qvcnUGWC5BGhgbio4s6eVMZ6tuKYoVAOXWZVKGFh uFiVYfOE6CnRvLDuvJ6cS4ztfRAp54vm+Q== X-Received: by 2002:a17:90b:14ce:: with SMTP id jz14mr664508pjb.30.1587516861090; Tue, 21 Apr 2020 17:54:21 -0700 (PDT) Received: from ?IPv6:2604:4080:1012:8d30:9eb6:d0ff:fe8b:175f? ([2604:4080:1012:8d30:9eb6:d0ff:fe8b:175f]) by smtp.gmail.com with ESMTPSA id c15sm3602690pfo.188.2020.04.21.17.54.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Apr 2020 17:54:20 -0700 (PDT) Subject: Re: [PATCH] Input: xpad - Add custom init packet for Xbox One S controllers To: Dmitry Torokhov , LuK1337 Cc: Richard Fontana , Greg Kroah-Hartman , Thomas Gleixner , Allison Randal , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org References: <436c79ed-ca21-c075-e2da-0934da5000a2@gmail.com> <20200421092434.3360503-1-priv.luk@gmail.com> <20200421180851.GA125362@dtor-ws> From: Cameron Gutman Message-ID: <92b71dc5-ddd5-7ffd-65f8-65a6610dfe43@gmail.com> Date: Tue, 21 Apr 2020 17:54:19 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200421180851.GA125362@dtor-ws> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> >> 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 >> --- >> 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