diff options
author | Roderick Colenbrander <roderick.colenbrander@sony.com> | 2016-12-08 19:09:51 -0800 |
---|---|---|
committer | Siarhei Vishniakou <svv@google.com> | 2019-11-07 11:13:45 -0600 |
commit | 4673579f83b614c0fda580d316c06366389241de (patch) | |
tree | 539421c350ee01e41f5bba66d3e382570d8aeb14 /drivers/hid | |
parent | 7a3cc478c0a05f2edbdab161080dcb4d3c9cce1f (diff) |
UPSTREAM: HID: sony: Use DS4 MAC address as unique identifier on USB
The DS4 MAC address is reported as a unique identified when
using Bluetooth. For USB there is no unique identifier reported
yet, so use the MAC address.
Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit c70d5f70ccbbdf56bb86adb42127db90d0c90976)
Bug: 111431828
Signed-off-by: Kim Low <kim-huei.low@sony.com>
Change-Id: I366c1dd01049c7039844e691456f5e49eb9d902f
Signed-off-by: Siarhei Vishniakou <svv@google.com>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-sony.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 5bfeea6ee3b4..b3befb1631d6 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -2391,6 +2391,12 @@ static int sony_check_add(struct sony_sc *sc) } memcpy(sc->mac_address, &buf[1], sizeof(sc->mac_address)); + + snprintf(sc->hdev->uniq, sizeof(sc->hdev->uniq), + "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", + sc->mac_address[5], sc->mac_address[4], + sc->mac_address[3], sc->mac_address[2], + sc->mac_address[1], sc->mac_address[0]); } else if ((sc->quirks & SIXAXIS_CONTROLLER_USB) || (sc->quirks & NAVIGATION_CONTROLLER_USB)) { buf = kmalloc(SIXAXIS_REPORT_0xF2_SIZE, GFP_KERNEL); |