Lines Matching refs:m_rt
262 static int sdw_program_port_params(struct sdw_master_runtime *m_rt) in sdw_program_port_params() argument
265 struct sdw_bus *bus = m_rt->bus; in sdw_program_port_params()
270 list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) { in sdw_program_port_params()
279 list_for_each_entry(p_rt, &m_rt->port_list, port_node) { in sdw_program_port_params()
330 static int sdw_enable_disable_master_ports(struct sdw_master_runtime *m_rt, in sdw_enable_disable_master_ports() argument
335 struct sdw_bus *bus = m_rt->bus; in sdw_enable_disable_master_ports()
371 static int sdw_enable_disable_ports(struct sdw_master_runtime *m_rt, bool en) in sdw_enable_disable_ports() argument
378 list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) { in sdw_enable_disable_ports()
380 ret = sdw_enable_disable_slave_ports(m_rt->bus, s_rt, in sdw_enable_disable_ports()
388 list_for_each_entry(m_port, &m_rt->port_list, port_node) { in sdw_enable_disable_ports()
389 ret = sdw_enable_disable_master_ports(m_rt, m_port, en); in sdw_enable_disable_ports()
505 static int sdw_prep_deprep_master_ports(struct sdw_master_runtime *m_rt, in sdw_prep_deprep_master_ports() argument
510 struct sdw_bus *bus = m_rt->bus; in sdw_prep_deprep_master_ports()
540 static int sdw_prep_deprep_ports(struct sdw_master_runtime *m_rt, bool prep) in sdw_prep_deprep_ports() argument
547 list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) { in sdw_prep_deprep_ports()
549 ret = sdw_prep_deprep_slave_ports(m_rt->bus, s_rt, in sdw_prep_deprep_ports()
557 list_for_each_entry(p_rt, &m_rt->port_list, port_node) { in sdw_prep_deprep_ports()
558 ret = sdw_prep_deprep_master_ports(m_rt, p_rt, prep); in sdw_prep_deprep_ports()
574 static int sdw_notify_config(struct sdw_master_runtime *m_rt) in sdw_notify_config() argument
577 struct sdw_bus *bus = m_rt->bus; in sdw_notify_config()
587 list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) { in sdw_notify_config()
612 struct sdw_master_runtime *m_rt; in sdw_program_params() local
615 list_for_each_entry(m_rt, &bus->m_rt_list, bus_node) { in sdw_program_params()
624 m_rt->stream->state == SDW_STREAM_CONFIGURED) in sdw_program_params()
627 ret = sdw_program_port_params(m_rt); in sdw_program_params()
634 ret = sdw_notify_config(m_rt); in sdw_program_params()
642 if (m_rt->stream->state != SDW_STREAM_ENABLED) in sdw_program_params()
645 ret = sdw_enable_disable_ports(m_rt, true); in sdw_program_params()
760 struct sdw_master_runtime *m_rt; in do_bank_switch() local
769 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in do_bank_switch()
770 bus = m_rt->bus; in do_bank_switch()
807 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in do_bank_switch()
808 bus = m_rt->bus; in do_bank_switch()
845 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in do_bank_switch()
846 bus = m_rt->bus; in do_bank_switch()
856 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in do_bank_switch()
857 bus = m_rt->bus; in do_bank_switch()
909 struct sdw_master_runtime *m_rt; in sdw_find_master_rt() local
912 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in sdw_find_master_rt()
913 if (m_rt->bus == bus) in sdw_find_master_rt()
914 return m_rt; in sdw_find_master_rt()
934 struct sdw_master_runtime *m_rt; in sdw_alloc_master_rt() local
940 m_rt = sdw_find_master_rt(bus, stream); in sdw_alloc_master_rt()
941 if (m_rt) in sdw_alloc_master_rt()
944 m_rt = kzalloc(sizeof(*m_rt), GFP_KERNEL); in sdw_alloc_master_rt()
945 if (!m_rt) in sdw_alloc_master_rt()
949 INIT_LIST_HEAD(&m_rt->port_list); in sdw_alloc_master_rt()
950 INIT_LIST_HEAD(&m_rt->slave_rt_list); in sdw_alloc_master_rt()
951 list_add_tail(&m_rt->stream_node, &stream->master_list); in sdw_alloc_master_rt()
953 list_add_tail(&m_rt->bus_node, &bus->m_rt_list); in sdw_alloc_master_rt()
956 m_rt->ch_count = stream_config->ch_count; in sdw_alloc_master_rt()
957 m_rt->bus = bus; in sdw_alloc_master_rt()
958 m_rt->stream = stream; in sdw_alloc_master_rt()
959 m_rt->direction = stream_config->direction; in sdw_alloc_master_rt()
961 return m_rt; in sdw_alloc_master_rt()
993 struct sdw_master_runtime *m_rt) in sdw_master_port_release() argument
997 list_for_each_entry_safe(p_rt, _p_rt, &m_rt->port_list, port_node) { in sdw_master_port_release()
1008 struct sdw_master_runtime *m_rt; in sdw_slave_port_release() local
1011 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in sdw_slave_port_release()
1012 list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) { in sdw_slave_port_release()
1037 struct sdw_master_runtime *m_rt; in sdw_release_slave_stream() local
1039 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in sdw_release_slave_stream()
1042 &m_rt->slave_rt_list, m_rt_node) { in sdw_release_slave_stream()
1063 static void sdw_release_master_stream(struct sdw_master_runtime *m_rt, in sdw_release_master_stream() argument
1068 list_for_each_entry_safe(s_rt, _s_rt, &m_rt->slave_rt_list, m_rt_node) { in sdw_release_master_stream()
1073 list_del(&m_rt->stream_node); in sdw_release_master_stream()
1074 list_del(&m_rt->bus_node); in sdw_release_master_stream()
1075 kfree(m_rt); in sdw_release_master_stream()
1089 struct sdw_master_runtime *m_rt, *_m_rt; in sdw_stream_remove_master() local
1093 list_for_each_entry_safe(m_rt, _m_rt, in sdw_stream_remove_master()
1095 if (m_rt->bus != bus) in sdw_stream_remove_master()
1098 sdw_master_port_release(bus, m_rt); in sdw_stream_remove_master()
1099 sdw_release_master_stream(m_rt, stream); in sdw_stream_remove_master()
1210 struct sdw_master_runtime *m_rt, in sdw_master_port_config() argument
1228 list_add_tail(&p_rt->port_node, &m_rt->port_list); in sdw_master_port_config()
1284 struct sdw_master_runtime *m_rt; in sdw_stream_add_master() local
1301 m_rt = sdw_alloc_master_rt(bus, stream_config, stream); in sdw_stream_add_master()
1302 if (!m_rt) { in sdw_stream_add_master()
1314 ret = sdw_master_port_config(bus, m_rt, port_config, num_ports); in sdw_stream_add_master()
1323 sdw_release_master_stream(m_rt, stream); in sdw_stream_add_master()
1350 struct sdw_master_runtime *m_rt; in sdw_stream_add_slave() local
1359 m_rt = sdw_alloc_master_rt(slave->bus, stream_config, stream); in sdw_stream_add_slave()
1360 if (!m_rt) { in sdw_stream_add_slave()
1381 list_add_tail(&s_rt->m_rt_node, &m_rt->slave_rt_list); in sdw_stream_add_slave()
1401 sdw_release_master_stream(m_rt, stream); in sdw_stream_add_slave()
1451 struct sdw_master_runtime *m_rt; in sdw_acquire_bus_lock() local
1455 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in sdw_acquire_bus_lock()
1456 bus = m_rt->bus; in sdw_acquire_bus_lock()
1473 struct sdw_master_runtime *m_rt = NULL; in sdw_release_bus_lock() local
1477 list_for_each_entry_reverse(m_rt, &stream->master_list, stream_node) { in sdw_release_bus_lock()
1478 bus = m_rt->bus; in sdw_release_bus_lock()
1486 struct sdw_master_runtime *m_rt; in _sdw_prepare_stream() local
1493 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in _sdw_prepare_stream()
1494 bus = m_rt->bus; in _sdw_prepare_stream()
1509 bus->params.bandwidth += m_rt->stream->params.rate * in _sdw_prepare_stream()
1510 m_rt->ch_count * m_rt->stream->params.bps; in _sdw_prepare_stream()
1542 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in _sdw_prepare_stream()
1543 bus = m_rt->bus; in _sdw_prepare_stream()
1546 ret = sdw_prep_deprep_ports(m_rt, true); in _sdw_prepare_stream()
1615 struct sdw_master_runtime *m_rt; in _sdw_enable_stream() local
1620 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in _sdw_enable_stream()
1621 bus = m_rt->bus; in _sdw_enable_stream()
1631 ret = sdw_enable_disable_ports(m_rt, true); in _sdw_enable_stream()
1690 struct sdw_master_runtime *m_rt; in _sdw_disable_stream() local
1693 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in _sdw_disable_stream()
1694 struct sdw_bus *bus = m_rt->bus; in _sdw_disable_stream()
1697 ret = sdw_enable_disable_ports(m_rt, false); in _sdw_disable_stream()
1705 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in _sdw_disable_stream()
1706 struct sdw_bus *bus = m_rt->bus; in _sdw_disable_stream()
1723 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in _sdw_disable_stream()
1724 struct sdw_bus *bus = m_rt->bus; in _sdw_disable_stream()
1727 ret = sdw_enable_disable_ports(m_rt, false); in _sdw_disable_stream()
1772 struct sdw_master_runtime *m_rt; in _sdw_deprepare_stream() local
1776 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in _sdw_deprepare_stream()
1777 bus = m_rt->bus; in _sdw_deprepare_stream()
1779 ret = sdw_prep_deprep_ports(m_rt, false); in _sdw_deprepare_stream()
1787 bus->params.bandwidth -= m_rt->stream->params.rate * in _sdw_deprepare_stream()
1788 m_rt->ch_count * m_rt->stream->params.bps; in _sdw_deprepare_stream()