Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp248268ybd; Tue, 25 Jun 2019 20:42:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1aJypTgY5DxZpl06NVjnKscvKHdIWrfHMuyAgGv6C9iDjSo++ryw3M8Gi2VoS5lt/cBeJ X-Received: by 2002:a63:550:: with SMTP id 77mr547892pgf.341.1561520543805; Tue, 25 Jun 2019 20:42:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561520543; cv=none; d=google.com; s=arc-20160816; b=optLAq58Ffup8STcbkeM4URcMo2A2Ap7zRQ1HcRZXVct9foVAoG/InoYKpQoL57mnG hIQVafwxQo+nmoDx1loHswAo01AQKa1aYAPNIQByeJiErSE2CzM82iwymJjIBcXHSvw4 2XDE158Fy3C0yZBAzVSgnUr1TuAjWbKTyqOrOY1ja44PBqiy5UpFk2ttJ/0LjRgmKeBK v/CrChvdV3gPlaG9nsYVHnujIAurjOCZ8vv5wyLagoFXZ1YyByjZuL/IUTgO0Yf0whC/ wEIeC6GeILvbEmignhaSQDPCMBol+tzoyREndlO66s7vlRKOqZMpFuS0YH/Oo40DqJYv lmCg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HmJb5ogWptWpPi9VZdfeqsGX/kxnOhumUIAo9yyqxYw=; b=ubB7lQ4jV9dRN03Rpgt0mBMDzIurXGvXAqsmkXnNSsrd3eln0eagOXc4pYz9Jlp8X0 D97AbE2vzQObon8wpsb8N1dmCbMTMEGdkjM+HW3HdRQ4eUdcieCdGcQj2dTrXBmCE+Ze vk9tcSXIRSrsO7c7sIcepMrduFVFAodQo011Bq2as6C7lMF4Cmgn6GTtJrfZiQh+TllA VIeGowwJBREXrnDn9yGxTzbMHF7fuNRUn8WR+DXAzEBCKUiuYY3m2tBDd7GxvkP66pdy Qvve9T3tx9d9yqRFinUF8dpK0u4VTiIZbQjDF2U1bpICtlSYjep3PBPtziMsoqdL60xA 3znw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HyHiRFwf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9si14102462pgs.312.2019.06.25.20.42.07; Tue, 25 Jun 2019 20:42:23 -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=@kernel.org header.s=default header.b=HyHiRFwf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726898AbfFZDlp (ORCPT + 99 others); Tue, 25 Jun 2019 23:41:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:52270 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726880AbfFZDlp (ORCPT ); Tue, 25 Jun 2019 23:41:45 -0400 Received: from sasha-vm.mshome.net (mobile-107-77-172-74.mobile.att.net [107.77.172.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6362F2168B; Wed, 26 Jun 2019 03:41:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561520504; bh=rhVLW5hBkjFRb9VPCj9+agroOiXlytsEqAo5ZrqBteM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HyHiRFwfQcYeSZJf5ZKGvWQrTk0IzbbfjLgKDxXeGGrGv6h61Uz6gNZPvoXsOni7d SDV9s7kDnNfxU1QrtSHm/7GwZdEVnQTU79Lq3VaZv3c3oOCnHvNHdqQaMZeZ5JDjZg Lnsl4v8LABC3AY5HTcTb7YpMGyAmggJ4LRJ4XUdI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= , Jiri Kosina , Sasha Levin , linux-input@vger.kernel.org Subject: [PATCH AUTOSEL 5.1 12/51] HID: a4tech: fix horizontal scrolling Date: Tue, 25 Jun 2019 23:40:28 -0400 Message-Id: <20190626034117.23247-12-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190626034117.23247-1-sashal@kernel.org> References: <20190626034117.23247-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Błażej Szczygieł [ Upstream commit abf82e8f7e9af40a49e3d905187c662a43c96c8f ] 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ł Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- 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.20.1