From patchwork Thu Oct 6 21:22:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gerecke X-Patchwork-Id: 9365357 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 3E8306077E for ; Thu, 6 Oct 2016 21:23:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 292F729253 for ; Thu, 6 Oct 2016 21:23:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DC2A29256; Thu, 6 Oct 2016 21:23:12 +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 0ED2F29253 for ; Thu, 6 Oct 2016 21:23:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935260AbcJFVXK (ORCPT ); Thu, 6 Oct 2016 17:23:10 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:34472 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935088AbcJFVXJ (ORCPT ); Thu, 6 Oct 2016 17:23:09 -0400 Received: by mail-qk0-f193.google.com with SMTP id n189so1666651qke.1 for ; Thu, 06 Oct 2016 14:23:09 -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=jYXzrovUobuF7Nmz3QOVU0hejVBu0XjNt5M7Qg2Be+E=; b=aw6QjcdCnzIOEHfIt60YiSLkWvv3NSnF2Kjazu6RkoLiM3nsXCE+zU+cwFj+zXhJow vi+uS1Tgjz+RTTkGaNzM1V4Xs7bLP1WADtO8hMrU4zcT+Dz3NWL2YJ8Hi9n6nuMBq1sS 5FejTrS/pCpPkg+YLtQJQMkZaTxKjQwWSIs5Px3joTca+RkIT0b2/NSO0HTW5dZpHxxc FNIcocKT2Epr5cOP4VCw/OE1xUW03q/xVKlqHM+s1zCctW3+GaD3nvO6JinERvh/CbzB mM9jyenR+RhAMsO4fx5Se9s1916UyYoN44KOYwrVH02naZsTLIFMo5apbx79Wm2KEY14 65pA== 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=jYXzrovUobuF7Nmz3QOVU0hejVBu0XjNt5M7Qg2Be+E=; b=ORtShNYHK/vlSfbAbzuKLDe+672v2DKMg4W18nlzMRXOCzZ5gfkuwTIKP/Ixtsbarv AL8/9Q6dGdlxAe+hH6ZmjJQ/w+8Pn/HyD36o7A8Em8TaD8Ne79rpLRQmi2ChESvRGFAG 4p505Y0bgImP16ljf76o8oEN5Lsphkub+bPUtM+KkMYyM2duPZfFpLhAYhgw13e5Csbc /R+ZwQWYpNUMe9gm/nh3TNAp7d/fZ4cfG2hnpyGeIyPP91YSjPok63Cf7OzHmtagj+Fw CnuiQsUdBbynHE/2+Ijjew9cnDUykf2HFy9Yscwez7RQxKAWYJpG0s5TfZIMAaqFwGW5 2OEA== X-Gm-Message-State: AA6/9Rn8gUtf5h+e/LE2HeoSqOAPmTql0NhZsAUoag/kUyrK1zbuyNQkzu3aYac8qptBog== X-Received: by 10.55.45.196 with SMTP id t187mr15719549qkh.2.1475788988908; Thu, 06 Oct 2016 14:23:08 -0700 (PDT) Received: from wacom-arch2.corp.onewacom.com ([50.225.60.4]) by smtp.gmail.com with ESMTPSA id m4sm5773714qkf.29.2016.10.06.14.23.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Oct 2016 14:23:08 -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 19/19] HID: input: Recognize ABS_WHEEL in hidinput_calc_abs_res Date: Thu, 6 Oct 2016 14:22:31 -0700 Message-Id: <20161006212231.31440-20-killertofu@gmail.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161006212231.31440-1-killertofu@gmail.com> References: <20161006212231.31440-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 --- 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 bcfaf32..81d35e9 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 */