Lines Matching refs:m_rt
266 static int sdw_program_port_params(struct sdw_master_runtime *m_rt) in sdw_program_port_params() argument
269 struct sdw_bus *bus = m_rt->bus; in sdw_program_port_params()
274 list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) { in sdw_program_port_params()
283 list_for_each_entry(p_rt, &m_rt->port_list, port_node) { in sdw_program_port_params()
334 static int sdw_enable_disable_master_ports(struct sdw_master_runtime *m_rt, in sdw_enable_disable_master_ports() argument
339 struct sdw_bus *bus = m_rt->bus; in sdw_enable_disable_master_ports()
375 static int sdw_enable_disable_ports(struct sdw_master_runtime *m_rt, bool en) in sdw_enable_disable_ports() argument
382 list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) { in sdw_enable_disable_ports()
384 ret = sdw_enable_disable_slave_ports(m_rt->bus, s_rt, in sdw_enable_disable_ports()
392 list_for_each_entry(m_port, &m_rt->port_list, port_node) { in sdw_enable_disable_ports()
393 ret = sdw_enable_disable_master_ports(m_rt, m_port, en); in sdw_enable_disable_ports()
514 static int sdw_prep_deprep_master_ports(struct sdw_master_runtime *m_rt, in sdw_prep_deprep_master_ports() argument
519 struct sdw_bus *bus = m_rt->bus; in sdw_prep_deprep_master_ports()
549 static int sdw_prep_deprep_ports(struct sdw_master_runtime *m_rt, bool prep) in sdw_prep_deprep_ports() argument
556 list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) { in sdw_prep_deprep_ports()
558 ret = sdw_prep_deprep_slave_ports(m_rt->bus, s_rt, in sdw_prep_deprep_ports()
566 list_for_each_entry(p_rt, &m_rt->port_list, port_node) { in sdw_prep_deprep_ports()
567 ret = sdw_prep_deprep_master_ports(m_rt, p_rt, prep); in sdw_prep_deprep_ports()
583 static int sdw_notify_config(struct sdw_master_runtime *m_rt) in sdw_notify_config() argument
586 struct sdw_bus *bus = m_rt->bus; in sdw_notify_config()
596 list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) { in sdw_notify_config()
631 struct sdw_master_runtime *m_rt; in sdw_program_params() local
634 list_for_each_entry(m_rt, &bus->m_rt_list, bus_node) { in sdw_program_params()
643 m_rt->stream->state == SDW_STREAM_CONFIGURED) in sdw_program_params()
646 ret = sdw_program_port_params(m_rt); in sdw_program_params()
653 ret = sdw_notify_config(m_rt); in sdw_program_params()
661 if (m_rt->stream->state != SDW_STREAM_ENABLED) in sdw_program_params()
664 ret = sdw_enable_disable_ports(m_rt, true); in sdw_program_params()
778 struct sdw_master_runtime *m_rt; in do_bank_switch() local
787 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in do_bank_switch()
788 bus = m_rt->bus; in do_bank_switch()
825 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in do_bank_switch()
826 bus = m_rt->bus; in do_bank_switch()
864 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in do_bank_switch()
865 bus = m_rt->bus; in do_bank_switch()
876 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in do_bank_switch()
877 bus = m_rt->bus; in do_bank_switch()
928 struct sdw_master_runtime *m_rt; in sdw_slave_port_free() local
931 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in sdw_slave_port_free()
932 list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) { in sdw_slave_port_free()
998 static bool sdw_master_port_allocated(struct sdw_master_runtime *m_rt) in sdw_master_port_allocated() argument
1000 return !list_empty(&m_rt->port_list); in sdw_master_port_allocated()
1003 static void sdw_master_port_free(struct sdw_master_runtime *m_rt) in sdw_master_port_free() argument
1007 list_for_each_entry_safe(p_rt, _p_rt, &m_rt->port_list, port_node) { in sdw_master_port_free()
1012 static int sdw_master_port_alloc(struct sdw_master_runtime *m_rt, in sdw_master_port_alloc() argument
1020 p_rt = sdw_port_alloc(&m_rt->port_list); in sdw_master_port_alloc()
1028 static int sdw_master_port_config(struct sdw_master_runtime *m_rt, in sdw_master_port_config() argument
1036 list_for_each_entry(p_rt, &m_rt->port_list, port_node) { in sdw_master_port_config()
1056 struct sdw_master_runtime *m_rt) in sdw_slave_rt_alloc() argument
1067 list_add_tail(&s_rt->m_rt_node, &m_rt->slave_rt_list); in sdw_slave_rt_alloc()
1093 struct sdw_master_runtime *m_rt; in sdw_slave_rt_find() local
1095 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in sdw_slave_rt_find()
1098 &m_rt->slave_rt_list, m_rt_node) { in sdw_slave_rt_find()
1130 struct sdw_master_runtime *m_rt; in sdw_master_rt_find() local
1133 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in sdw_master_rt_find()
1134 if (m_rt->bus == bus) in sdw_master_rt_find()
1135 return m_rt; in sdw_master_rt_find()
1153 struct sdw_master_runtime *m_rt, *walk_m_rt; in sdw_master_rt_alloc() local
1156 m_rt = kzalloc(sizeof(*m_rt), GFP_KERNEL); in sdw_master_rt_alloc()
1157 if (!m_rt) in sdw_master_rt_alloc()
1161 INIT_LIST_HEAD(&m_rt->port_list); in sdw_master_rt_alloc()
1162 INIT_LIST_HEAD(&m_rt->slave_rt_list); in sdw_master_rt_alloc()
1176 list_add(&m_rt->stream_node, insert_after); in sdw_master_rt_alloc()
1178 list_add_tail(&m_rt->bus_node, &bus->m_rt_list); in sdw_master_rt_alloc()
1180 m_rt->bus = bus; in sdw_master_rt_alloc()
1181 m_rt->stream = stream; in sdw_master_rt_alloc()
1183 return m_rt; in sdw_master_rt_alloc()
1195 static int sdw_master_rt_config(struct sdw_master_runtime *m_rt, in sdw_master_rt_config() argument
1198 m_rt->ch_count = stream_config->ch_count; in sdw_master_rt_config()
1199 m_rt->direction = stream_config->direction; in sdw_master_rt_config()
1215 static void sdw_master_rt_free(struct sdw_master_runtime *m_rt, in sdw_master_rt_free() argument
1220 list_for_each_entry_safe(s_rt, _s_rt, &m_rt->slave_rt_list, m_rt_node) { in sdw_master_rt_free()
1225 list_del(&m_rt->stream_node); in sdw_master_rt_free()
1226 list_del(&m_rt->bus_node); in sdw_master_rt_free()
1227 kfree(m_rt); in sdw_master_rt_free()
1319 struct sdw_master_runtime *m_rt; in sdw_acquire_bus_lock() local
1323 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in sdw_acquire_bus_lock()
1324 bus = m_rt->bus; in sdw_acquire_bus_lock()
1341 struct sdw_master_runtime *m_rt; in sdw_release_bus_lock() local
1345 list_for_each_entry_reverse(m_rt, &stream->master_list, stream_node) { in sdw_release_bus_lock()
1346 bus = m_rt->bus; in sdw_release_bus_lock()
1354 struct sdw_master_runtime *m_rt; in _sdw_prepare_stream() local
1361 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in _sdw_prepare_stream()
1362 bus = m_rt->bus; in _sdw_prepare_stream()
1375 bus->params.bandwidth += m_rt->stream->params.rate * in _sdw_prepare_stream()
1376 m_rt->ch_count * m_rt->stream->params.bps; in _sdw_prepare_stream()
1403 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in _sdw_prepare_stream()
1404 bus = m_rt->bus; in _sdw_prepare_stream()
1407 ret = sdw_prep_deprep_ports(m_rt, true); in _sdw_prepare_stream()
1476 struct sdw_master_runtime *m_rt; in _sdw_enable_stream() local
1481 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in _sdw_enable_stream()
1482 bus = m_rt->bus; in _sdw_enable_stream()
1492 ret = sdw_enable_disable_ports(m_rt, true); in _sdw_enable_stream()
1551 struct sdw_master_runtime *m_rt; in _sdw_disable_stream() local
1554 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in _sdw_disable_stream()
1555 struct sdw_bus *bus = m_rt->bus; in _sdw_disable_stream()
1558 ret = sdw_enable_disable_ports(m_rt, false); in _sdw_disable_stream()
1566 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in _sdw_disable_stream()
1567 struct sdw_bus *bus = m_rt->bus; in _sdw_disable_stream()
1584 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in _sdw_disable_stream()
1585 struct sdw_bus *bus = m_rt->bus; in _sdw_disable_stream()
1588 ret = sdw_enable_disable_ports(m_rt, false); in _sdw_disable_stream()
1638 struct sdw_master_runtime *m_rt; in _sdw_deprepare_stream() local
1642 list_for_each_entry(m_rt, &stream->master_list, stream_node) { in _sdw_deprepare_stream()
1643 bus = m_rt->bus; in _sdw_deprepare_stream()
1645 ret = sdw_prep_deprep_ports(m_rt, false); in _sdw_deprepare_stream()
1653 bus->params.bandwidth -= m_rt->stream->params.rate * in _sdw_deprepare_stream()
1654 m_rt->ch_count * m_rt->stream->params.bps; in _sdw_deprepare_stream()
1868 struct sdw_master_runtime *m_rt; in sdw_stream_add_master() local
1890 m_rt = sdw_master_rt_find(bus, stream); in sdw_stream_add_master()
1891 if (!m_rt) { in sdw_stream_add_master()
1892 m_rt = sdw_master_rt_alloc(bus, stream); in sdw_stream_add_master()
1893 if (!m_rt) { in sdw_stream_add_master()
1903 if (!sdw_master_port_allocated(m_rt)) { in sdw_stream_add_master()
1904 ret = sdw_master_port_alloc(m_rt, num_ports); in sdw_stream_add_master()
1911 ret = sdw_master_rt_config(m_rt, stream_config); in sdw_stream_add_master()
1919 ret = sdw_master_port_config(m_rt, port_config); in sdw_stream_add_master()
1928 sdw_master_rt_free(m_rt, stream); in sdw_stream_add_master()
1946 struct sdw_master_runtime *m_rt, *_m_rt; in sdw_stream_remove_master() local
1950 list_for_each_entry_safe(m_rt, _m_rt, in sdw_stream_remove_master()
1952 if (m_rt->bus != bus) in sdw_stream_remove_master()
1955 sdw_master_port_free(m_rt); in sdw_stream_remove_master()
1956 sdw_master_rt_free(m_rt, stream); in sdw_stream_remove_master()
1989 struct sdw_master_runtime *m_rt; in sdw_stream_add_slave() local
2001 m_rt = sdw_master_rt_find(slave->bus, stream); in sdw_stream_add_slave()
2002 if (!m_rt) { in sdw_stream_add_slave()
2007 m_rt = sdw_master_rt_alloc(slave->bus, stream); in sdw_stream_add_slave()
2008 if (!m_rt) { in sdw_stream_add_slave()
2020 s_rt = sdw_slave_rt_alloc(slave, m_rt); in sdw_stream_add_slave()
2037 ret = sdw_master_rt_config(m_rt, stream_config); in sdw_stream_add_slave()
2069 sdw_master_rt_free(m_rt, stream); in sdw_stream_add_slave()