Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp3277429rdb; Tue, 29 Aug 2023 10:19:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOqlxOUGi/ZA6qwgDs72+NbZmorrNS+tpshMcBQR0sQu6KXrxR4kiS2cHwGoYrc8761aaT X-Received: by 2002:a05:6402:790:b0:527:3a95:3fa4 with SMTP id d16-20020a056402079000b005273a953fa4mr15270012edy.20.1693329577454; Tue, 29 Aug 2023 10:19:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693329577; cv=none; d=google.com; s=arc-20160816; b=aTuSJW7VkrZvRfxWuDFvCk+9Gt22nZoucv1RpixgFjkXy1KrS+j8nuXHZSoOTtXtXg wruckQ/DzJ3bUxBzGtOnbmXTW7mJXboTzARuT8v/+vPokn3pSvKd7cQOW6kjUMQ8wn/A jwLRhBNjwYCFqGB8mhx9uvC52QJfGgGCMjwN43YY7JlU4JxJRhfOqz0VmBTlAJ3w04GQ Bs/XYylC14QpyS3HwCfjZj7911/4KcK/jShzafAyFaRLqJ+hKqdT3TicEPBNmPh3E54h gM8EmLkByfT7R5vzJfPmLfgv1SklkWWFT0/daLrzneEIoyXkfYXI+0bdTGNATx+8T7JJ +VhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=2u6yqXHFzXQARuLxeRtkMejaOToCXpBvYXvO2S5rtRA=; fh=WC2qazqt1A1oXSsuFVmz5YlAjajT/mxNCtkuH9bvZdM=; b=ymoT90JxyXDw3tCBA3EseOdegExCakG0XuFz0S4xOrcmJeJZ4rHsr5wDC5j4vN9WD9 xwMlh2c2qeUPqQY2N4vQ429xc0aQL5eifxmlPU86qImZRUIVM0RWA62KvBKzodxrLxLC DYkSFp8hkQK+EQHIg1wO1AZRLHKsPt4OUBjNb3lCQJsQGZTtTGmTQXP1OH0seohvbXGo TVaJd01NeoO9IgEINYKHXTInbkKknwFnS5acLDjWMpPyuzOgh1vSJQEGLvigbtJdh8lc 7Z+GjvNhUhsFiMsz6cKuKhFtARXfs5iVDJYIwx85qbH3UIM+7kwfrezbvrJDd1q4Fcsu 8FNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y14-20020aa7d50e000000b00523409dcaabsi4362315edq.617.2023.08.29.10.19.04; Tue, 29 Aug 2023 10:19:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235889AbjH2Pyn (ORCPT + 99 others); Tue, 29 Aug 2023 11:54:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232803AbjH2PyQ (ORCPT ); Tue, 29 Aug 2023 11:54:16 -0400 Received: from mail.enpas.org (zhong.enpas.org [IPv6:2a03:4000:2:537::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FFD0113; Tue, 29 Aug 2023 08:54:12 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail.enpas.org (Postfix) with ESMTPSA id 573A710134F; Tue, 29 Aug 2023 15:54:07 +0000 (UTC) Message-ID: Date: Wed, 30 Aug 2023 00:53:51 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH 2/2] hid-sony: DS3: Report analog buttons for Sixaxis To: Dmitry Torokhov , Jiri Kosina , Benjamin Tissoires Cc: Vicki Pfau , Pavel Rojtberg , Roderick Colenbrander , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230826152111.13525-1-max@enpas.org> <20230826152111.13525-3-max@enpas.org> Content-Language: en-US From: Max Staudt In-Reply-To: <20230826152111.13525-3-max@enpas.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/27/23 00:21, Max Staudt wrote: > This change exposes these buttons as axes in a way that is as backwards > compatible and as close to the Linux gamepad spec as possible. > > [...] > > - The D-Pad as ABS_HAT0X/ABS_HAT0Y, -255 to 255 One further idea: The DualShock 3 reports all 4 D-pad buttons separately, and hid-sony currently reports them as discrete digital buttons to userspace. Would it be better to do the same with the analog buttons, i.e. to report the 4 measurements as discrete axes, rather than the current patch's approach of merging them into two logical axes? Of course, this would require 4 more axes, this would not fit into any existing scheme, and since we've run out of ABS_MISC+n at this point, this could be a further reason for officially reserving a range of axes for analog buttons. Something like: #define ABS_BTN_SOUTH 0x40 #define ABS_BTN_A ABS_BTN_SOUTH #define ABS_BTN_EAST 0x41 #define ABS_BTN_B ABS_BTN_EAST #define ABS_BTN_C 0x42 #define ABS_BTN_NORTH 0x43 #define ABS_BTN_X ABS_BTN_NORTH #define ABS_BTN_WEST 0x44 #define ABS_BTN_Y ABS_BTN_WEST #define ABS_BTN_Z 0x45 #define ABS_BTN_DPAD_UP 0x46 #define ABS_BTN_DPAD_DOWN 0x47 #define ABS_BTN_DPAD_LEFT 0x48 #define ABS_BTN_DPAD_RIGHT 0x49 #define ABS_MAX 0x4f #define ABS_CNT (ABS_MAX+1) Max