From patchwork Fri Aug 4 22:35:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gerecke, Jason" X-Patchwork-Id: 9882191 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E96756031B for ; Fri, 4 Aug 2017 22:35:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D22B7289E4 for ; Fri, 4 Aug 2017 22:35:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C63FB289E8; Fri, 4 Aug 2017 22:35:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5020A289E4 for ; Fri, 4 Aug 2017 22:35:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751525AbdHDWfe (ORCPT ); Fri, 4 Aug 2017 18:35:34 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:34487 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751342AbdHDWfd (ORCPT ); Fri, 4 Aug 2017 18:35:33 -0400 Received: by mail-qt0-f194.google.com with SMTP id i19so2871833qte.1; Fri, 04 Aug 2017 15:35:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=bTsE8bqd7j10uizDNCujh/sBBsNiLYvqC95N9T0pqOk=; b=c5cK61aAfjtE5krPSWjSZU6xJX+4nZDcfRaucHD20/MrcnehUlOVFOH4UXuoE2pXIl TSCmi2F6cKErIhjdfhdZFqXimEAUzStljL8IPxOmTlJYW4hfXegNc/ckmnNtx3c4uLvB Dfc4nTrp5mdHfXs5xsxYtTbkSio1NybM8WFjKm2wuk/WrLWxXlM9CFehiEJJ8fbyBQZD JV/UVHNQHvh8TQNjuWoFz6dPmfPz28QeW8Jg3cwflotbCGg+uHni4XBfnh/jtRyZXKzx yD/vxGufu+s6m5nzRAXwYTeISSjJd03thlUQKe7Z0PG/RT+Y6kuzhGKq1iftbNblT3gn yl7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bTsE8bqd7j10uizDNCujh/sBBsNiLYvqC95N9T0pqOk=; b=Qq6R2AXnf52U3PTh7uTmmdYQyp973q01Mka+7yxhZDt/Z5ixVxa3vP8zvfhvDgjgFP AVEdMKiEDE9S0ZzBvGtnQN91Rl60hUKNdb3bUiaY+zo0liWMWK4ET9ZfomhU1fOQ2gHZ +l0XRqFaCQSuRVRcoROonFrK47Dpj2cJXRoLDR0xNMpZ/Z6WGl9M2296nD2x/PfLwusR TydTIoXJcSVcEeGoK8UixFOM4CTK8sDbN2CB7Bbe/xXwUpLa32ir5vp9QCbPhrsq0DKg MtPBf6VSqFNnvGuTZmBchrLAz6PS//sxPhUPMGbHk64y39jWdIMxjj5RDxK7W4jaWyyf E3HQ== X-Gm-Message-State: AHYfb5jtCnq51oProndY6/rOq5Ba9d7jUTpdm8NQXj1RA6RoGMkjna8a YSkpw5MQz9V9p6okmX8= X-Received: by 10.237.37.107 with SMTP id w40mr5141286qtc.14.1501886133035; Fri, 04 Aug 2017 15:35:33 -0700 (PDT) Received: from wacom-arch2.corp.onewacom.com ([50.225.60.4]) by smtp.gmail.com with ESMTPSA id v40sm1432436qta.29.2017.08.04.15.35.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Aug 2017 15:35:32 -0700 (PDT) From: Jason Gerecke To: linux-input@vger.kernel.org, Jiri Kosina Cc: Benjamin Tissoires , Ping Cheng , Aaron Skomra , Jason Gerecke , stable@vger.kernel.org, Jason Gerecke Subject: [PATCH] HID: wacom: Do not completely map WACOM_HID_WD_TOUCHRINGSTATUS usage Date: Fri, 4 Aug 2017 15:35:14 -0700 Message-Id: <20170804223514.3080-1-killertofu@gmail.com> X-Mailer: git-send-email 2.13.4 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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") Cc: stable@vger.kernel.org Signed-off-by: Jason Gerecke --- drivers/hid/wacom_wac.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 149bdff28d32..40d129f8d7e0 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1845,7 +1845,13 @@ static void wacom_wac_pad_usage_mapping(struct hid_device *hdev, 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: