• Home
  • Raw
  • Download

Lines Matching +full:sink +full:- +full:only

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()
55 if (sw->generation < 2) in tb_lc_set_port_configured()
67 if (port->port % 2) 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()
113 if (sw->generation < 2) in tb_lc_set_xdomain_configured()
125 if (port->port % 2) in tb_lc_set_xdomain_configured()
139 * tb_lc_configure_xdomain() - Inform LC that the link is XDomain
151 * tb_lc_unconfigure_xdomain() - Unconfigure XDomain from port
162 * tb_lc_start_lane_initialization() - Start lane initialization
173 struct tb_switch *sw = port->sw; in tb_lc_start_lane_initialization()
180 if (sw->generation < 2) in tb_lc_start_lane_initialization()
197 * tb_lc_is_clx_supported() - Check whether CLx is supported by the lane adapter
205 struct tb_switch *sw = port->sw; in tb_lc_is_clx_supported()
221 * tb_lc_is_usb_plugged() - Is there USB device connected to port
224 * Returns true if the @port has USB type-C device connected.
228 struct tb_switch *sw = port->sw; in tb_lc_is_usb_plugged()
232 if (sw->generation != 3) in tb_lc_is_usb_plugged()
247 * tb_lc_is_xhci_connected() - Is the internal xHCI connected
254 struct tb_switch *sw = port->sw; in tb_lc_is_xhci_connected()
258 if (sw->generation != 3) in tb_lc_is_xhci_connected()
274 struct tb_switch *sw = port->sw; in __tb_lc_xhci_connect()
278 if (sw->generation != 3) in __tb_lc_xhci_connect()
279 return -EINVAL; in __tb_lc_xhci_connect()
298 * tb_lc_xhci_connect() - Connect internal xHCI
303 * routers only.
318 * tb_lc_xhci_disconnect() - Disconnect internal xHCI
322 * for Thunderbolt 3 routers only.
361 * tb_lc_set_wake() - Enable/disable wake
372 if (sw->generation < 2) in tb_lc_set_wake()
389 unsigned int offset = sw->cap_lc + start + i * size; in tb_lc_set_wake()
400 * tb_lc_set_sleep() - Inform LC that the switch is going to sleep
411 if (sw->generation < 2) in tb_lc_set_sleep()
425 unsigned int offset = sw->cap_lc + start + i * size; in tb_lc_set_sleep()
444 * tb_lc_lane_bonding_possible() - Is lane bonding possible towards switch
456 if (sw->generation < 2) in tb_lc_lane_bonding_possible()
476 /* The first DP IN port is sink 0 and second is sink 1 */ in tb_lc_dp_sink_from_port()
482 return -EINVAL; in tb_lc_dp_sink_from_port()
485 static int tb_lc_dp_sink_available(struct tb_switch *sw, int sink) in tb_lc_dp_sink_available() argument
491 sw->cap_lc + TB_LC_SNK_ALLOCATION, 1); in tb_lc_dp_sink_available()
496 * Sink is available for CM/SW to use if the allocation valie is in tb_lc_dp_sink_available()
499 if (!sink) { in tb_lc_dp_sink_available()
510 return -EBUSY; in tb_lc_dp_sink_available()
514 * tb_lc_dp_sink_query() - Is DP sink available for DP IN port
515 * @sw: Switch whose DP sink is queried
518 * Queries through LC SNK_ALLOCATION registers whether DP sink is available
523 int sink; in tb_lc_dp_sink_query() local
526 * For older generations sink is always available as there is no in tb_lc_dp_sink_query()
529 if (sw->generation < 3) in tb_lc_dp_sink_query()
532 sink = tb_lc_dp_sink_from_port(sw, in); in tb_lc_dp_sink_query()
533 if (sink < 0) in tb_lc_dp_sink_query()
536 return !tb_lc_dp_sink_available(sw, sink); in tb_lc_dp_sink_query()
540 * tb_lc_dp_sink_alloc() - Allocate DP sink
541 * @sw: Switch whose DP sink is allocated
542 * @in: DP IN port the DP sink is allocated for
544 * Allocate DP sink for @in via LC SNK_ALLOCATION registers. If the
546 * other cases returs negative errno. In particular %-EBUSY is returned if
551 int ret, sink; in tb_lc_dp_sink_alloc() local
554 if (sw->generation < 3) in tb_lc_dp_sink_alloc()
557 sink = tb_lc_dp_sink_from_port(sw, in); in tb_lc_dp_sink_alloc()
558 if (sink < 0) in tb_lc_dp_sink_alloc()
559 return sink; in tb_lc_dp_sink_alloc()
561 ret = tb_lc_dp_sink_available(sw, sink); in tb_lc_dp_sink_alloc()
566 sw->cap_lc + TB_LC_SNK_ALLOCATION, 1); in tb_lc_dp_sink_alloc()
570 if (!sink) { in tb_lc_dp_sink_alloc()
580 sw->cap_lc + TB_LC_SNK_ALLOCATION, 1); in tb_lc_dp_sink_alloc()
585 tb_port_dbg(in, "sink %d allocated\n", sink); in tb_lc_dp_sink_alloc()
590 * tb_lc_dp_sink_dealloc() - De-allocate DP sink
591 * @sw: Switch whose DP sink is de-allocated
592 * @in: DP IN port whose DP sink is de-allocated
594 * De-allocate DP sink from @in using LC SNK_ALLOCATION registers.
598 int ret, sink; in tb_lc_dp_sink_dealloc() local
601 if (sw->generation < 3) in tb_lc_dp_sink_dealloc()
604 sink = tb_lc_dp_sink_from_port(sw, in); in tb_lc_dp_sink_dealloc()
605 if (sink < 0) in tb_lc_dp_sink_dealloc()
606 return sink; in tb_lc_dp_sink_dealloc()
609 ret = tb_lc_dp_sink_available(sw, sink); in tb_lc_dp_sink_dealloc()
614 sw->cap_lc + TB_LC_SNK_ALLOCATION, 1); in tb_lc_dp_sink_dealloc()
618 if (!sink) in tb_lc_dp_sink_dealloc()
624 sw->cap_lc + TB_LC_SNK_ALLOCATION, 1); in tb_lc_dp_sink_dealloc()
628 tb_port_dbg(in, "sink %d de-allocated\n", sink); in tb_lc_dp_sink_dealloc()
633 * tb_lc_force_power() - Forces LC to be powered on