From patchwork Mon Jan 16 13:09:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastien Nocera X-Patchwork-Id: 44142 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1184966wrn; Mon, 16 Jan 2023 05:15:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXvY32Z569nGcSgpE4ljG8CvjYJr9zVcAmHCk32F1at7CagI7DZPkJSCBIvTrzitFLhqdEd1 X-Received: by 2002:a17:902:bd8d:b0:192:8cd1:5e79 with SMTP id q13-20020a170902bd8d00b001928cd15e79mr22327838pls.41.1673874909830; Mon, 16 Jan 2023 05:15:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673874909; cv=none; d=google.com; s=arc-20160816; b=sFKnJ5oZ5WIVZE6m3zGyvu3Bxm+zMtBxytabhA633MGyuu3+/qiOaRMPx1EumFWbHS HoSCP9TrzWe2P7w7xOfvOTd9N/w+psfgiiPEXZSIOtyDcBKWEcEQtj9qGw3HWj71BJYi idyevhsP3cYWSZ1pmpZq8zBU04SMb++Yi5u1ntxGdQGYZvjgUGDNJyp0yKsboXIIVVq3 +At559wB8fQ2XMG6NlYOYBj5CSpldu3zEy4WerdPuXyfx5vrl5oUBlA1SvMhinQvFz4J gW7CTs0WbmuMnaex8sRhfS1XTkzirq9cb/QCkpJymUj/Jh0gvK76SxW55yikkVCedpSW 0K1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Rf60upUem0CBzjtABPD20a78YwiMododlMqnJvWMruE=; b=RHaOTNnDxoUIKmlMpyGc6nzHFBHbj1laph2TWIuQUdmYdkmEy9fy9JvA74N9R/nOFl th7sA/mjlihD9tP0znAuw6liAQpKLyPZzYqThG0kH2n65vBzndgDK3WJrNDjbZejxmlR yjQhD8by/VZ0f19AwQG0nlUzj54rHOUo4hEYQJ+zfTM5CHhVKm3vUG+gkRns4keMZOCZ bdxFp25Yb9fmU1C+7UmYVfm2333r5GIZTt38/KPULScsYxFR2ZRMDoeVM1/LJTx2rIby 8NSlMjl1MUH6VILvUr6Rn2idM7nzRstCHeXc+KppIjtw2xb0TsGCOq+21Qg4B8amTAKg 1Ewg== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y3-20020a170902ed4300b001945b3a1db5si13500781plb.153.2023.01.16.05.14.57; Mon, 16 Jan 2023 05:15:09 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230076AbjAPNOh (ORCPT + 99 others); Mon, 16 Jan 2023 08:14:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231639AbjAPNNg (ORCPT ); Mon, 16 Jan 2023 08:13:36 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B542D1E5E0; Mon, 16 Jan 2023 05:10:34 -0800 (PST) Received: (Authenticated sender: hadess@hadess.net) by mail.gandi.net (Postfix) with ESMTPSA id 7BB62E0005; Mon, 16 Jan 2023 13:09:38 +0000 (UTC) From: Bastien Nocera To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Jiri Kosina , Benjamin Tissoires , "Peter F . Patel-Schneider" , =?utf-8?q?Filipe_La?= =?utf-8?q?=C3=ADns?= , Nestor Lopez Casado Subject: [PATCH] HID: logitech-hidpp: Hard-code HID++ 1.0 fast scroll support Date: Mon, 16 Jan 2023 14:09:37 +0100 Message-Id: <20230116130937.391441-1-hadess@hadess.net> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755185057818229937?= X-GMAIL-MSGID: =?utf-8?q?1755185057818229937?= HID++ 1.0 devices only export whether Fast Scrolling is enabled, not whether they are capable of it. Reinstate the original quirks for the 3 supported mice so fast scrolling works again on those devices. Fixes: 908d325 ("HID: logitech-hidpp: Detect hi-res scrolling support") Link: https://bugzilla.kernel.org/show_bug.cgi?id=216903 Signed-off-by: Bastien Nocera --- drivers/hid/hid-logitech-hidpp.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index abf2c95e4d0b..fa026e9107c5 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -77,6 +77,7 @@ MODULE_PARM_DESC(disable_tap_to_click, #define HIDPP_QUIRK_HIDPP_WHEELS BIT(26) #define HIDPP_QUIRK_HIDPP_EXTRA_MOUSE_BTNS BIT(27) #define HIDPP_QUIRK_HIDPP_CONSUMER_VENDOR_KEYS BIT(28) +#define HIDPP_QUIRK_HI_RES_SCROLL_1P0 BIT(29) /* These are just aliases for now */ #define HIDPP_QUIRK_KBD_SCROLL_WHEEL HIDPP_QUIRK_HIDPP_WHEELS @@ -3472,14 +3473,8 @@ static int hidpp_initialize_hires_scroll(struct hidpp_device *hidpp) hid_dbg(hidpp->hid_dev, "Detected HID++ 2.0 hi-res scrolling\n"); } } else { - struct hidpp_report response; - - ret = hidpp_send_rap_command_sync(hidpp, - REPORT_ID_HIDPP_SHORT, - HIDPP_GET_REGISTER, - HIDPP_ENABLE_FAST_SCROLL, - NULL, 0, &response); - if (!ret) { + /* We cannot detect fast scrolling support on HID++ 1.0 devices */ + if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_1P0) { hidpp->capabilities |= HIDPP_CAPABILITY_HIDPP10_FAST_SCROLL; hid_dbg(hidpp->hid_dev, "Detected HID++ 1.0 fast scroll\n"); } @@ -4296,9 +4291,15 @@ static const struct hid_device_id hidpp_devices[] = { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_T651), .driver_data = HIDPP_QUIRK_CLASS_WTP }, + { /* Mouse Logitech Anywhere MX */ + LDJ_DEVICE(0x1017), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_1P0 }, { /* Mouse logitech M560 */ LDJ_DEVICE(0x402d), .driver_data = HIDPP_QUIRK_DELAYED_INIT | HIDPP_QUIRK_CLASS_M560 }, + { /* Mouse Logitech M705 (firmware RQM17) */ + LDJ_DEVICE(0x101b), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_1P0 }, + { /* Mouse Logitech Performance MX */ + LDJ_DEVICE(0x101a), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_1P0 }, { /* Keyboard logitech K400 */ LDJ_DEVICE(0x4024), .driver_data = HIDPP_QUIRK_CLASS_K400 },