Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1044781imu; Thu, 22 Nov 2018 09:12:32 -0800 (PST) X-Google-Smtp-Source: AFSGD/X6HwlOzcO7QoD6lC9aYW4ReWCA+6JP9EaWj20XvWXL0ydpfqpltm2FBiao/Vm+2SkdYDmK X-Received: by 2002:a63:5320:: with SMTP id h32mr10804331pgb.414.1542906752375; Thu, 22 Nov 2018 09:12:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542906752; cv=none; d=google.com; s=arc-20160816; b=AygD4WDEOYuuSopiha1qtETZiRRNZHzLxiUpIU4HjTDpZF5eVsUxPWV+aUQLjow82U aCgcYsibuZ1Ojy1hW1TB8wdWN/kNlYkyLK8+g1mRQu7jxZ2J0Il4TOWlPxF3LbAMXau/ mDLLRdCGFxkK52aoTXaTbYPc830U9JZLf9fTnOtL3o6UT7ifVuh7cNOsnlWX/47/NsPW XapkM60nZoyHVuELX6Ili3VwLq4QNrvk9bLzCisWgOUEyfRT3KSy7qtEYod60Cf0Q1JW KrlKlmieESIPPkHFl3i+N2qrMu0ZitZXLDPNAPRzrXEHIg+6sY0gf8sJY2bEnMNDtLOy vxyg== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=QK0hoZ+iI1WORsPvq9qi4QNw4ITM745+jMNHANZTDf4=; b=TyeSXkQAyRxFVcL0Rfu9Q2nBqrYLzGWKB7NuANbJphuNib3ifpKQ5VLN95mM+yktf8 PQ9y2GjdB3E/QbTXQHvqZb40n5KIoIsBGUpLNd6mi71h0RGRec5K/W6ij5bxqU5bq4vX zHQc048oPHfgClacFvmqNEhCEPO3pSbi98TKu5B1EEQuDzCQXAXW87+TF1YXJ04CpP4X Wt2YP1Xp2hDw3T8uEbQPPdVAzq/wtHtDMTkN/1RRDZjqrraCJilmG5THlIZWzMFmhGfD DlaX5N+vASJEEYZN34BQ6KfhLE4MxBdLzIUI+fBlnkEWPxtwcSXvVPJ6DxLsk/h9/K8z JlWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@who-t.net header.s=fm1 header.b=jzLxzvuW; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Ok6Y3jwN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w185si48514743pgd.518.2018.11.22.09.12.17; Thu, 22 Nov 2018 09:12:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@who-t.net header.s=fm1 header.b=jzLxzvuW; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Ok6Y3jwN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404702AbeKVRMv (ORCPT + 99 others); Thu, 22 Nov 2018 12:12:51 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:47687 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732955AbeKVRMv (ORCPT ); Thu, 22 Nov 2018 12:12:51 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id B5424220F9; Thu, 22 Nov 2018 01:34:50 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 22 Nov 2018 01:34:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=who-t.net; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm1; bh=QK0hoZ+iI1WORsPvq9qi4QNw4I TM745+jMNHANZTDf4=; b=jzLxzvuW2RVexMtYZuFm3lRpWbghnEdjX/N4VpCSNY pJoN7uxA03/wpShVUMC/BJAOhxR2z/gyvnFDmIEj3WJxAH578Wj9OcOzyDDoV/RP 9tNs0AGBB4lxMsRGVYH8jUA1+Ho7LM+JrNb4Z8Ise26blFXSt7oZbiIdl4tRavEm IYEB8PeuC2GroiVs1q6bDaiVJmqXBYHy7u8pTylVzIkF/WoydFya3Q3gKO4NOm0H /XSH5XMgNPm143gBX2oU/DmKZ7ojpOgZKB2S/odOAf0rmoXomsUjNMh59X9TtFBr SSqqNylS+Kq2vlfIvx/3h6CB+iZjt4SfNv7y3gwF3iyg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=QK0hoZ+iI1WORsPvq 9qi4QNw4ITM745+jMNHANZTDf4=; b=Ok6Y3jwNKVxvXwfxjGCyLKOsQ7voe9Zk7 TWSzBSegl+chY3Y33VxZEULPomS6JGxZHAn+17p2sYoX3TU7ILJfKp3eYHwqUe9F QUcg/Sky6AEOp4nv2dbEcOBTh88m1NlULvG2N+Q3l2aGShYa9pBfBPebN16G8kd8 KPqH7KGQTgY/a4B7okoIcxWkZ5n8jHlZEotmYKfYaREnLsP4NQUQg9PlpXYsZ4gm 8fK6fCIzTMzhvcNjyME2CXb0kpmDnus59tkMQfeovrNkgvJAMPuTbqpxwgIjvQaJ 6m2STK8/u2SZTl+EwytAdkrAA9MPPwGPBMJijGTfW9YxuplDovekw== X-ME-Sender: X-ME-Proxy: Received: from jelly.home.gateway (167-179-166-29.a7b3a6.bne.nbn.aussiebb.net [167.179.166.29]) by mail.messagingengine.com (Postfix) with ESMTPA id 5B3F5102EE; Thu, 22 Nov 2018 01:34:47 -0500 (EST) From: Peter Hutterer To: linux-input@vger.kernel.org Cc: Dmitry Torokhov , Jiri Kosina , Harry Cutts , torvalds@linux-foundation.org, Nestor Lopez Casado , linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH 0/8] HID: MS and Logitech high-resolution scroll wheel support Date: Thu, 22 Nov 2018 16:34:01 +1000 Message-Id: <20181122063409.15816-1-peter.hutterer@who-t.net> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series enables high-resolution scrolling on some or many Microsoft mice of the last decade and Logitech mice with the required feature support. High resolution scrolling is exposed to userspace as REL_WHEEL_HI_RES and REL_HWHEEL_HI_RES. An accumulated value of 120 signals one wheel click, mice with higher granularity can send multiple values that are fractions of 120. REL_WHEEL and REL_HWHEEL are emulated for backwards compatibility. The 120 magic number comes from Windows and affects how hardware vendors build their shiny (and the use of a multiplier in the hw that is a whole fraction of 120). This series adds implementations for generic HID and for Logitech's HID++. Windows Vista added the Resolution Multiplier HID feature which gives us a multiplier that is applied (in hardware) to the wheel data. For the same physical motion and an example multiplier of 8, the hardware may: - send 8 events of value 1, or - send 1 event of value 8, or - send 8/n events of value 1 * n The multiplier is a HID Feature and should default to an effective 1 in the hardware. Windows Vista and newer set this to the logical maximum, we do the same now. It's an approved HID Feature but so far, this feature has only been found on some Microsoft mice. Logitech mice do not seem to use it and have their own HID++ protocol to apply that multiplier. Harry's patchset had previously been merged, the exact implementation was incompatible with the Microsoft bits though so it was reverted. Harry's patches in this series are adjusted accordingly but are by and large the same. Notable: The Logitech REL_WHEEL emulation cannot just hook into the HID bits. The firmware drops some events so the point when we get the REL_WHEEL event moves around. This is worked around by directional resets and a timeout-based reset. Devices tested: - Microsoft Comfort Optical Mouse 3000 - Microsoft Sculpt Ergonomic Mouse - Microsoft Surface mouse - Logitech MX Anywhere 2S The following devices were tested for the HID feature and didn't have it: - Logitech G500s, G303 - Roccat Kone XTD - all the cheap Lenovo, HP, Dell, Logitech USB mice that come with a workstation that I could find in the local office - Etekcity something something - Razer Imperator - Microsoft Classic IntelliMouse - Microsoft Surface Mobile Mouse Cheers, Peter Harry Cutts (3): HID: logitech: Use LDJ_DEVICE macro for existing Logitech mice HID: logitech: Add function to enable HID++ 1.0 "scrolling acceleration" HID: logitech: Enable high-resolution scrolling on Logitech mice Peter Hutterer (5): Input: add `REL_WHEEL_HI_RES` and `REL_HWHEEL_HI_RES` HID: core: store the collections as a basic tree HID: core: process the Resolution Multiplier HID: input: use the Resolution Multiplier for high-resolution scrolling HID: logitech-hidpp: fix typo, hiddpp to hidpp Documentation/input/event-codes.rst | 21 +++- drivers/hid/hid-core.c | 174 ++++++++++++++++++++++++++++++++ drivers/hid/hid-input.c | 137 ++++++++++++++++++++++++- drivers/hid/hid-logitech-hidpp.c | 384 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ include/linux/hid.h | 10 ++ include/uapi/linux/input-event-codes.h | 2 + 6 files changed, 690 insertions(+), 38 deletions(-)