summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt/switch.c
diff options
context:
space:
mode:
authorGil Fine <gil.fine@intel.com>2022-09-23 01:30:43 +0300
committerMika Westerberg <mika.westerberg@linux.intel.com>2023-06-16 09:53:27 +0300
commit6e21007d0f7e6723bb67e79aa3d0081419c403e8 (patch)
tree7e04b5cacc8c13815a91cc1e38b7bac09c838469 /drivers/thunderbolt/switch.c
parent2ad3e1314cafad9a8edbefed2b19d2a101cdb4fc (diff)
downloadlinux-stable-6e21007d0f7e6723bb67e79aa3d0081419c403e8.tar.gz
linux-stable-6e21007d0f7e6723bb67e79aa3d0081419c403e8.tar.bz2
linux-stable-6e21007d0f7e6723bb67e79aa3d0081419c403e8.zip
thunderbolt: Identify USB4 v2 routers
Add a new function usb4_switch_version() that can be used to figure out the spec version of the router and make tb_switch_is_usb4() to use it as well. Update the uevent accordingly. Signed-off-by: Gil Fine <gil.fine@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/switch.c')
-rw-r--r--drivers/thunderbolt/switch.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 47961afdcc73..3a1fc3e053f6 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -2056,8 +2056,9 @@ static int tb_switch_uevent(const struct device *dev, struct kobj_uevent_env *en
const struct tb_switch *sw = tb_to_switch(dev);
const char *type;
- if (sw->config.thunderbolt_version == USB4_VERSION_1_0) {
- if (add_uevent_var(env, "USB4_VERSION=1.0"))
+ if (tb_switch_is_usb4(sw)) {
+ if (add_uevent_var(env, "USB4_VERSION=%u.0",
+ usb4_switch_version(sw)))
return -ENOMEM;
}