diff options
author | Isaac Hazan <isaac.hazan@intel.com> | 2020-09-24 10:43:58 +0200 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2020-11-11 08:20:16 +0100 |
commit | 4210d50f0b3e423e10a7a254b2a67f5c5318868e (patch) | |
tree | a4980012f9efef1e60c9d94cf888cd4fd1653312 /drivers/thunderbolt/switch.c | |
parent | thunderbolt: Create XDomain devices for loops back to the host (diff) | |
download | linux-4210d50f0b3e423e10a7a254b2a67f5c5318868e.tar.xz linux-4210d50f0b3e423e10a7a254b2a67f5c5318868e.zip |
thunderbolt: Add link_speed and link_width to XDomain
Link speed and link width are needed for checking expected values in
case of using a loopback service.
Signed-off-by: Isaac Hazan <isaac.hazan@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Yehezkel Bernat <YehezkelShB@gmail.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/thunderbolt/switch.c')
-rw-r--r-- | drivers/thunderbolt/switch.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index c73bbfe69ba1..05a360901790 100644 --- a/drivers/thunderbolt/switch.c +++ b/drivers/thunderbolt/switch.c @@ -932,7 +932,14 @@ int tb_port_get_link_speed(struct tb_port *port) return speed == LANE_ADP_CS_1_CURRENT_SPEED_GEN3 ? 20 : 10; } -static int tb_port_get_link_width(struct tb_port *port) +/** + * tb_port_get_link_width() - Get current link width + * @port: Port to check (USB4 or CIO) + * + * Returns link width. Return values can be 1 (Single-Lane), 2 (Dual-Lane) + * or negative errno in case of failure. + */ +int tb_port_get_link_width(struct tb_port *port) { u32 val; int ret; |