From patchwork Thu Aug 25 12:29:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bastien Nocera X-Patchwork-Id: 600134 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E3D3C3F6B0 for ; Thu, 25 Aug 2022 12:29:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241699AbiHYM3t convert rfc822-to-8bit (ORCPT ); Thu, 25 Aug 2022 08:29:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241680AbiHYM3m (ORCPT ); Thu, 25 Aug 2022 08:29:42 -0400 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03D50B2DAB for ; Thu, 25 Aug 2022 05:29:40 -0700 (PDT) Received: (Authenticated sender: hadess@hadess.net) by mail.gandi.net (Postfix) with ESMTPSA id 84ADF40007; Thu, 25 Aug 2022 12:29:37 +0000 (UTC) Message-ID: <4542beb149883ab5dfdcfd7f6bb4b516e5c1bcdb.camel@hadess.net> Subject: [PATCH] HID: logitech-hidpp: Enable HID++ for all the Logitech Bluetooth devices From: Bastien Nocera To: Filipe =?iso-8859-1?q?La=EDns?= , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, Nestor Lopez Casado Date: Thu, 25 Aug 2022 14:29:36 +0200 User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Probe for HID++ support over Bluetooth for all the Logitech Bluetooth devices. As Logitech doesn't have a list of Bluetooth devices that support HID++ over Bluetooth, probe every device. The HID++ driver will fall back to plain HID if the device does not support HID++. Note that this change might cause upower to export 2 batteries for certain Bluetooth LE devices which export their battery information through the Bluetooth BATT profile. This particular bug is tracked at: https://gitlab.freedesktop.org/upower/upower/-/issues/166 Tested with a Logitech Signature M650 mouse, over Bluetooth Signed-off-by: Bastien Nocera --- Note that I could not test whether the Harmony PS3 (handled in hid-sony.c) or DiNovo Edge keyboard (handled in hid-input.c) devices would correctly fallback to those drivers in that case. Ways to test this would be appreciated (or merge this, and wait for feedback...)  drivers/hid/hid-logitech-hidpp.c | 3 +++  1 file changed, 3 insertions(+) diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index 81de88ab2ecc..86e7a38d8a9a 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -4347,6 +4347,9 @@ static const struct hid_device_id hidpp_devices[] = {         { /* MX Master 3 mouse over Bluetooth */           HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb023),           .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 }, + +       { /* And try to enable HID++ for all the Logitech Bluetooth devices */ +         HID_DEVICE(BUS_BLUETOOTH, HID_GROUP_ANY, USB_VENDOR_ID_LOGITECH, HID_ANY_ID) },         {}  };