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_by_dw(struct seq_file *s, struct tb_switch *sw, in cap_show_by_dw() argument
266 ret = tb_sw_read(sw, &data, TB_CFG_SWITCH, cap + offset + i, 1); in cap_show_by_dw()
277 static void cap_show(struct seq_file *s, struct tb_switch *sw, in cap_show() argument
291 ret = tb_sw_read(sw, data, TB_CFG_SWITCH, cap + offset, dwords); in cap_show()
293 cap_show_by_dw(s, sw, port, cap, offset, cap_id, vsec_id, length); in cap_show()
409 struct tb_switch *sw = port->sw; in port_regs_show() local
410 struct tb *tb = sw->tb; in port_regs_show()
413 pm_runtime_get_sync(&sw->dev); in port_regs_show()
431 pm_runtime_mark_last_busy(&sw->dev); in port_regs_show()
432 pm_runtime_put_autosuspend(&sw->dev); in port_regs_show()
438 static void switch_cap_show(struct tb_switch *sw, struct seq_file *s, in switch_cap_show() argument
445 ret = tb_sw_read(sw, &header, TB_CFG_SWITCH, cap, 1); in switch_cap_show()
453 ret = tb_sw_read(sw, (u32 *)&header + 1, TB_CFG_SWITCH, in switch_cap_show()
475 cap_show(s, sw, NULL, cap, header.basic.cap, vsec_id, length); in switch_cap_show()
478 static void switch_caps_show(struct tb_switch *sw, struct seq_file *s) in switch_caps_show() argument
482 cap = tb_switch_next_cap(sw, 0); in switch_caps_show()
484 switch_cap_show(sw, s, cap); in switch_caps_show()
485 cap = tb_switch_next_cap(sw, cap); in switch_caps_show()
489 static int switch_basic_regs_show(struct tb_switch *sw, struct seq_file *s) in switch_basic_regs_show() argument
496 if (tb_switch_is_usb4(sw)) in switch_basic_regs_show()
501 ret = tb_sw_read(sw, data, TB_CFG_SWITCH, 0, dwords); in switch_basic_regs_show()
513 struct tb_switch *sw = s->private; in switch_regs_show() local
514 struct tb *tb = sw->tb; in switch_regs_show()
517 pm_runtime_get_sync(&sw->dev); in switch_regs_show()
526 ret = switch_basic_regs_show(sw, s); in switch_regs_show()
530 switch_caps_show(sw, s); in switch_regs_show()
535 pm_runtime_mark_last_busy(&sw->dev); in switch_regs_show()
536 pm_runtime_put_autosuspend(&sw->dev); in switch_regs_show()
565 struct tb_switch *sw = port->sw; in path_show() local
566 struct tb *tb = sw->tb; in path_show()
569 pm_runtime_get_sync(&sw->dev); in path_show()
596 pm_runtime_mark_last_busy(&sw->dev); in path_show()
597 pm_runtime_put_autosuspend(&sw->dev); in path_show()
628 struct tb_switch *sw = port->sw; in counters_show() local
629 struct tb *tb = sw->tb; in counters_show()
632 pm_runtime_get_sync(&sw->dev); in counters_show()
650 pm_runtime_mark_last_busy(&sw->dev); in counters_show()
651 pm_runtime_put_autosuspend(&sw->dev); in counters_show()
659 * @sw: Pointer to the router
663 void tb_switch_debugfs_init(struct tb_switch *sw) in tb_switch_debugfs_init() argument
668 debugfs_dir = debugfs_create_dir(dev_name(&sw->dev), tb_debugfs_root); in tb_switch_debugfs_init()
669 sw->debugfs_dir = debugfs_dir; in tb_switch_debugfs_init()
670 debugfs_create_file("regs", DEBUGFS_MODE, debugfs_dir, sw, in tb_switch_debugfs_init()
673 tb_switch_for_each_port(sw, port) { in tb_switch_debugfs_init()
683 debugfs_dir = debugfs_create_dir(dir_name, sw->debugfs_dir); in tb_switch_debugfs_init()
696 * @sw: Pointer to the router
700 void tb_switch_debugfs_remove(struct tb_switch *sw) in tb_switch_debugfs_remove() argument
702 debugfs_remove_recursive(sw->debugfs_dir); in tb_switch_debugfs_remove()