Lines Matching full:sw

123 static ssize_t regs_write(struct tb_switch *sw, struct tb_port *port,  in regs_write()  argument
127 struct tb *tb = sw->tb; in regs_write()
136 pm_runtime_get_sync(&sw->dev); in regs_write()
151 ret = tb_sw_write(sw, &val, TB_CFG_SWITCH, offset, 1); in regs_write()
159 pm_runtime_mark_last_busy(&sw->dev); in regs_write()
160 pm_runtime_put_autosuspend(&sw->dev); in regs_write()
172 return regs_write(port->sw, port, user_buf, count, ppos); in port_regs_write()
179 struct tb_switch *sw = s->private; in switch_regs_write() local
181 return regs_write(sw, NULL, user_buf, count, ppos); in switch_regs_write()
212 struct tb_switch *sw = port->sw; in counters_write() local
213 struct tb *tb = port->sw->tb; in counters_write()
221 pm_runtime_get_sync(&sw->dev); in counters_write()
247 pm_runtime_mark_last_busy(&sw->dev); in counters_write()
248 pm_runtime_put_autosuspend(&sw->dev); in counters_write()
254 static void cap_show(struct seq_file *s, struct tb_switch *sw, in cap_show() argument
268 ret = tb_sw_read(sw, data, TB_CFG_SWITCH, cap + offset, dwords); in cap_show()
350 (tb_switch_is_ice_lake(port->sw) || in port_cap_show()
351 tb_switch_is_tiger_lake(port->sw))) in port_cap_show()
398 struct tb_switch *sw = port->sw; in port_regs_show() local
399 struct tb *tb = sw->tb; in port_regs_show()
402 pm_runtime_get_sync(&sw->dev); in port_regs_show()
420 pm_runtime_mark_last_busy(&sw->dev); in port_regs_show()
421 pm_runtime_put_autosuspend(&sw->dev); in port_regs_show()
427 static void switch_cap_show(struct tb_switch *sw, struct seq_file *s, in switch_cap_show() argument
434 ret = tb_sw_read(sw, &header, TB_CFG_SWITCH, cap, 1); in switch_cap_show()
442 ret = tb_sw_read(sw, (u32 *)&header + 1, TB_CFG_SWITCH, in switch_cap_show()
464 cap_show(s, sw, NULL, cap, header.basic.cap, vsec_id, length); in switch_cap_show()
467 static void switch_caps_show(struct tb_switch *sw, struct seq_file *s) in switch_caps_show() argument
471 cap = tb_switch_next_cap(sw, 0); in switch_caps_show()
473 switch_cap_show(sw, s, cap); in switch_caps_show()
474 cap = tb_switch_next_cap(sw, cap); in switch_caps_show()
478 static int switch_basic_regs_show(struct tb_switch *sw, struct seq_file *s) in switch_basic_regs_show() argument
485 if (tb_switch_is_usb4(sw)) in switch_basic_regs_show()
490 ret = tb_sw_read(sw, data, TB_CFG_SWITCH, 0, dwords); in switch_basic_regs_show()
502 struct tb_switch *sw = s->private; in switch_regs_show() local
503 struct tb *tb = sw->tb; in switch_regs_show()
506 pm_runtime_get_sync(&sw->dev); in switch_regs_show()
515 ret = switch_basic_regs_show(sw, s); in switch_regs_show()
519 switch_caps_show(sw, s); in switch_regs_show()
524 pm_runtime_mark_last_busy(&sw->dev); in switch_regs_show()
525 pm_runtime_put_autosuspend(&sw->dev); in switch_regs_show()
554 struct tb_switch *sw = port->sw; in path_show() local
555 struct tb *tb = sw->tb; in path_show()
558 pm_runtime_get_sync(&sw->dev); in path_show()
585 pm_runtime_mark_last_busy(&sw->dev); in path_show()
586 pm_runtime_put_autosuspend(&sw->dev); in path_show()
617 struct tb_switch *sw = port->sw; in counters_show() local
618 struct tb *tb = sw->tb; in counters_show()
621 pm_runtime_get_sync(&sw->dev); in counters_show()
639 pm_runtime_mark_last_busy(&sw->dev); in counters_show()
640 pm_runtime_put_autosuspend(&sw->dev); in counters_show()
648 * @sw: Pointer to the router
652 void tb_switch_debugfs_init(struct tb_switch *sw) in tb_switch_debugfs_init() argument
657 debugfs_dir = debugfs_create_dir(dev_name(&sw->dev), tb_debugfs_root); in tb_switch_debugfs_init()
658 sw->debugfs_dir = debugfs_dir; in tb_switch_debugfs_init()
659 debugfs_create_file("regs", DEBUGFS_MODE, debugfs_dir, sw, in tb_switch_debugfs_init()
662 tb_switch_for_each_port(sw, port) { in tb_switch_debugfs_init()
672 debugfs_dir = debugfs_create_dir(dir_name, sw->debugfs_dir); in tb_switch_debugfs_init()
685 * @sw: Pointer to the router
689 void tb_switch_debugfs_remove(struct tb_switch *sw) in tb_switch_debugfs_remove() argument
691 debugfs_remove_recursive(sw->debugfs_dir); in tb_switch_debugfs_remove()