Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp931594ybt; Wed, 24 Jun 2020 15:10:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9ZR0WHP9a1AAo+Lc44qlw9crsGJf1nF+019a8XNnKywBmXJvpT6vjnaFgINGz+hqPv9ka X-Received: by 2002:a50:d7c1:: with SMTP id m1mr4791420edj.217.1593036612253; Wed, 24 Jun 2020 15:10:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593036612; cv=none; d=google.com; s=arc-20160816; b=zTNuaSzgzxlfzq4thvjjpzQNwJXgfao/OOIJ4LOnD3DW4w4RlaYfUM0K9d1ZqG2FGw /K4lChAbHK/1K1Kbx/4E0BukHScGmUI88lvT9XSqGnayISO9xQksmeSK7f0/C1RxPg5f IICRrK4Qd6ZDRD6z3NfcVfnHY2OoZhRphec0PqH7fDPblFAsorVyrcNHUerj2K7E/Lk1 5CN2ALz3xSdL+acei3LViMh8Ta2g3/6UqOf28TcQrj3U5mnZEhEzHIIss3x6UDCuplZG 0J49WRABuJV7CP1/NgZAV3+ml64xr0rrjUgcUNixOTrSvlhOn3nl3Zg3ppOPPfLs/KZL +o7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=H/RysOR6N0zpE6c3ebPBn7+IKDXpPNRcb77mnWUMTFM=; b=ABP3jU8A9wJa+vmzgKIOD7iOqJMSEQwhcc/SU7hcJLuOMKlhak9VNhE6gDRoEzpfTW 5vd2pKHfOKRxl/xlikSno5LZZF5rZHUe/wxVdZ+nsh9+hAbkTNqLN6aLOcuMDHI9MkOP ZMC1wPc1+FCM2ZAyhOYIwnBvjYy4ksx531N0vUxZuaAa3wwi72kIIpKHxt/tNG1emEIw E7HkYFw2SARdMA9zJpjrs+x8pZhfYsMbcZJOioqJIJIpDRx6r6EB7c99ZArXeW4MM5q9 wMjV+Jy5kDVuNTfuYzN0xRHQxGc04EUjSB6f/mM9wDDI4iAw+aiDfjOWc7gNA0/EWGKq ZU5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ca9si8922686edb.324.2020.06.24.15.09.49; Wed, 24 Jun 2020 15:10:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390194AbgFXWJf (ORCPT + 99 others); Wed, 24 Jun 2020 18:09:35 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:33229 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387853AbgFXWJe (ORCPT ); Wed, 24 Jun 2020 18:09:34 -0400 Received: by mail-qt1-f193.google.com with SMTP id h23so3115369qtr.0; Wed, 24 Jun 2020 15:09:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version; bh=H/RysOR6N0zpE6c3ebPBn7+IKDXpPNRcb77mnWUMTFM=; b=Ny5odRbKAi5LzNa43J7hHBhF3MbPRmVRjrmvnz+U/Xkv7pV53PZdPxZik4xpgllf7s FC5izVUC/R3feViW1nLbeywuguz5V+rWlgU4558Z44CSgYkI/2UTFXL+qkUnTS7ydzCx S96ktNXHp9PnsvgaG6+XqhVbaOs+al+DvsimulCoTDpMwGoedqGOgfnK6jq9YoCGzUeH 6a4FWCvgJr+yOZWIaWHelGodQemu8JVAjPMC20PK7o6T4ccNXyD2BgY9wtuVlnlvEc+o E8PHgVha5ayseyYLn38dl413xKgKdr4yMAp31YnjJvY7qHod8byMIYyDELD335ZTLFNr 4KZA== X-Gm-Message-State: AOAM533aRnfjifDmXiT4fDcwbNvbjXjHcnltk8kPa3D/0uoQ3tKIo0/X 6FXnkgaKo37/xCOL54voaiU= X-Received: by 2002:aed:3386:: with SMTP id v6mr29626444qtd.187.1593036572579; Wed, 24 Jun 2020 15:09:32 -0700 (PDT) Received: from dek-x230.localnet (pool-108-24-134-99.cmdnnj.fios.verizon.net. [108.24.134.99]) by smtp.gmail.com with ESMTPSA id p128sm2705938qka.47.2020.06.24.15.09.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 15:09:31 -0700 (PDT) From: David Korth To: David Rheinsberg Cc: Jiri Kosina , Benjamin Tissoires , "open list:HID CORE LAYER" , linux-kernel Subject: Re: [PATCH 1/2] HID: wiimote: Initialize the controller LEDs with a device ID value Date: Wed, 24 Jun 2020 18:05:38 -0400 Message-ID: <2498150.lGaqSPkdTl@dek-x230> In-Reply-To: References: <20200622225728.330-1-gerbilsoft@gerbilsoft.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2327861.XAFRqVoOGU"; micalg="pgp-sha256"; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nextPart2327861.XAFRqVoOGU Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Wednesday, June 24, 2020 6:04:55 AM EDT David Rheinsberg wrote: > Hi > > On Tue, Jun 23, 2020 at 12:57 AM David Korth wrote: > > Based on a similar commit for Sony Sixaxis and DualShock 4 controllers: > > HID: sony: Initialize the controller LEDs with a device ID value > > > > Wii remotes have the same player LED layout as Sixaxis controllers, > > so the wiimote setup is based on the Sixaxis code. > > Please include a description of the patch in the commit-message. It > took me quite a while to understand what the intention of this patch > is. Will do. > So what you are trying is to allocate a unique ID to each connected > wiimote, so they automatically display unique IDs, right? > > Can you explain why this has to be done in the kernel driver? Why > isn't user-space assigning the right ID? User-space needs to attach > controllers to their respective engine anyway, in which case the IDs > the kernel assigns would be wrong, right? How does user-space display > the matching ID in their UI (e.g., for configuration use-cases)? The > way you set them does not allow user-space to query the ID, does it? > Lastly, wouldn't a device-reconnect want the same ID to be assigned > again? With the logic you apply, user-space would have to override > every ID for that to work. > > Is there an actual use-case for this? Or is this just to align the > driver with the other gamepads? Most userspace programs aren't aware of controller LEDs. The only one I know of that is, Steam, has its own input layer and bypasses the HID drivers entirely. As far as I know, there's no simple "set player ID" API that could be used to set a device-independent player number, so every program would need to support each type of controller in order to set the LEDs. I've been manually setting the player IDs on Wii controllers when running multiplayer games by writing to the /sys/class/leds/ directory. Having the hid-wiimote driver do this itself significantly reduces setup time. > > Thanks > David > --nextPart2327861.XAFRqVoOGU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEBKTd2QxoniMIp2ejTC/4LR6byCgFAl7zzjIACgkQTC/4LR6b yChVzg//X26Y6hKZxQy4cDA1rgOX4e105gYsE80z9Qwwsm4anXZNgXsZXYfhLaW0 hfgKIvM08EXszBIkVDXrKW7gO+irRmZfbZGVqMP4QTC6vr6FO3eFnGyH/NGX6QCI /SzB0Wl23BlIujOXGNCj2I/Gs7gJ1lJ2XpMcOQQpdJwWas1DWOGhSQ36hMw0D3iF 9swjyU0HR++xg7H0B26wFgJ1ZGjC1dOvYNh8uPKPKB/Un/lN9kuSOSIowcFK17En Wl5TN41gIKr8IoG2EZ0EKaDLM5tdrmcdrcmQV7Qg+U/fLRZPdrrHslO8tHZhy9pc ldnIYbCEJ5mFBdkCDl9zaUTKXhx4dwSTqpLcFNVjnYEk8roxgk+Ur6tVwbiZs8Xd TOUfzuvzyIE7yaRiUXVDQo+zgtKVj7wcLHMhPkhngMYmYWSq3Jrpw3zePxDtitdd kE6mWZmNgnrnJFjjAVp5gnTxdSQeT3bz5PH8PTEwXW6jSE+6dbuIoPQu6ONW2PRi LlntfKBuqaDOU0Jbqrw/HxQsdupLNNHSi1l9SoGt3C8ET5sW9cd1SuBzDM8uaLK1 AxhObrHrSWa0iIj64bB1QCEvghVYAg+Xqe6V1hMfdoDdg8EF3QmQFM7j0VEbXkdx /Cn53xTl4GkSWxnJPD3essXj4VnBSLRJKYouZkG15l5MsSZPMDQ= =F17s -----END PGP SIGNATURE----- --nextPart2327861.XAFRqVoOGU--