From patchwork Fri Oct 7 22:16:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gerecke, Jason" X-Patchwork-Id: 9367733 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 E0EAD6075E for ; Fri, 7 Oct 2016 22:18:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2DA22983D for ; Fri, 7 Oct 2016 22:18:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C737829840; Fri, 7 Oct 2016 22:18: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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 75D952983D for ; Fri, 7 Oct 2016 22:18:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757434AbcJGWSL (ORCPT ); Fri, 7 Oct 2016 18:18:11 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:35881 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757443AbcJGWSB (ORCPT ); Fri, 7 Oct 2016 18:18:01 -0400 Received: by mail-qt0-f196.google.com with SMTP id y38so1649649qta.3 for ; Fri, 07 Oct 2016 15:17:30 -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=atVfnfgbFSCtdMn7v/+tREBqipR1ICzpgKfLDJDyLAs=; b=r+0Gud5rS9MAkHh46Jx4SMuuV93kQornSToD6WXSM76KgweSUq8tMJKsB9arjjdDI5 GUcNDlF6pF+BUSKHj0LO+u/tzTbUG+Rk0JBKWUHjGMIQFSz8PGvrJ77Q8E109R5RM9LK r6qZ3uYFWmFwOgfImjZjZdkIUd7sicfxBQNk/xVQscweOmx6FkqcJZZxRorzMKQt814e G2e66uyRRSSLiduLQ/2eduIFgYIj3axwmyuKoj8KCHzBrrUsTGCDVK1T/xJa2QGYjDPX sIqGUjTk8bP756KyG9LEUK5GCf8w+uUcXAuP62GNTvKuh69lnmFVcYURnwTsjwLPKaYv IUIw== 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=atVfnfgbFSCtdMn7v/+tREBqipR1ICzpgKfLDJDyLAs=; b=kc/BvJAt7sRy5MhmXgcbj/oitk61HyGOYs5fFvpPETznwioyiNBJZjCiFwp++Ru6RJ OS/rzmkQw7c6ZBqFX95NtC2yDLzbYh4+yyUsEQI4sLKkIGV9Mjl37JLJbFQbxkceM0RV bLnXCYXcwMRv8XPRUq4AP4odJtcjxotyuu/vgypkzfMn5/zTUUgicP/1jLuC7Dh+NTfP lN1Vv8BvgdjerXJ+MXBdBZlLswNhmacInI9WKmeUT6RjsbMxkjAfm3hJtoio06DcY1Eb +P16akyESE85aQBnvTpeCFa6XCTGS2dI/M6hqpWDiXKj1WvRDoVQTcscYjdpF/Hub65x C0Ow== X-Gm-Message-State: AA6/9RnCFKxjCfvxKAhPsCLKvlc/3o3OrzgzY9dJUb3JD9jmMivSmx7rqVIG7kkLIWpDTA== X-Received: by 10.237.59.130 with SMTP id r2mr22741323qte.77.1475878650291; Fri, 07 Oct 2016 15:17:30 -0700 (PDT) Received: from wacom-arch2.corp.onewacom.com ([50.225.60.4]) by smtp.gmail.com with ESMTPSA id u63sm7633162qkd.16.2016.10.07.15.17.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Oct 2016 15:17:29 -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 v2 18/18] HID: input: Recognize ABS_WHEEL in hidinput_calc_abs_res Date: Fri, 7 Oct 2016 15:16:53 -0700 Message-Id: <20161007221653.26941-18-killertofu@gmail.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161007221653.26941-1-killertofu@gmail.com> References: <20161006212231.31440-1-killertofu@gmail.com> <20161007221653.26941-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 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 */