From patchwork Thu Jul 26 15:15:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Schumacher X-Patchwork-Id: 10546025 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A3999157A for ; Thu, 26 Jul 2018 15:15:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 923822B4A5 for ; Thu, 26 Jul 2018 15:15:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86B552B4AF; Thu, 26 Jul 2018 15:15:33 +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=-7.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 182422B4A5 for ; Thu, 26 Jul 2018 15:15:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730105AbeGZQct (ORCPT ); Thu, 26 Jul 2018 12:32:49 -0400 Received: from mout.gmx.net ([212.227.15.19]:53239 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730413AbeGZQct (ORCPT ); Thu, 26 Jul 2018 12:32:49 -0400 Received: from p2520la.lan ([217.235.92.244]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LaXEN-1gPiJU3tap-00mIsM; Thu, 26 Jul 2018 17:15:28 +0200 From: Tim Schumacher To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, timschumi@gmx.de, vojtech@suse.cz Subject: [PATCH v3] input/iforce: Assign BTN_DEAD only for specific devices Date: Thu, 26 Jul 2018 17:15:19 +0200 Message-Id: <20180726151519.6206-1-timschumi@gmx.de> X-Mailer: git-send-email 2.18.0 In-Reply-To: <12cb48b3-30a9-9276-a479-9c205b2a7aa8@gmx.de> References: <12cb48b3-30a9-9276-a479-9c205b2a7aa8@gmx.de> X-Provags-ID: V03:K1:i3NScp6Uk843vHr2GwVqgcazNJHOqmAf/1Qv7TaDe4WNAzKxQAl yyuOt5kxW8h3AL6ZDMzDo8PzbeWzbA7A58wkocqEopTuPNPgDLUvm2pZaEugTuxEm8ICN8B SOSuzxhAMiO3XsKkxFATANu6VnHmaR43xou7pgc9YPr+HA4j3ptIoUnFCWsElAhCy9OraK0 ZyEJLu8poRnDDbfbz9zzQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:T51asJwgxvo=:SOukEEZ7sbsayp1OxDudsY HyHttWSikAxlNv/u6wIBosBJ3RjS7mAv2CqljVQGPF+fMQkQbTHbJLwilvcoQlIcSACE+F29A 8AQ1L3VijuWd12+zsE4QBRtho7Drm6weNZVrHpn2I1xLMGPaS5oabDwQ0eZP1ZIS6LjjICA0H VkI9WP/cEN01sAERffhq+6BXTcn4MBaCCj5BGqeQMQUhwpg4LQiWEjI33kDThdBRyfFinIj2B Ki25LU3qU0MVMku89HPRfyRrU4Zb90a6SU7E/cEEMbwXzM7uUbxPDi3Ijto9Pckz8PytVgKuY +2b/GSHudUKrjX58UaG0NTo14SFw5QL6SZLm+6JvqYH7ZrNWCL1Ku/fTNPiszplK8azLYQdLL 6INj9AE3UvOnf450UdGC8ME1916a8Q0KrBAho59+pE01MXLHY7JhZPVd/7JSEflmkJFRO9w+3 otM0o5kuMA1LBm5dn2YbG3GROcWpTkU5u+tUUbA+AU3awgEUIQLpjT5YMIPybBMKQrBtRWstI bmZaM0UBM0hP2k/zgrZ0QNjGJVHVpHoop5VDuIgPC3orfWKHfky++34x/rfUz+XOdN2HPRSOA WGygyxBe1AjhskduvpbbgcX78kKtwdmxCKoRfLMnBbujsjhIESKS/4yn+FkQbNiKzgL0kXSyY lyWPA/wCC2uiFh2CnvcMlkuV/XBZnij7gK3BzwalOz0tv0HPvYhZ3cHdfMHrSwsc77vhyDlmw 9wQfEuhO7zHU30/iFOpfaV3eDbIwIlqDF1O11K6BD8wMv6FjmiMi6wcK+NY= 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 Move BTN_DEAD into the arrays with the specific button sets instead of assigning it for every iforce device. BTN_DEAD represents an optical sensor which detects if the user is interacting with the device. On devices without that optical sensor BTN_DEAD is repeatedly causing false inputs on every status update of the joystick. Signed-off-by: Tim Schumacher --- This patch is currently a no-op for the WingMan Formula Force (which this issue is affecting) since it has the btn_wheel button set assigned (which contains joystick buttons) instead of btn_avb_wheel (which contains wheel-like buttons). A patch to move the WMFF from btn_wheel to btn_avb_wheel is pending, but it may be a better solution to rebuild the button lists to better reflect the targeted devices. drivers/input/joystick/iforce/iforce-main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c index daeeb4c7e3b0..94b839399e08 100644 --- a/drivers/input/joystick/iforce/iforce-main.c +++ b/drivers/input/joystick/iforce/iforce-main.c @@ -33,19 +33,21 @@ MODULE_LICENSE("GPL"); static signed short btn_joystick[] = { BTN_TRIGGER, BTN_TOP, BTN_THUMB, BTN_TOP2, BTN_BASE, - BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_BASE5, BTN_A, BTN_B, BTN_C, -1 }; + BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_BASE5, BTN_A, + BTN_B, BTN_C, BTN_DEAD, -1 }; static signed short btn_avb_pegasus[] = { BTN_TRIGGER, BTN_TOP, BTN_THUMB, BTN_TOP2, BTN_BASE, - BTN_BASE2, BTN_BASE3, BTN_BASE4, -1 }; + BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_DEAD, -1 }; static signed short btn_wheel[] = { BTN_TRIGGER, BTN_TOP, BTN_THUMB, BTN_TOP2, BTN_BASE, - BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_BASE5, BTN_A, BTN_B, BTN_C, -1 }; + BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_BASE5, BTN_A, + BTN_B, BTN_C, BTN_DEAD, -1 }; static signed short btn_avb_tw[] = { BTN_TRIGGER, BTN_THUMB, BTN_TOP, BTN_TOP2, BTN_BASE, - BTN_BASE2, BTN_BASE3, BTN_BASE4, -1 }; + BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_DEAD, -1 }; static signed short btn_avb_wheel[] = { BTN_GEAR_DOWN, BTN_GEAR_UP, BTN_BASE, BTN_BASE2, BTN_BASE3, @@ -388,7 +390,6 @@ int iforce_init_device(struct iforce *iforce) for (i = 0; iforce->type->btn[i] >= 0; i++) set_bit(iforce->type->btn[i], input_dev->keybit); - set_bit(BTN_DEAD, input_dev->keybit); for (i = 0; iforce->type->abs[i] >= 0; i++) {