Lines Matching +full:2 +full:- +full:lane
1 // SPDX-License-Identifier: GPL-2.0
12 * tb_lc_read_uuid() - Read switch UUID from link controller common register
18 if (!sw->cap_lc) in tb_lc_read_uuid()
19 return -EINVAL; in tb_lc_read_uuid()
20 return tb_sw_read(sw, uuid, TB_CFG_SWITCH, sw->cap_lc + TB_LC_FUSE, 4); in tb_lc_read_uuid()
25 if (!sw->cap_lc) in read_lc_desc()
26 return -EINVAL; in read_lc_desc()
27 return tb_sw_read(sw, desc, TB_CFG_SWITCH, sw->cap_lc + TB_LC_DESC, 1); in read_lc_desc()
32 struct tb_switch *sw = port->sw; in find_port_lc_cap()
43 phys = tb_phy_port_from_link(port->port); in find_port_lc_cap()
45 return sw->cap_lc + start + phys * size; in find_port_lc_cap()
51 struct tb_switch *sw = port->sw; in tb_lc_set_port_configured()
52 u32 ctrl, lane; in tb_lc_set_port_configured() local
55 if (sw->generation < 2) in tb_lc_set_port_configured()
66 /* Resolve correct lane */ in tb_lc_set_port_configured()
67 if (port->port % 2) in tb_lc_set_port_configured()
68 lane = TB_LC_SX_CTRL_L1C; in tb_lc_set_port_configured()
70 lane = TB_LC_SX_CTRL_L2C; in tb_lc_set_port_configured()
73 ctrl |= lane; in tb_lc_set_port_configured()
77 ctrl &= ~lane; in tb_lc_set_port_configured()
86 * tb_lc_configure_port() - Let LC know about configured port
97 * tb_lc_unconfigure_port() - Let LC know about unconfigured port
109 struct tb_switch *sw = port->sw; in tb_lc_set_xdomain_configured()
110 u32 ctrl, lane; in tb_lc_set_xdomain_configured() local
113 if (sw->generation < 2) in tb_lc_set_xdomain_configured()
124 /* Resolve correct lane */ in tb_lc_set_xdomain_configured()
125 if (port->port % 2) in tb_lc_set_xdomain_configured()
126 lane = TB_LC_SX_CTRL_L1D; in tb_lc_set_xdomain_configured()
128 lane = TB_LC_SX_CTRL_L2D; in tb_lc_set_xdomain_configured()
131 ctrl |= lane; in tb_lc_set_xdomain_configured()
133 ctrl &= ~lane; in tb_lc_set_xdomain_configured()
139 * tb_lc_configure_xdomain() - Inform LC that the link is XDomain
142 * Sets the lane configured for XDomain accordingly so that the LC knows
151 * tb_lc_unconfigure_xdomain() - Unconfigure XDomain from port
154 * Unsets the lane XDomain configuration.
190 * tb_lc_set_wake() - Enable/disable wake
201 if (sw->generation < 2) in tb_lc_set_wake()
218 unsigned int offset = sw->cap_lc + start + i * size; in tb_lc_set_wake()
229 * tb_lc_set_sleep() - Inform LC that the switch is going to sleep
240 if (sw->generation < 2) in tb_lc_set_sleep()
254 unsigned int offset = sw->cap_lc + start + i * size; in tb_lc_set_sleep()
273 * tb_lc_lane_bonding_possible() - Is lane bonding possible towards switch
276 * Checks whether conditions for lane bonding from parent to @sw are
285 if (sw->generation < 2) in tb_lc_lane_bonding_possible()
311 return -EINVAL; in tb_lc_dp_sink_from_port()
320 sw->cap_lc + TB_LC_SNK_ALLOCATION, 1); in tb_lc_dp_sink_available()
339 return -EBUSY; in tb_lc_dp_sink_available()
343 * tb_lc_dp_sink_query() - Is DP sink available for DP IN port
358 if (sw->generation < 3) in tb_lc_dp_sink_query()
369 * tb_lc_dp_sink_alloc() - Allocate DP sink
375 * other cases returs negative errno. In particular %-EBUSY is returned if
383 if (sw->generation < 3) in tb_lc_dp_sink_alloc()
395 sw->cap_lc + TB_LC_SNK_ALLOCATION, 1); in tb_lc_dp_sink_alloc()
409 sw->cap_lc + TB_LC_SNK_ALLOCATION, 1); in tb_lc_dp_sink_alloc()
419 * tb_lc_dp_sink_dealloc() - De-allocate DP sink
420 * @sw: Switch whose DP sink is de-allocated
421 * @in: DP IN port whose DP sink is de-allocated
423 * De-allocate DP sink from @in using LC SNK_ALLOCATION registers.
430 if (sw->generation < 3) in tb_lc_dp_sink_dealloc()
443 sw->cap_lc + TB_LC_SNK_ALLOCATION, 1); in tb_lc_dp_sink_dealloc()
453 sw->cap_lc + TB_LC_SNK_ALLOCATION, 1); in tb_lc_dp_sink_dealloc()
457 tb_port_dbg(in, "sink %d de-allocated\n", sink); in tb_lc_dp_sink_dealloc()
462 * tb_lc_force_power() - Forces LC to be powered on