From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23DE1C433DF for ; Fri, 10 Jul 2020 13:15:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EED2C206A5 for ; Fri, 10 Jul 2020 13:15:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="brfOHy+1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727003AbgGJNPP (ORCPT ); Fri, 10 Jul 2020 09:15:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726840AbgGJNPP (ORCPT ); Fri, 10 Jul 2020 09:15:15 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C062CC08C5CE for ; Fri, 10 Jul 2020 06:15:14 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id d21so3164510lfb.6 for ; Fri, 10 Jul 2020 06:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=HatYWsWjAYZDo/VI9JPBHwaGt+iGT5r2vzkw+4UnyaI=; b=brfOHy+1MViqjqhRbgD8WqTzFsNRG3hxUa+SVZZRv3SIOKL7HwqiDp5CxDg8Ut0MAc yJUQBLB6w11htT6S9Dm2p0FVzBTdmWjgKJETo3jO7RUPT5+HkBWW+agqioV6802cWsFp U7rJ+3FdxsAw77rXOpHGi8Q5OOrLBPDywvl6/Ur4hEWKn5CbtiHPd21z6nEDuSJU9BlD 9w8fvLG1NBlO+6jcg0qnEFxc7ytMM5BT+uM0EPwPiYnvYKLnoFWJO2fgbtGMEsDatWnl yQ1CZw0SqUVu6u1Ec8B2+sdVAKX7EgoK7yHNap/LvqpEbMzXE+v3nAc4qrd3alywcBK0 s/RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=HatYWsWjAYZDo/VI9JPBHwaGt+iGT5r2vzkw+4UnyaI=; b=ounDIEVaJznv2lvx8kpjOPLUtvOrfIPAIeXeiAUkSUCa+vtLRnosDC6CR0aW8Jc5cJ UqamwrcVBTbnrAoMa6WwPjcl0Lb1CnjJpWSzjtFEuFsLIR2yjdJC7UKQPa+eGaMUFBqg 7I25zRV++Hp31DTo9zdO0aZhB6416dm03t2hsUl+1injC2JPcJeLaGZEfYdu+xELO2dt tn2Gef9MJuZx3+4bWMardi6rEtkrGkswCa8VQJ0/OUvc9B7FlcYpgeTzScSn0yQua34F SND2AM6tNqHz6zUA7Oyx2sUczWB+vp+1d+00695CiM2Rr6mUd+fxDDru4KyhD+Jn9rzn NuTw== X-Gm-Message-State: AOAM5314w8nkdI5pn59pikjjYhU1d8LTmlwOwXRUvvo9JQ4jaQ1Mdr/G 89OdjYN1dnQEIFeIvgpbtULEhsRDq41Q9llV28M= X-Google-Smtp-Source: ABdhPJyj0p1wGWtF4umvi3+S8ncHXGh8d6uRnsAGhRhUXuAubnh+uxEYqYUBuS/7TsL1CmBXsj0Ln1LqlJgdx26jC7I= X-Received: by 2002:ac2:558f:: with SMTP id v15mr43592623lfg.187.1594386913235; Fri, 10 Jul 2020 06:15:13 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Wei Shuai Date: Fri, 10 Jul 2020 21:15:02 +0800 Message-ID: Subject: Re: Linux General Joystick Max buttons limitation 80 To: Dmitry Torokhov Cc: "open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)..." Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Dear Dmitry Torokhov, I have tried this change on Ubuntu, it really works. The small fix will break the limitation of the max button number of Joystick. Please help to review the patch, I have sent the patch in a different email thread. Wei Shuai =E4=BA=8E2020=E5=B9=B47=E6=9C=8810=E6=97=A5= =E5=91=A8=E4=BA=94 =E4=B8=8A=E5=8D=887:10=E5=86=99=E9=81=93=EF=BC=9A > > Dear Joystick Maintainer, > > we found Linux kernel has max joystick buttons up to 80, no more > > We are selling a USB joystick device QMCP737C for flight simulator, > which is nothing but a common USB joystick. it has 104 buttons > > Product link > https://x-plane.vip/quickmade/qmcp737c/ > > it works good on Windows, Mac, but not on Linux. > Linux kernel exposes /dev/input/js0 max to 80 buttons, but we have 104 bu= ttons. > > I did a lot of google search, but nothing I got. then I have to look > at Kernel source, to find out where this number max 80 comes from > > Eventually I found the final limitation > > #define BTN_JOYSTICK 0x120 > > #define BTN_DEAD 0x12f > > #define BTN_TRIGGER_HAPPY 0x2c0 > > #define KEY_MAX 0x2ff > > include/uapi/linux/input-event-codes.h > > according to function hidinput_configure_usage() in file drivers/hid/hid-= input.c > > the joystick button mapping is not a continuous space, general speak > the mapping space is from > > BTN_JOYSTICK~BTN_DEAD > BTN_TRIGGER_HAPPY~KEY_MAX > > and finally I got the max limitation is 80. > > My question is why KEY_MAX is 0x2ff? this number 0x2ff looks like it > does not align with char?integer? the answer is no > > so may I ask to expand KEY_MAX to such as 0x4ff? or you need me to > submit patch for it, I am OK > > Thank you