Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7226188rwr; Tue, 25 Apr 2023 09:46:00 -0700 (PDT) X-Google-Smtp-Source: AKy350ZxtkBVbGvjsUeRhWggpZWpT04M3ZizasD8PeD7sx94Kp87ioL9rgSfCf5kd2k/VmLg15X1 X-Received: by 2002:a17:90a:8005:b0:247:19c5:aa3d with SMTP id b5-20020a17090a800500b0024719c5aa3dmr17749854pjn.36.1682441160193; Tue, 25 Apr 2023 09:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682441160; cv=none; d=google.com; s=arc-20160816; b=crYyQUFqLZBFjoaryMArMViQmE1+7NSmblG38DeFOdLyL0JDmXDukeYlF9dyB4WsON /WdEn2wsU3o4tUsjMgbRfHXWhlIq1ybpK+OwzRnZTks2unNevvJe87wM1X2AoFrLxC89 RDW4sZXfZLyZeOnd4CvkWDMjb0ECi+ftmaATbRIgGi32hwprfVh3BgemMdfwtZnmtMhM KsT5patXOUFXUvKcDXLgw0rMhYc4jxy8lyWwneeQXx8cQeu/iL9rDvEy9XKJioYFMX/2 tbM8dxI6iNPQ5K4hfP8llXmJPI72vhyJw42ZDuUoKY83PvbwNzagyM4+jLDhFJMUs+DJ ZbpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=n3qrKZjVYwRidQtR9ttCKsIhnttEfhhVP4HOmwIiYyI=; b=RhXmGO4khEP3ZS51/Fk2ItcOZnenwo1usfmsnTCC3503PipubSrJ1uxq+zEI7neQGu 2EnugItiMpXp3BIp0r0zPKXx/unVMa5gRnxt3mcq8kxnPiaeOFOm7w8ZppL8BdKmJrE+ EL+fsr44i251uqb+sDpPBcbo19xKrAQRYy0xjMSfn0Y3s4Be8mJiu5bFVrhlHc8IjMNy JLXpamW+idMsEvzBH/E8oErKmbel5Oh/oov+cE4SJBED5k8ngvSarZIcwMHT1x1PqQ6m nlnprZuD8OI8ItuCSkwoFrl9eiE+/nbrb6cofJE2D6wvSO+u/QfORgaTalHwH+SbHvtv UWBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=jfcMep9D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e16-20020a17090ab39000b002469c92e2b1si11683210pjr.172.2023.04.25.09.45.48; Tue, 25 Apr 2023 09:46:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=jfcMep9D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234747AbjDYQjE (ORCPT + 99 others); Tue, 25 Apr 2023 12:39:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233854AbjDYQjD (ORCPT ); Tue, 25 Apr 2023 12:39:03 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1946D32E for ; Tue, 25 Apr 2023 09:39:01 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-54f87c0a000so101436917b3.3 for ; Tue, 25 Apr 2023 09:39:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1682440741; x=1685032741; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=n3qrKZjVYwRidQtR9ttCKsIhnttEfhhVP4HOmwIiYyI=; b=jfcMep9DTXPMTttSv137SPpXd/zDeV9GsWfo/nmzB2IvVREp8Z8TODmKDKlLcmrsmD oV7OGXpLlNRaTWeeikDQBvIasrTIjGfNMy5wNq3uLuSontVplZufn0Was9op7e6hq7Vk 2hQk4uGF+FRHYpaDeS4k5QZQ5nA1DrYwSChL+xUcY3c34s5I+BEcSXNMpJBdu+Du5YZ4 1zCjxJageHqYCtfri6PVgPOXMjh9zQIP8svZqrmPZlkEpENKqMnAysNxEO5IfrYhmLQl UCIulC3cGBZQ+MFbNb5UhihygZ0U/gDz+UNsjpsy7bXVEZz+12bLlKBY/DTh5+nvunVm UDdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682440741; x=1685032741; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=n3qrKZjVYwRidQtR9ttCKsIhnttEfhhVP4HOmwIiYyI=; b=ch8dANP7JlyuUvQQnkTski7f2UVLp6tD58ypQYlx2D0uaJnDT9m27nYw7G19bXSAe1 ksTumpQDINfdIvlJV0/jqL+8fIhOZBG+ZFagehoABPq1at0/TyW6J/nHmqJkMkJXuFlT nOsmRSCmVpJ4tkiwSn0lZ35uA45pD8vdGEnWYr41t8v30Vnwj2PFOuOzKktBRwZQAa+t hppjgR8196YAPdREp2Dkyh1yzvJIhUjaUsF0K0p9/y4kNBM4fYUyY5+DJf9/FPRE6ej3 1nrZoqzvch7zTctUXNcjxUCreS0v70WumJsgpVAavaQMc8xsf1syJobbNPsRUrxFk7qZ 0igQ== X-Gm-Message-State: AAQBX9fSXpuDElNyQ0DXSpbhpTDeTT+i5stD+sPaPqBrMTUSzYClWLIo RZ0GfT5pX+iIte8ICGnbsBaObes= X-Received: from svv.mtv.corp.google.com ([2620:15c:211:202:5c66:e49a:de5d:a35]) (user=svv job=sendgmr) by 2002:a81:ad4e:0:b0:54c:2889:7105 with SMTP id l14-20020a81ad4e000000b0054c28897105mr9068295ywk.0.1682440741149; Tue, 25 Apr 2023 09:39:01 -0700 (PDT) Date: Tue, 25 Apr 2023 09:38:44 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog Message-ID: <20230425163844.3711710-1-svv@google.com> Subject: [PATCH v4] Add rumble support to latest xbox controllers From: Siarhei Vishniakou To: Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Siarhei Vishniakou , Bastien Nocera Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, rumble is only supported via bluetooth on a single xbox controller, called 'model 1708'. On the back of the device, it's named 'wireless controller for xbox one'. However, in 2021, Microsoft released a firmware update for this controller. As part of this update, the HID descriptor of the device changed. The product ID was also changed from 0x02fd to 0x0b20. On this controller, rumble was supported via hid-microsoft, which matched against the old product id (0x02fd). As a result, the firmware update broke rumble support on this controller. See: https://news.xbox.com/en-us/2021/09/08/xbox-controller-firmware-update-rolling-out-to-insiders-starting-today/ The hid-microsoft driver actually supports rumble on the new firmware, as well. So simply adding new product id is sufficient to bring back this support. After discussing further with the xbox team, it was pointed out that another xbox controller, xbox elite series 2, can be supported in a similar way. Add rumble support for all of these devices in this patch. Two of the devices have received firmware updates that caused their product id's to change. Both old and new firmware versions of these devices were tested. The tested controllers are: 1. 'wireless controller for xbox one', model 1708 2. 'xbox wireless controller', model 1914. This is also sometimes referred to as 'xbox series S|X'. 3. 'elite series 2', model 1797. The tested configurations are: 1. model 1708, pid 0x02fd (old firmware) 2. model 1708, pid 0x0b20 (new firmware) 3. model 1914, pid 0x0b13 4. model 1797, pid 0x0b05 (old firmware) 5. model 1797, pid 0x0b22 (new firmware) I verified rumble support on both bluetooth and usb. Reviewed-by: Bastien Nocera Signed-off-by: Siarhei Vishniakou --- drivers/hid/hid-ids.h | 10 +++++++++- drivers/hid/hid-microsoft.c | 11 ++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 053853a891c5..e252ea48bb74 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -903,7 +903,15 @@ #define USB_DEVICE_ID_MS_TYPE_COVER_2 0x07a9 #define USB_DEVICE_ID_MS_POWER_COVER 0x07da #define USB_DEVICE_ID_MS_SURFACE3_COVER 0x07de -#define USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER 0x02fd +/* + * For a description of the Xbox controller models, refer to: + * https://en.wikipedia.org/wiki/Xbox_Wireless_Controller#Summary + */ +#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708 0x02fd +#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708_BLE 0x0b20 +#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1914 0x0b13 +#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797 0x0b05 +#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797_BLE 0x0b22 #define USB_DEVICE_ID_MS_PIXART_MOUSE 0x00cb #define USB_DEVICE_ID_8BITDO_SN30_PRO_PLUS 0x02e0 diff --git a/drivers/hid/hid-microsoft.c b/drivers/hid/hid-microsoft.c index 071fd093a5f4..9345e2bfd56e 100644 --- a/drivers/hid/hid-microsoft.c +++ b/drivers/hid/hid-microsoft.c @@ -446,7 +446,16 @@ static const struct hid_device_id ms_devices[] = { .driver_data = MS_PRESENTER }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, 0x091B), .driver_data = MS_SURFACE_DIAL }, - { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER), + + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708), + .driver_data = MS_QUIRK_FF }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708_BLE), + .driver_data = MS_QUIRK_FF }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1914), + .driver_data = MS_QUIRK_FF }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797), + .driver_data = MS_QUIRK_FF }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797_BLE), .driver_data = MS_QUIRK_FF }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_8BITDO_SN30_PRO_PLUS), .driver_data = MS_QUIRK_FF }, -- 2.40.0.634.g4ca3ef3211-goog