Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756583AbdIHNk3 (ORCPT ); Fri, 8 Sep 2017 09:40:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36106 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933127AbdIHNWp (ORCPT ); Fri, 8 Sep 2017 09:22:45 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jason Gerecke , Jiri Kosina Subject: [PATCH 4.12 17/43] HID: wacom: Do not completely map WACOM_HID_WD_TOUCHRINGSTATUS usage Date: Fri, 8 Sep 2017 15:19:05 +0200 Message-Id: <20170908131827.199397202@linuxfoundation.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170908131826.555428826@linuxfoundation.org> References: <20170908131826.555428826@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1755 Lines: 47 4.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jason Gerecke commit 8d411cbf46e515ca2b7ceb3d2b3f43e22813edac upstream. The WACOM_HID_WD_TOUCHRINGSTATUS usage is a single bit which tells us whether the touchring is currently in use or not. Because we need to reset the axis value to 0 when the finger is removed, we call 'wacom_map_usage' to ensure that the required type/code values are associated with the usage. The 'wacom_map_usage' also sets up the axis range and resolution, however, which is not desired in this particular case. Although xf86-input-wacom doesn't do really do anything with the ring's range or resolution, the libinput driver (for Wayland environments) uses these values to provide proper angle indications to userspace. Fixes: 60a2218698 ("HID: wacom: generic: add support for touchring") Signed-off-by: Jason Gerecke Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/hid/wacom_wac.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1767,7 +1767,13 @@ static void wacom_wac_pad_usage_mapping( features->device_type |= WACOM_DEVICETYPE_PAD; break; case WACOM_HID_WD_TOUCHRINGSTATUS: - wacom_map_usage(input, usage, field, EV_ABS, ABS_WHEEL, 0); + /* + * Only set up type/code association. Completely mapping + * this usage may overwrite the axis resolution and range. + */ + usage->type = EV_ABS; + usage->code = ABS_WHEEL; + set_bit(EV_ABS, input->evbit); features->device_type |= WACOM_DEVICETYPE_PAD; break; case WACOM_HID_WD_BUTTONCONFIG: