summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt/switch.c
diff options
context:
space:
mode:
authorMika Westerberg2018-10-11 11:33:08 +0200
committerMika Westerberg2019-04-18 10:18:51 +0200
commite879a709de0210802ba14243a168d632cb7ab527 (patch)
tree755d8ff601ef92bc67802e9663a76ee156ba371a /drivers/thunderbolt/switch.c
parentthunderbolt: Move LC specific functionality into a separate file (diff)
downloadkernel-qcow2-linux-e879a709de0210802ba14243a168d632cb7ab527.tar.gz
kernel-qcow2-linux-e879a709de0210802ba14243a168d632cb7ab527.tar.xz
kernel-qcow2-linux-e879a709de0210802ba14243a168d632cb7ab527.zip
thunderbolt: Configure lanes when switch is initialized
Thunderbolt 2 devices and beyond need to have additional bits set in link controller specific registers. This includes two bits in LC_SX_CTRL that tell the link controller which lane is connected and whether it is upstream facing or not. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/switch.c')
-rw-r--r--drivers/thunderbolt/switch.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 63ff4c753d89..dd218dc4781b 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -1276,6 +1276,10 @@ int tb_switch_configure(struct tb_switch *sw)
if (ret)
return ret;
+ ret = tb_lc_configure_link(sw);
+ if (ret)
+ return ret;
+
return tb_plug_events_active(sw, true);
}
@@ -1486,6 +1490,7 @@ void tb_switch_remove(struct tb_switch *sw)
if (!sw->is_unplugged)
tb_plug_events_active(sw, false);
+ tb_lc_unconfigure_link(sw);
tb_switch_nvm_remove(sw);
@@ -1545,6 +1550,10 @@ int tb_switch_resume(struct tb_switch *sw)
if (err)
return err;
+ err = tb_lc_configure_link(sw);
+ if (err)
+ return err;
+
err = tb_plug_events_active(sw, true);
if (err)
return err;