From patchwork Sun Feb 15 02:03:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Michal_Mal=C3=BD?= X-Patchwork-Id: 5829111 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 73096BF440 for ; Sun, 15 Feb 2015 02:05:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7363B201ED for ; Sun, 15 Feb 2015 02:05:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4592F201CE for ; Sun, 15 Feb 2015 02:05:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754451AbbBOCEH (ORCPT ); Sat, 14 Feb 2015 21:04:07 -0500 Received: from devoid-pointer.net ([31.31.77.140]:40497 "EHLO smtp.devoid-pointer.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754373AbbBOCEF (ORCPT ); Sat, 14 Feb 2015 21:04:05 -0500 Received: from Labrat.localdomain.localdomain (228.123.broadband5.iol.cz [88.100.123.228]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by smtp.devoid-pointer.net (Postfix) with ESMTPSA id A30D621977; Sun, 15 Feb 2015 03:03:53 +0100 (CET) From: =?UTF-8?q?Michal=20Mal=C3=BD?= To: jkosina@suse.cz Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, simon@mungewell.org, elias.vds@gmail.com, =?UTF-8?q?Michal=20Mal=C3=BD?= Subject: [PATCH v2 3/4] HID: hid-lg4ff: Introduce a module parameter to disable automatic switch of Logitech gaming wheels from compatibility to native mode. This only applies to multimode wheels. Date: Sun, 15 Feb 2015 03:03:04 +0100 Message-Id: <1423965785-22930-4-git-send-email-madcatxster@devoid-pointer.net> X-Mailer: git-send-email 2.3.0 In-Reply-To: <1423965785-22930-1-git-send-email-madcatxster@devoid-pointer.net> References: <1423965785-22930-1-git-send-email-madcatxster@devoid-pointer.net> MIME-Version: 1.0 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Introduce a module parameter to disable automatic switch of Logitech gaming wheels from compatibility to native mode. This only applies to multimode wheels. Signed-off-by: Michal MalĂ˝ --- drivers/hid/hid-lg.c | 6 ++++++ drivers/hid/hid-lg4ff.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index f91ff14..8dae03f 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c @@ -818,4 +818,10 @@ static struct hid_driver lg_driver = { }; module_hid_driver(lg_driver); +#ifdef CONFIG_LOGIWHEELS_FF +extern int lg4ff_no_autoswitch; /* From hid-lg4ff.c */ +module_param_named(lg4ff_no_autoswitch, lg4ff_no_autoswitch, int, S_IRUGO); +MODULE_PARM_DESC(lg4ff_no_autoswitch, "Do not switch multimode wheels to their native mode automatically"); +#endif + MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index 3401f17..e4b8cae 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c @@ -67,6 +67,7 @@ #define LG4FF_FFEX_REV_MAJ 0x21 #define LG4FF_FFEX_REV_MIN 0x00 +int lg4ff_no_autoswitch = 0; static void hid_lg4ff_set_range_dfp(struct hid_device *hid, u16 range); static void hid_lg4ff_set_range_g25(struct hid_device *hid, u16 range); @@ -803,7 +804,8 @@ int lg4ff_handle_multimode_wheel(struct hid_device *hid, u16 *real_product_id, c /* Switch from "Driving Force" mode to native mode automatically. * Otherwise keep the wheel in its current mode */ if (reported_product_id == USB_DEVICE_ID_LOGITECH_WHEEL && - reported_product_id != *real_product_id) { + reported_product_id != *real_product_id && + !lg4ff_no_autoswitch) { const struct lg4ff_compat_mode_switch *s; switch (*real_product_id) {