From patchwork Thu Aug 25 14:16:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ville Ranki X-Patchwork-Id: 9299443 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 8B9AA60459 for ; Thu, 25 Aug 2016 14:26:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74C1629302 for ; Thu, 25 Aug 2016 14:26:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67F7A2933F; Thu, 25 Aug 2016 14:26:36 +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.9 required=2.0 tests=BAYES_00,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 3852529302 for ; Thu, 25 Aug 2016 14:26:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751316AbcHYOY4 (ORCPT ); Thu, 25 Aug 2016 10:24:56 -0400 Received: from sirokuusama2.dnainternet.net ([83.102.40.153]:42574 "EHLO sirokuusama2.dnainternet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759408AbcHYOXV (ORCPT ); Thu, 25 Aug 2016 10:23:21 -0400 X-Greylist: delayed 317 seconds by postgrey-1.27 at vger.kernel.org; Thu, 25 Aug 2016 10:23:21 EDT Received: from localhost (localhost [127.0.0.1]) by sirokuusama2.dnainternet.net (Postfix) with ESMTP id 309FF298B; Thu, 25 Aug 2016 17:18:01 +0300 (EEST) X-Virus-Scanned: DNA Internet at dnainternet.net Received: from sirokuusama2.dnainternet.net ([83.102.40.153]) by localhost (sirokuusama2.dnainternet.net [127.0.0.1]) (DNA Internet, port 10040) with ESMTP id VlF7Mvb0nUxD; Thu, 25 Aug 2016 17:18:00 +0300 (EEST) Received: from kirsikkapuu2.dnainternet.net (kirsikkapuu2.dnainternet.net [83.102.40.52]) by sirokuusama2.dnainternet.net (Postfix) with ESMTP id DF281298C; Thu, 25 Aug 2016 17:18:00 +0300 (EEST) Received: from localhost.localdomain (unknown [62.165.139.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by kirsikkapuu2.dnainternet.net (Postfix) with ESMTPS id 9076B7A; Thu, 25 Aug 2016 17:17:57 +0300 (EEST) From: Ville Ranki To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com, Ville Ranki Subject: [PATCH] Input: joydev - Recognize joysticks with Z axis as joysticks. Date: Thu, 25 Aug 2016 17:16:50 +0300 Message-Id: <1472134610-6438-1-git-send-email-ville.ranki@iki.fi> X-Mailer: git-send-email 2.7.4 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 Current implementation of joydev's input_device_id table recognizes only devices with ABS_X, ABS_WHEEL or ABS_THROTTLE axes as joysticks. There are joystick devices that do not have those axes, for example TRC Rudder device. The device in question has ABS_Z, ABS_RX and ABS_RY axes causing it not being detected as joystick. This patch adds ABS_Z to the input_device_id list allowing devices with ABS_Z axis to be detected correctly. Signed-off-by: Ville Ranki --- drivers/input/joydev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index 5d11fea..f3135ae 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c @@ -950,6 +950,12 @@ static const struct input_device_id joydev_ids[] = { .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_ABSBIT, .evbit = { BIT_MASK(EV_ABS) }, + .absbit = { BIT_MASK(ABS_Z) }, + }, + { + .flags = INPUT_DEVICE_ID_MATCH_EVBIT | + INPUT_DEVICE_ID_MATCH_ABSBIT, + .evbit = { BIT_MASK(EV_ABS) }, .absbit = { BIT_MASK(ABS_WHEEL) }, }, {