Lines Matching full:sw

221 static ssize_t regs_write(struct tb_switch *sw, struct tb_port *port,  in regs_write()  argument
226 struct tb *tb = sw->tb; in regs_write()
234 pm_runtime_get_sync(&sw->dev); in regs_write()
257 ret = tb_sw_write(sw, &val, TB_CFG_SWITCH, offset, 1); in regs_write()
266 pm_runtime_mark_last_busy(&sw->dev); in regs_write()
267 pm_runtime_put_autosuspend(&sw->dev); in regs_write()
279 return regs_write(port->sw, port, TB_CFG_PORT, user_buf, count, ppos); in port_regs_write()
288 return regs_write(port->sw, port, TB_CFG_HOPS, user_buf, count, ppos); in path_write()
295 struct tb_switch *sw = s->private; in switch_regs_write() local
297 return regs_write(sw, NULL, TB_CFG_SWITCH, user_buf, count, ppos); in switch_regs_write()
386 struct tb_switch *sw = port->sw; in port_sb_regs_write() local
387 struct tb *tb = sw->tb; in port_sb_regs_write()
395 pm_runtime_get_sync(&sw->dev); in port_sb_regs_write()
407 pm_runtime_mark_last_busy(&sw->dev); in port_sb_regs_write()
408 pm_runtime_put_autosuspend(&sw->dev); in port_sb_regs_write()
621 struct tb *tb = margining->port->sw->tb; in margining_ber_level_write()
684 struct tb *tb = margining->port->sw->tb; in margining_caps_show()
815 struct tb *tb = port->sw->tb; in margining_lanes_write()
857 struct tb *tb = port->sw->tb; in margining_lanes_show()
890 struct tb *tb = margining->port->sw->tb; in margining_voltage_time_offset_write()
921 struct tb *tb = margining->port->sw->tb; in margining_voltage_time_offset_show()
941 struct tb *tb = margining->port->sw->tb; in margining_error_counter_write()
974 struct tb *tb = margining->port->sw->tb; in margining_error_counter_show()
1006 struct tb *tb = margining->port->sw->tb; in margining_dwell_time_write()
1027 struct tb *tb = margining->port->sw->tb; in margining_dwell_time_show()
1046 struct tb *tb = margining->port->sw->tb; in margining_optional_voltage_offset_write()
1065 struct tb *tb = margining->port->sw->tb; in margining_optional_voltage_offset_show()
1081 struct tb *tb = margining->port->sw->tb; in margining_mode_write()
1120 struct tb *tb = margining->port->sw->tb; in margining_mode_show()
1225 struct tb_switch *sw = port->sw; in margining_run_write() local
1227 struct tb *tb = sw->tb; in margining_run_write()
1245 down_sw = sw; in margining_run_write()
1247 down_sw = port->remote->sw; in margining_run_write()
1322 struct tb *tb = margining->port->sw->tb; in margining_results_write()
1413 struct tb *tb = margining->port->sw->tb; in margining_results_show()
1475 struct tb *tb = margining->port->sw->tb; in margining_test_write()
1507 struct tb *tb = margining->port->sw->tb; in margining_test_show()
1532 struct tb *tb = margining->port->sw->tb; in margining_margin_write()
1573 struct tb *tb = margining->port->sw->tb; in margining_margin_show()
1602 struct tb *tb = port->sw->tb; in margining_eye_write()
1629 struct tb *tb = port->sw->tb; in margining_eye_show()
1770 parent = debugfs_lookup(dir_name, port->sw->debugfs_dir); in margining_port_init()
1785 parent = debugfs_lookup(dir_name, port->sw->debugfs_dir); in margining_port_remove()
1793 static void margining_switch_init(struct tb_switch *sw) in margining_switch_init() argument
1797 u64 route = tb_route(sw); in margining_switch_init()
1802 upstream = tb_upstream_port(sw); in margining_switch_init()
1803 parent_sw = tb_switch_parent(sw); in margining_switch_init()
1810 static void margining_switch_remove(struct tb_switch *sw) in margining_switch_remove() argument
1814 u64 route = tb_route(sw); in margining_switch_remove()
1819 upstream = tb_upstream_port(sw); in margining_switch_remove()
1820 parent_sw = tb_switch_parent(sw); in margining_switch_remove()
1861 static inline void margining_switch_init(struct tb_switch *sw) { } in margining_switch_init() argument
1862 static inline void margining_switch_remove(struct tb_switch *sw) { } in margining_switch_remove() argument
1892 struct tb_switch *sw = port->sw; in counters_write() local
1893 struct tb *tb = port->sw->tb; in counters_write()
1901 pm_runtime_get_sync(&sw->dev); in counters_write()
1927 pm_runtime_mark_last_busy(&sw->dev); in counters_write()
1928 pm_runtime_put_autosuspend(&sw->dev); in counters_write()
1934 static void cap_show_by_dw(struct seq_file *s, struct tb_switch *sw, in cap_show_by_dw() argument
1946 ret = tb_sw_read(sw, &data, TB_CFG_SWITCH, cap + offset + i, 1); in cap_show_by_dw()
1957 static void cap_show(struct seq_file *s, struct tb_switch *sw, in cap_show() argument
1971 ret = tb_sw_read(sw, data, TB_CFG_SWITCH, cap + offset, dwords); in cap_show()
1973 cap_show_by_dw(s, sw, port, cap, offset, cap_id, vsec_id, length); in cap_show()
2008 if (usb4_switch_version(port->sw) < 2) in port_cap_show()
2020 if (usb4_switch_version(port->sw) < 2) in port_cap_show()
2025 if (usb4_switch_version(port->sw) < 2) in port_cap_show()
2100 struct tb_switch *sw = port->sw; in port_regs_show() local
2101 struct tb *tb = sw->tb; in port_regs_show()
2104 pm_runtime_get_sync(&sw->dev); in port_regs_show()
2122 pm_runtime_mark_last_busy(&sw->dev); in port_regs_show()
2123 pm_runtime_put_autosuspend(&sw->dev); in port_regs_show()
2129 static void switch_cap_show(struct tb_switch *sw, struct seq_file *s, in switch_cap_show() argument
2136 ret = tb_sw_read(sw, &header, TB_CFG_SWITCH, cap, 1); in switch_cap_show()
2144 ret = tb_sw_read(sw, (u32 *)&header + 1, TB_CFG_SWITCH, in switch_cap_show()
2166 cap_show(s, sw, NULL, cap, header.basic.cap, vsec_id, length); in switch_cap_show()
2169 static void switch_caps_show(struct tb_switch *sw, struct seq_file *s) in switch_caps_show() argument
2173 cap = tb_switch_next_cap(sw, 0); in switch_caps_show()
2175 switch_cap_show(sw, s, cap); in switch_caps_show()
2176 cap = tb_switch_next_cap(sw, cap); in switch_caps_show()
2180 static int switch_basic_regs_show(struct tb_switch *sw, struct seq_file *s) in switch_basic_regs_show() argument
2187 if (tb_switch_is_usb4(sw)) in switch_basic_regs_show()
2192 ret = tb_sw_read(sw, data, TB_CFG_SWITCH, 0, dwords); in switch_basic_regs_show()
2204 struct tb_switch *sw = s->private; in switch_regs_show() local
2205 struct tb *tb = sw->tb; in switch_regs_show()
2208 pm_runtime_get_sync(&sw->dev); in switch_regs_show()
2217 ret = switch_basic_regs_show(sw, s); in switch_regs_show()
2221 switch_caps_show(sw, s); in switch_regs_show()
2226 pm_runtime_mark_last_busy(&sw->dev); in switch_regs_show()
2227 pm_runtime_put_autosuspend(&sw->dev); in switch_regs_show()
2256 struct tb_switch *sw = port->sw; in path_show() local
2257 struct tb *tb = sw->tb; in path_show()
2260 pm_runtime_get_sync(&sw->dev); in path_show()
2287 pm_runtime_mark_last_busy(&sw->dev); in path_show()
2288 pm_runtime_put_autosuspend(&sw->dev); in path_show()
2319 struct tb_switch *sw = port->sw; in counters_show() local
2320 struct tb *tb = sw->tb; in counters_show()
2323 pm_runtime_get_sync(&sw->dev); in counters_show()
2341 pm_runtime_mark_last_busy(&sw->dev); in counters_show()
2342 pm_runtime_put_autosuspend(&sw->dev); in counters_show()
2379 struct tb_switch *sw = port->sw; in port_sb_regs_show() local
2380 struct tb *tb = sw->tb; in port_sb_regs_show()
2383 pm_runtime_get_sync(&sw->dev); in port_sb_regs_show()
2395 pm_runtime_mark_last_busy(&sw->dev); in port_sb_regs_show()
2396 pm_runtime_put_autosuspend(&sw->dev); in port_sb_regs_show()
2404 * @sw: Pointer to the router
2408 void tb_switch_debugfs_init(struct tb_switch *sw) in tb_switch_debugfs_init() argument
2413 debugfs_dir = debugfs_create_dir(dev_name(&sw->dev), tb_debugfs_root); in tb_switch_debugfs_init()
2414 sw->debugfs_dir = debugfs_dir; in tb_switch_debugfs_init()
2415 debugfs_create_file("regs", DEBUGFS_MODE, debugfs_dir, sw, in tb_switch_debugfs_init()
2417 if (sw->drom) in tb_switch_debugfs_init()
2418 debugfs_create_blob("drom", 0400, debugfs_dir, &sw->drom_blob); in tb_switch_debugfs_init()
2420 tb_switch_for_each_port(sw, port) { in tb_switch_debugfs_init()
2430 debugfs_dir = debugfs_create_dir(dir_name, sw->debugfs_dir); in tb_switch_debugfs_init()
2443 margining_switch_init(sw); in tb_switch_debugfs_init()
2448 * @sw: Pointer to the router
2452 void tb_switch_debugfs_remove(struct tb_switch *sw) in tb_switch_debugfs_remove() argument
2454 margining_switch_remove(sw); in tb_switch_debugfs_remove()
2455 debugfs_remove_recursive(sw->debugfs_dir); in tb_switch_debugfs_remove()