diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2023-03-21 10:02:55 +0200 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2024-06-17 12:47:12 +0300 |
commit | 0890fc36c70c8d5e80dc128c3a9d7a9122646869 (patch) | |
tree | f89411d1ff9845d01891a9ed453e2167f8c09aae /drivers/thunderbolt/debugfs.c | |
parent | ec6f888ed08aeceaebfdd7d344ae0cd91a1b9a1b (diff) | |
download | lwn-0890fc36c70c8d5e80dc128c3a9d7a9122646869.tar.gz lwn-0890fc36c70c8d5e80dc128c3a9d7a9122646869.zip |
thunderbolt: Make margining functions accept target and retimer index
In order to add lane margining support for retimers make the margining
functions take sideband target and retimer index as parameters. This
makes it possible to access both router and retimer sideband using the
same functions.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/debugfs.c')
-rw-r--r-- | drivers/thunderbolt/debugfs.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/thunderbolt/debugfs.c b/drivers/thunderbolt/debugfs.c index 0e871c7ae9c0..87b2c91a4656 100644 --- a/drivers/thunderbolt/debugfs.c +++ b/drivers/thunderbolt/debugfs.c @@ -774,22 +774,25 @@ static int margining_run_write(void *data, u64 val) if (margining->software) { tb_port_dbg(port, "running software %s lane margining for lanes %u\n", margining->time ? "time" : "voltage", margining->lanes); - ret = usb4_port_sw_margin(port, margining->lanes, margining->time, + ret = usb4_port_sw_margin(port, USB4_SB_TARGET_ROUTER, 0, + margining->lanes, margining->time, margining->right_high, USB4_MARGIN_SW_COUNTER_CLEAR); if (ret) goto out_clx; - ret = usb4_port_sw_margin_errors(port, &margining->results[0]); + ret = usb4_port_sw_margin_errors(port, USB4_SB_TARGET_ROUTER, 0, + &margining->results[0]); } else { tb_port_dbg(port, "running hardware %s lane margining for lanes %u\n", margining->time ? "time" : "voltage", margining->lanes); /* Clear the results */ margining->results[0] = 0; margining->results[1] = 0; - ret = usb4_port_hw_margin(port, margining->lanes, - margining->ber_level, margining->time, - margining->right_high, margining->results); + ret = usb4_port_hw_margin(port, USB4_SB_TARGET_ROUTER, 0, + margining->lanes, margining->ber_level, + margining->time, margining->right_high, + margining->results); } out_clx: @@ -1063,7 +1066,8 @@ static void margining_port_init(struct tb_port *port) margining->port = port; - ret = usb4_port_margining_caps(port, margining->caps); + ret = usb4_port_margining_caps(port, USB4_SB_TARGET_ROUTER, 0, + margining->caps); if (ret) { kfree(margining); return; |