From patchwork Sat Nov 7 16:10:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: simon@mungewell.org X-Patchwork-Id: 7575841 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BFAB69F36A for ; Sat, 7 Nov 2015 16:12:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E0BD520546 for ; Sat, 7 Nov 2015 16:12:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0323320481 for ; Sat, 7 Nov 2015 16:12:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753962AbbKGQLJ (ORCPT ); Sat, 7 Nov 2015 11:11:09 -0500 Received: from host18.canaca.com ([66.49.204.205]:58604 "EHLO host18.canaca.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753913AbbKGQKd (ORCPT ); Sat, 7 Nov 2015 11:10:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mungewell.org; s=default; h=References:In-Reply-To:Message-Id:Date:Subject: Cc:To:From; bh=2W6+jWfaQgsK/oRf4lGzeDXClzPSqOSRkqqAz1XV/JA=; b=nvAUjdqoujlEeG Nt3q6ar4Lx9lt0x4Ffz7cMQEJ9okNAAkJw7apJXfJCXvjcc/hmFRrvzu4ly/pOmihdiYmfqt9tH9F Rfqh5ihzrLU7ZNPeTEE0fHQLGMlQ+WsMhP8RYiW9mIv9NwO8O9/Z80oZzygVazl3lagN/fXEaz+zv qOnvA+l0xH5FP4wYv32pGAVnHMf9yeQPvOZLNjCM4+3PXUEs8VDTFBeIVN6T9NL31ZxzU853tnYqE gfeh2UKXOV+yiMkfX+OoQGx1NDVKeeu0shisrfF54ZKcGqtU4M9nTyTOOQzuuImV6aoSRY+41R1v+ V6H/M0cWFvMsfcDF5d7A==; Received: from [208.75.119.66] (port=54138 helo=localhost.localdomain) by host18.canaca.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-SHA256:128) (Exim 4.86) (envelope-from ) id 1Zv64X-0004Va-Nb; Sat, 07 Nov 2015 11:10:33 -0500 From: Simon Wood To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Jiri Kosina , Edwin , =?UTF-8?q?Michal=20Mal=C3=BD?= , elias vanderstuyft , Benjamin Tissoires , Simon Wood Subject: [PATCH 6/6] HID: hid-logitech-hidpp: G920 remove deadzones Date: Sat, 7 Nov 2015 09:10:09 -0700 Message-Id: <1446912609-2573-7-git-send-email-simon@mungewell.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1446912609-2573-1-git-send-email-simon@mungewell.org> References: <1446912609-2573-1-git-send-email-simon@mungewell.org> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host18.canaca.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mungewell.org X-Get-Message-Sender-Via: host18.canaca.com: authenticated_id: gitsend@mungewell.org X-Authenticated-Sender: host18.canaca.com: gitsend@mungewell.org X-Source: X-Source-Args: X-Source-Dir: Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Ensure that the G920 is not given the default deadzones. Signed-off-by: Simon Wood Reviewed-by: Benjamin Tissoires --- drivers/hid/hid-logitech-hidpp.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index 03e01be..853b9c2 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -1441,6 +1441,27 @@ static int hidpp_input_mapping(struct hid_device *hdev, struct hid_input *hi, return 0; } +static int hidpp_input_mapped(struct hid_device *hdev, struct hid_input *hi, + struct hid_field *field, struct hid_usage *usage, + unsigned long **bit, int *max) +{ + /* Ensure that Logitech G920 is not given a default fuzz/flat value */ + if (usage->type == EV_ABS && (usage->code == ABS_X || + usage->code == ABS_Y || usage->code == ABS_Z || + usage->code == ABS_RZ)) { + switch (hdev->product) { + case USB_DEVICE_ID_LOGITECH_G920_WHEEL: + field->application = HID_GD_MULTIAXIS; + break; + default: + break; + } + } + + return 0; +} + + static void hidpp_populate_input(struct hidpp_device *hidpp, struct input_dev *input, bool origin_is_hid_core) { @@ -1873,6 +1894,7 @@ static struct hid_driver hidpp_driver = { .raw_event = hidpp_raw_event, .input_configured = hidpp_input_configured, .input_mapping = hidpp_input_mapping, + .input_mapped = hidpp_input_mapped, }; module_hid_driver(hidpp_driver);