diff mbox series

HID: nintendo: Set phys property of input device based on HID phys

Message ID 20220611010359.115555-1-qsx@chaotikum.eu
State Accepted
Commit 842fec058171db8f58a6073502a625372dddd96a
Headers show
Series HID: nintendo: Set phys property of input device based on HID phys | expand

Commit Message

Thomas Schneider June 11, 2022, 1:03 a.m. UTC
While the MAC address the uniq identifier is set to (cf. commit
1425247383c5 ("HID: nintendo: set controller uniq to MAC")) is certainly
unique, the physical location can be more helpful in user interfaces.  The
underlying hid_device already provides a suitable value, so we can simply
reuse this here.

Signed-off-by: Thomas Schneider <qsx@chaotikum.eu>
---
 drivers/hid/hid-nintendo.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jiri Kosina June 15, 2022, 2:42 p.m. UTC | #1
On Sat, 11 Jun 2022, Thomas Schneider wrote:

> While the MAC address the uniq identifier is set to (cf. commit
> 1425247383c5 ("HID: nintendo: set controller uniq to MAC")) is certainly
> unique, the physical location can be more helpful in user interfaces.  The
> underlying hid_device already provides a suitable value, so we can simply
> reuse this here.
> 
> Signed-off-by: Thomas Schneider <qsx@chaotikum.eu>

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index 2204de889739..df9cd5d883c0 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -1634,6 +1634,7 @@  static int joycon_input_create(struct joycon_ctlr *ctlr)
 	ctlr->input->id.version = hdev->version;
 	ctlr->input->uniq = ctlr->mac_addr_str;
 	ctlr->input->name = name;
+	ctlr->input->phys = hdev->phys;
 	input_set_drvdata(ctlr->input, ctlr);
 
 	/* set up sticks and buttons */
@@ -1713,6 +1714,7 @@  static int joycon_input_create(struct joycon_ctlr *ctlr)
 	ctlr->imu_input->id.version = hdev->version;
 	ctlr->imu_input->uniq = ctlr->mac_addr_str;
 	ctlr->imu_input->name = imu_name;
+	ctlr->imu_input->phys = hdev->phys;
 	input_set_drvdata(ctlr->imu_input, ctlr);
 
 	/* configure imu axes */