summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt/switch.c
diff options
context:
space:
mode:
authorAndreas Noever <andreas.noever@gmail.com>2014-06-03 22:04:11 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-19 23:13:00 +0200
commitc90553b3c4ac2389a71a5c012b6e5bb1160d48a7 (patch)
treea4374e06d030654c1dd1f076417908f2536824f4 /drivers/thunderbolt/switch.c
parentPCI: Suspend/resume quirks for Apple thunderbolt (diff)
downloadlinux-c90553b3c4ac2389a71a5c012b6e5bb1160d48a7.tar.xz
linux-c90553b3c4ac2389a71a5c012b6e5bb1160d48a7.zip
thunderbolt: Read switch uid from EEPROM
Add eeprom access code and read the uid during switch initialization. The UID will be used to check device identity after suspend. Signed-off-by: Andreas Noever <andreas.noever@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/thunderbolt/switch.c')
-rw-r--r--drivers/thunderbolt/switch.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 667413f3ad7a..aeb5c30f8d76 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -376,6 +376,11 @@ struct tb_switch *tb_switch_alloc(struct tb *tb, u64 route)
}
sw->cap_plug_events = cap;
+ if (tb_eeprom_read_uid(sw, &sw->uid))
+ tb_sw_warn(sw, "could not read uid from eeprom\n");
+ else
+ tb_sw_info(sw, "uid: %#llx\n", sw->uid);
+
if (tb_plug_events_active(sw, true))
goto err;