Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3305627yba; Mon, 6 May 2019 22:01:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyF7j3FXAoXvg8FIzkM8TeEt1bGscGGaioYqvg2WkMrOqQ+mtdlLcm0igK791J12E1n8THR X-Received: by 2002:a65:5086:: with SMTP id r6mr37941639pgp.301.1557205297627; Mon, 06 May 2019 22:01:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557205297; cv=none; d=google.com; s=arc-20160816; b=fVYQNlvK/hSz1khEv8f3d6CFjEicb/dt2d1IkSi14qls1ZIggHMQFpFRGqRTKtD2Zn tHY5gfxAe/Yn7ag/Fq4rliygkVYQ1YaLvkLNUA7bJcboZMtTLRPAHt5fV5tCkZmBvSXg Qfp48oZ6uK0rVCHJ4hE3WXOCgpaSW68DbT+HpyMsXRmkT2LHIt1/QRzhO6EiBl0K4CT4 XmhuqmnerFSuHB71sjnr9E6ztJwUQnmRfynqvMqwzhIZ2RP55yt9K66dyhK6KmKFpDF3 ADvz2nBcb1rO7nXhRN2gXD/9bU9Ew6SPh+WsQamqf7FX7sWc0FHUOmtdV1PDiFBcsaB5 THBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=GvpbZBgNMXflnMGNR5vyeIgEKAyxBkeV/ay2TmPZFP4=; b=C9O2eIt27HpYv1x2qvUwEZboA1tujpa7fK1eSSU3/2DXFtHncKSWWI+1OUUZ2vBtxc 8BVTxpc1e3pnCK2M3jqdxbTe4yaMRqcRU7/evpklajhV8B543DrT7YagMUWOp9coYT33 gB9qVKaTDOiW/z8djPwN/tzNBk7vlO2m1o0CxogZV6hMQrFaScgr7TaS89M9fzD/sB5F BNFP6xF3BQvRq52K3ieWbf+Og00elbBYRRqrpnPh1Jtdpto30EK8JE1fW+BckHAcK6fu ebz+lbE8gEQ1Sst9+lLUWzfhd8vOh0xycaeYIH6gmwl161dCODRsPyRhHbSI29UQvLn6 3Bkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@who-t.net header.s=fm3 header.b=Et3+toFV; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="vX/Ujmru"; 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 22si17974911pfp.17.2019.05.06.22.01.19; Mon, 06 May 2019 22:01:37 -0700 (PDT) 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=fm3 header.b=Et3+toFV; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="vX/Ujmru"; 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 S1726362AbfEGFAZ (ORCPT + 99 others); Tue, 7 May 2019 01:00:25 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:33449 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbfEGFAZ (ORCPT ); Tue, 7 May 2019 01:00:25 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id DD9F124617; Tue, 7 May 2019 01:00:23 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 07 May 2019 01:00:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=who-t.net; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=fm3; bh=G vpbZBgNMXflnMGNR5vyeIgEKAyxBkeV/ay2TmPZFP4=; b=Et3+toFVGj6ppxTA4 mSKTIKpGtysB6HCOo/tZdU6v0mrKnoXgwYnKgm59zEb5W54bewaioCC+wi5LA5dj edgj3rfXUrtXILI3K64DbkOWMjREucV9lLbmwXS++RPUN01BngQXHZqhq3d1gjZq 7m75d3LpskrwCKNl1VhLSwo5lws4vZDfpguxI/toUv4HULULkn6mv76XW+PSNRH7 UzAXL59E7O/pP5rtLjCwKcVrNYa5TDyoMGvDZDZHY0ktM1sz8ARKTeB/wW18SFxK v8RCK/ko7QdSbxTl3tSzyloepxW9d2lU0hViKr3UPnn+fxXiDo4QgoOyPRRsGe2P sOLxw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=GvpbZBgNMXflnMGNR5vyeIgEKAyxBkeV/ay2TmPZF P4=; b=vX/UjmruYxl0f/ZfiqJOWc5lHkUTSpyx+PY7aFgdDn8DpWa57gYLDGsU3 vZejP2fPdINS9K352z8fxtDGXbilfPwERignb3//PReLmjdcIiE7awMk2J/1iv0T 2FqDsl0BCTsKQHRs+f7+xNkKH+oOXAUsA+epqpdzsdnFJS1NLIRz+Rnbs+J/B+MF F/2HjxDXur7+JHs7CCxU6gFybch/hdgxHOrSRGVnTKpurKFoj5ZvbJH9A56Im3an k3e6ZEkYM8vU52QCjYBkitvfAJ4r5EXj+MMT36BMYiWoXuHjsb3FoXQ880bo2uVg qMADu9eipoOwAi4HW9MG6s0ePQXVA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrjeelgdeltdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggugfgjfgesthekredttderjeenucfhrhhomheprfgvthgv rhcujfhuthhtvghrvghruceophgvthgvrhdrhhhuthhtvghrvghrseifhhhoqdhtrdhnvg htqeenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeduudejrddvtddrieel rddugedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdhhuhhtthgvrhgvrh esfihhohdqthdrnhgvthenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from jelly (117-20-69-142.751445.bne.nbn.aussiebb.net [117.20.69.142]) by mail.messagingengine.com (Postfix) with ESMTPA id E5B29103CB; Tue, 7 May 2019 01:00:18 -0400 (EDT) Date: Tue, 7 May 2019 15:00:29 +1000 From: Peter Hutterer To: =?utf-8?B?QsWCYcW8ZWogU3pjenlnaWXFgg==?= Cc: igorkuo@gmail.com, Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] HID: fix A4Tech horizontal scrolling Message-ID: <20190507050029.GA5197@jelly> References: <20190503202836.12127-1-spaz16@wp.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190503202836.12127-1-spaz16@wp.pl> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 03, 2019 at 10:28:36PM +0200, Błażej Szczygieł wrote: > Since recent high resolution scrolling changes the A4Tech driver must > check for the "REL_WHEEL_HI_RES" usage code. > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=203369 > Fixes: 2dc702c991e3774af9d7ce410eef410ca9e2357e ("HID: input: use the > Resolution Multiplier for high-resolution scrolling") > > Signed-off-by: Błażej Szczygieł > --- > Changes in v2: > - changed commit message > > drivers/hid/hid-a4tech.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/hid/hid-a4tech.c b/drivers/hid/hid-a4tech.c > index 9428ea7cdf8a..fafb9fa558e7 100644 > --- a/drivers/hid/hid-a4tech.c > +++ b/drivers/hid/hid-a4tech.c > @@ -38,7 +38,7 @@ static int a4_input_mapped(struct hid_device *hdev, struct hid_input *hi, > { > struct a4tech_sc *a4 = hid_get_drvdata(hdev); > > - if (usage->type == EV_REL && usage->code == REL_WHEEL) > + if (usage->type == EV_REL && usage->code == REL_WHEEL_HI_RES) > set_bit(REL_HWHEEL, *bit); > > if ((a4->quirks & A4_2WHEEL_MOUSE_HACK_7) && usage->hid == 0x00090007) > @@ -60,7 +60,7 @@ static int a4_event(struct hid_device *hdev, struct hid_field *field, > input = field->hidinput->input; > > if (a4->quirks & A4_2WHEEL_MOUSE_HACK_B8) { > - if (usage->type == EV_REL && usage->code == REL_WHEEL) { > + if (usage->type == EV_REL && usage->code == REL_WHEEL_HI_RES) { > a4->delayed_value = value; > return 1; > } > @@ -77,7 +77,7 @@ static int a4_event(struct hid_device *hdev, struct hid_field *field, > return 1; > } > > - if (usage->code == REL_WHEEL && a4->hw_wheel) { > + if (usage->code == REL_WHEEL_HI_RES && a4->hw_wheel) { > input_event(input, usage->type, REL_HWHEEL, value); You'll need to send both events here, so please add: input_event(input, usage->type, REL_HWHEEL_HI_RES, value * 120); assume that wheel and wheel_hi_res are two separate event streams for the same axis, userspace may listen to either or both. if you only send the legacy event, newer userspace won't receive any scroll events as it may only look for the new hi-res events. Check with evtest/evemu/libinput record after, you should see multiples of 120 on the hi-res axis for every legacy wheel event. Cheers, Peter > return 1; > } > -- > 2.21.0 >