From patchwork Thu Oct 20 01:03:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gerecke, Jason" X-Patchwork-Id: 9385717 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 C4D8F607D0 for ; Thu, 20 Oct 2016 01:05:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B58B628A07 for ; Thu, 20 Oct 2016 01:05:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA549296E3; Thu, 20 Oct 2016 01:05:24 +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 3D32228A07 for ; Thu, 20 Oct 2016 01:05:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756137AbcJTBFX (ORCPT ); Wed, 19 Oct 2016 21:05:23 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:35598 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755704AbcJTBFX (ORCPT ); Wed, 19 Oct 2016 21:05:23 -0400 Received: by mail-pf0-f195.google.com with SMTP id s8so3835585pfj.2 for ; Wed, 19 Oct 2016 18:05:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gSt6MLKTcSZTuhhY3wTN0IPXJr0ds3uyrTcuFmcr3NY=; b=Y1xqd+VTXFo3FCS2rhQUIfSQELzWg0JqETI43u1sGyV0EV6r51i5DCN86uLF45z9+U xSOeG58TVHxPTINsO1MyG7Yg8ngifLhDW3LEVuL1gz4oe2EH4Kc0uhDRKfE/9zkM22Vc 6DCWcWWrbhDwi8lsmEGbQbkgIzeEAnoVjFMgCN/233z4jJwjJ1KLXoWoQFQ2+LUN01um mg8QCwzX1rcQfFS2SCGpMd73x6WsoO3VpX8T27hq21vDqsYZTm6JYlkL1iXfJMYTE87i b7ggAHMarEgDvat3Nn9bTxzJ5L7yc9I1Z2JRGBEHoJfhMp5qJCGq2Wfn/oSzBkri9ifk lpIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gSt6MLKTcSZTuhhY3wTN0IPXJr0ds3uyrTcuFmcr3NY=; b=b957YzlEo9PJo5FdU9jN3QgtOZBLmpWDaNbW8OobeILPq1eOYprts/SGyB0tAIdZL2 cTXABZ9vBHzBslf5cmPhQFbJtTG9o/RyOB1+tQ0bEZHTAlJ1VwmT4kU5lbP49hHnsKS5 N/JTz3asVcHlTW13L4VOJMasPqPNTlje0eQ2DlJtOcOx4EeOjrm0ZGjwDPPSADvl0ZvD AuK6qOocp3pf+C0IzkBxlMLpWF6KPc5UZTzPp+ThZWbsmcLrYW+xXai9zjl+MpAOePuw KmAvwa3Gpq6zYNcY76HbmAPJdS6lx/ZcCiStFwZQoIr9lUwY/QVnr5HoKTgfLYMQrmFy Wk4Q== X-Gm-Message-State: AA6/9RksXKOaJNzZgLEy0iMDG+UbDrtNXHymfZCmnTtWr+iEUvnGoLdahpNaGCwdkjNVaQ== X-Received: by 10.98.31.4 with SMTP id f4mr16199068pff.67.1476925522402; Wed, 19 Oct 2016 18:05:22 -0700 (PDT) Received: from wtc005007.corp.onewacom.com ([50.225.60.4]) by smtp.gmail.com with ESMTPSA id d15sm877372pfl.90.2016.10.19.18.05.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Oct 2016 18:05:21 -0700 (PDT) From: Jason Gerecke To: linux-input@vger.kernel.org, Jiri Kosina Cc: Benjamin Tissoires , Ping Cheng , Ping Cheng , Aaron Skomra , Jason Gerecke , Jason Gerecke Subject: [PATCH v3 18/18] HID: input: Recognize ABS_WHEEL in hidinput_calc_abs_res Date: Wed, 19 Oct 2016 18:03:54 -0700 Message-Id: <20161020010354.4049-18-killertofu@gmail.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161020010354.4049-1-killertofu@gmail.com> References: <20161006212231.31440-1-killertofu@gmail.com> <20161020010354.4049-1-killertofu@gmail.com> 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 "Steering" usage (HID_UP_SIMULATION | 0xc8) is defined in HUT 1.12 as follows: "A steering wheel is a single degree-of-freedom device that rotates about an axis. The zero position is always the neutral or 'straight ahead' position, with positive values turning clockwise and negative values turning counterclockwise. If the Coordinate Values Wrap attribute is set, the steering wheel can be turned past 360 degrees." The hidinput_configure_usage function canonically maps this usage to the ABS_WHEEL axis, but hidinput_calc_abs_res does not recognize this axis as one for which it can calculate a resolution. This effectively prevents wheels from being assigned a proper resolution that userspace can use to determine the precise angle of input. This commit adds ABS_WHEEL as a rotational axis to hidinput_calc_abs_res. Signed-off-by: Jason Gerecke Reviewed-by: Benjamin Tissoires --- drivers/hid/hid-input.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index fb9ace1..c4e935b5 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -253,6 +253,7 @@ __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code) case ABS_RX: case ABS_RY: case ABS_RZ: + case ABS_WHEEL: case ABS_TILT_X: case ABS_TILT_Y: if (field->unit == 0x14) { /* If degrees */