Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4468757yba; Sun, 12 May 2019 13:51:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOOIijkASX4oqAN5e7RrXjV+VEtT7qSXF9NMsg+BWVkyPYaz9T7xBngI7Fpom9B0c378ob X-Received: by 2002:a63:d615:: with SMTP id q21mr27245409pgg.401.1557694275520; Sun, 12 May 2019 13:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557694275; cv=none; d=google.com; s=arc-20160816; b=r+74sTOasdVroUbTg34s5eS+otlmae427CgMSqsZkpg/SWuWFivuyUmzMpDdTaph3c KweWiOL2yXyE0ijo05PoAFwwpA8xZPSpBqRHaFpXC+k6cp8FBDO6UarKMFBp8fGoCS08 F0Oph7G+1izsSft6qeDaNZTWdKJco2eAsPffXFCJ07U3AEJmTWC6mYOfbS6KnLUv/xiQ drN9KONJCE+HBMBd6+A3sVqeSQa9OsLjQUTTSK9CPT2O/vc56hDlhlLvA7pugn8tGa5d Fu2/SGRmIF8BNDqr2m7e9T5FDZ+DQheQwfMUJOqIvsawR9XmgWzvTdd/3VePxG6slGoE aJJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=xftwkTDo9SZxI2rru91s0TaDpgswdOqrM0zB8nAN/T4=; b=yw3nHEiFkhTIDKd8aqFRQJNJt8cEOziXBukLEqM19SCcm7dxieZMC+WzEQT7ykpRAA yyf/NZr3mz91QrqOCGeyzR6/yfpBDE91oeoQwJMIc9kU13ZLvJ0Wx/Ub4YqrJBVzkedt 0CGiHmDrZ1dHB9qgi4miwZArMzu7GAY1f/64jlVhSzGN/dEdzI1SDDPJO/7oTR/+5iZ3 IljlpOLLoaMzVKjBHsbvnxEi+8CCri3tJYl5MPkEjRaPavPh7gm+0lSv/wTpSAA0JwDq daNoMhnECuKGltrYxi4TiAHUnV8cjQmvKshrd8pdcKLXRgi4XCpzlLWTA5iU4kVoAjA1 Y9jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@wp.pl header.s=1024a header.b=m3F9XCpE; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wp.pl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k19si4503044pls.63.2019.05.12.13.50.28; Sun, 12 May 2019 13:51:15 -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=fail (test mode) header.i=@wp.pl header.s=1024a header.b=m3F9XCpE; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wp.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727032AbfELUdf (ORCPT + 99 others); Sun, 12 May 2019 16:33:35 -0400 Received: from mx4.wp.pl ([212.77.101.11]:15169 "EHLO mx4.wp.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726859AbfELUdf (ORCPT ); Sun, 12 May 2019 16:33:35 -0400 Received: (wp-smtpd smtp.wp.pl 31684 invoked from network); 12 May 2019 22:33:33 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1557693213; bh=xftwkTDo9SZxI2rru91s0TaDpgswdOqrM0zB8nAN/T4=; h=From:To:Cc:Subject; b=m3F9XCpEoccrlOWHgrE9z3WPkKgP80gonvIC+NOIqT7JxF82vsuvDI4CcLvsUrcmw Rj8b5Ixbe0Uql701ZknYgvtv8Y3UaedN/yUVZa0TF5pCDNGn2z73qwXSb3oxAqtoCc UBAtP4TNcesBZ398QWFaudRmFS+OxyDGTWj+UE5U= Received: from pc-201-108-240-185-static.strong-pc.com (HELO localhost.localdomain) (spaz16@wp.pl@[185.240.108.201]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 12 May 2019 22:33:33 +0200 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= Cc: igorkuo@gmail.com, peter.hutterer@who-t.net, =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] HID: fix A4Tech horizontal scrolling Date: Sun, 12 May 2019 22:33:13 +0200 Message-Id: <20190512203313.18756-1-spaz16@wp.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190507050029.GA5197@jelly> References: <20190507050029.GA5197@jelly> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-WP-MailID: 5384286f20c59aca34f956a0e2b44469 X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 000000B [QUPk] To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Changes in v3: - send also high resolution events drivers/hid/hid-a4tech.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-a4tech.c b/drivers/hid/hid-a4tech.c index 9428ea7cdf8a..c3a6ce3613fe 100644 --- a/drivers/hid/hid-a4tech.c +++ b/drivers/hid/hid-a4tech.c @@ -38,8 +38,10 @@ 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); + set_bit(REL_HWHEEL_HI_RES, *bit); + } if ((a4->quirks & A4_2WHEEL_MOUSE_HACK_7) && usage->hid == 0x00090007) return -1; @@ -60,7 +62,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; } @@ -68,6 +70,8 @@ static int a4_event(struct hid_device *hdev, struct hid_field *field, if (usage->hid == 0x000100b8) { input_event(input, EV_REL, value ? REL_HWHEEL : REL_WHEEL, a4->delayed_value); + input_event(input, EV_REL, value ? REL_HWHEEL_HI_RES : + REL_WHEEL_HI_RES, a4->delayed_value * 120); return 1; } } @@ -77,8 +81,9 @@ 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); + input_event(input, usage->type, REL_HWHEEL_HI_RES, value * 120); return 1; } -- 2.21.0