Skip to content

Commit 842fec0

Browse files
qsuscsJiri Kosina
authored andcommitted
HID: nintendo: Set phys property of input device based on HID phys
While the MAC address the uniq identifier is set to (cf. commit 1425247 ("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 <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent aa051d3 commit 842fec0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/hid/hid-nintendo.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,6 +1634,7 @@ static int joycon_input_create(struct joycon_ctlr *ctlr)
16341634
ctlr->input->id.version = hdev->version;
16351635
ctlr->input->uniq = ctlr->mac_addr_str;
16361636
ctlr->input->name = name;
1637+
ctlr->input->phys = hdev->phys;
16371638
input_set_drvdata(ctlr->input, ctlr);
16381639

16391640
/* set up sticks and buttons */
@@ -1713,6 +1714,7 @@ static int joycon_input_create(struct joycon_ctlr *ctlr)
17131714
ctlr->imu_input->id.version = hdev->version;
17141715
ctlr->imu_input->uniq = ctlr->mac_addr_str;
17151716
ctlr->imu_input->name = imu_name;
1717+
ctlr->imu_input->phys = hdev->phys;
17161718
input_set_drvdata(ctlr->imu_input, ctlr);
17171719

17181720
/* configure imu axes */

0 commit comments

Comments
 (0)