Lines Matching refs:slave
63 struct sdw_slave *slave, in _sdw_program_slave_port_params() argument
84 ret = sdw_write(slave, addr1, t_params->offset2); in _sdw_program_slave_port_params()
91 ret = sdw_write(slave, addr2, t_params->blk_pkg_mode); in _sdw_program_slave_port_params()
108 ret = sdw_write(slave, addr3, wbuf); in _sdw_program_slave_port_params()
118 ret = sdw_write(slave, addr4, wbuf); in _sdw_program_slave_port_params()
131 struct sdw_slave_prop *slave_prop = &s_rt->slave->prop; in sdw_program_slave_port_params()
137 if (s_rt->slave->is_mockup_device) in sdw_program_slave_port_params()
140 dpn_prop = sdw_get_slave_dpn_prop(s_rt->slave, in sdw_program_slave_port_params()
166 ret = sdw_update(s_rt->slave, addr1, 0xF, wbuf); in sdw_program_slave_port_params()
168 dev_err(&s_rt->slave->dev, in sdw_program_slave_port_params()
176 ret = sdw_write(s_rt->slave, addr2, (p_params->bps - 1)); in sdw_program_slave_port_params()
178 dev_err(&s_rt->slave->dev, in sdw_program_slave_port_params()
187 ret = sdw_write(s_rt->slave, addr3, wbuf); in sdw_program_slave_port_params()
189 dev_err(&s_rt->slave->dev, in sdw_program_slave_port_params()
196 ret = sdw_write(s_rt->slave, addr4, t_params->offset1); in sdw_program_slave_port_params()
198 dev_err(&s_rt->slave->dev, in sdw_program_slave_port_params()
206 ret = sdw_write(s_rt->slave, addr5, t_params->blk_grp_ctrl); in sdw_program_slave_port_params()
208 dev_err(&s_rt->slave->dev, in sdw_program_slave_port_params()
217 ret = sdw_write(s_rt->slave, addr6, t_params->lane_ctrl); in sdw_program_slave_port_params()
219 dev_err(&s_rt->slave->dev, in sdw_program_slave_port_params()
227 ret = _sdw_program_slave_port_params(bus, s_rt->slave, in sdw_program_slave_port_params()
230 dev_err(&s_rt->slave->dev, in sdw_program_slave_port_params()
322 ret = sdw_write(s_rt->slave, addr, p_rt->ch_mask); in sdw_enable_disable_slave_ports()
324 ret = sdw_write(s_rt->slave, addr, 0x0); in sdw_enable_disable_slave_ports()
327 dev_err(&s_rt->slave->dev, in sdw_enable_disable_slave_ports()
406 struct sdw_slave *slave = s_rt->slave; in sdw_do_port_prep() local
408 mutex_lock(&slave->sdw_dev_lock); in sdw_do_port_prep()
410 if (slave->probed) { in sdw_do_port_prep()
411 struct device *dev = &slave->dev; in sdw_do_port_prep()
415 ret = drv->ops->port_prep(slave, &prep_ch, cmd); in sdw_do_port_prep()
422 mutex_unlock(&slave->sdw_dev_lock); in sdw_do_port_prep()
442 dpn_prop = sdw_get_slave_dpn_prop(s_rt->slave, in sdw_prep_deprep_slave_ports()
465 ret = sdw_configure_dpn_intr(s_rt->slave, p_rt->num, prep, in sdw_prep_deprep_slave_ports()
479 ret = sdw_write(s_rt->slave, addr, p_rt->ch_mask); in sdw_prep_deprep_slave_ports()
481 ret = sdw_write(s_rt->slave, addr, 0x0); in sdw_prep_deprep_slave_ports()
484 dev_err(&s_rt->slave->dev, in sdw_prep_deprep_slave_ports()
490 port_ready = &s_rt->slave->port_ready[prep_ch.num]; in sdw_prep_deprep_slave_ports()
494 val = sdw_read(s_rt->slave, SDW_DPN_PREPARESTATUS(p_rt->num)); in sdw_prep_deprep_slave_ports()
497 dev_err(&s_rt->slave->dev, in sdw_prep_deprep_slave_ports()
508 ret = sdw_configure_dpn_intr(s_rt->slave, p_rt->num, prep, in sdw_prep_deprep_slave_ports()
587 struct sdw_slave *slave; in sdw_notify_config() local
597 slave = s_rt->slave; in sdw_notify_config()
599 mutex_lock(&slave->sdw_dev_lock); in sdw_notify_config()
601 if (slave->probed) { in sdw_notify_config()
602 struct device *dev = &slave->dev; in sdw_notify_config()
606 ret = drv->ops->bus_config(slave, &bus->params); in sdw_notify_config()
609 slave->dev_num); in sdw_notify_config()
610 mutex_unlock(&slave->sdw_dev_lock); in sdw_notify_config()
616 mutex_unlock(&slave->sdw_dev_lock); in sdw_notify_config()
924 static void sdw_slave_port_free(struct sdw_slave *slave, in sdw_slave_port_free() argument
933 if (s_rt->slave != slave) in sdw_slave_port_free()
944 static int sdw_slave_port_alloc(struct sdw_slave *slave, in sdw_slave_port_alloc() argument
971 static int sdw_slave_port_config(struct sdw_slave *slave, in sdw_slave_port_config() argument
985 ret = sdw_slave_port_is_valid_range(&slave->dev, port_config[i].num); in sdw_slave_port_config()
1055 *sdw_slave_rt_alloc(struct sdw_slave *slave, in sdw_slave_rt_alloc() argument
1065 s_rt->slave = slave; in sdw_slave_rt_alloc()
1089 static struct sdw_slave_runtime *sdw_slave_rt_find(struct sdw_slave *slave, in sdw_slave_rt_find() argument
1099 if (s_rt->slave == slave) in sdw_slave_rt_find()
1114 static void sdw_slave_rt_free(struct sdw_slave *slave, in sdw_slave_rt_free() argument
1119 s_rt = sdw_slave_rt_find(slave, stream); in sdw_slave_rt_free()
1207 sdw_slave_port_free(s_rt->slave, stream); in sdw_master_rt_free()
1208 sdw_slave_rt_free(s_rt->slave, stream); in sdw_master_rt_free()
1269 struct sdw_dpn_prop *sdw_get_slave_dpn_prop(struct sdw_slave *slave, in sdw_get_slave_dpn_prop() argument
1278 num_ports = hweight32(slave->prop.source_ports); in sdw_get_slave_dpn_prop()
1279 dpn_prop = slave->prop.src_dpn_prop; in sdw_get_slave_dpn_prop()
1281 num_ports = hweight32(slave->prop.sink_ports); in sdw_get_slave_dpn_prop()
1282 dpn_prop = slave->prop.sink_dpn_prop; in sdw_get_slave_dpn_prop()
1984 int sdw_stream_add_slave(struct sdw_slave *slave, in sdw_stream_add_slave() argument
1997 mutex_lock(&slave->bus->bus_lock); in sdw_stream_add_slave()
2003 m_rt = sdw_master_rt_find(slave->bus, stream); in sdw_stream_add_slave()
2013 m_rt = sdw_master_rt_alloc(slave->bus, stream); in sdw_stream_add_slave()
2015 dev_err(&slave->dev, "Master runtime alloc failed for stream:%s\n", stream->name); in sdw_stream_add_slave()
2021 s_rt = sdw_slave_rt_find(slave, stream); in sdw_stream_add_slave()
2025 s_rt = sdw_slave_rt_alloc(slave, m_rt); in sdw_stream_add_slave()
2027 dev_err(&slave->dev, "Slave runtime alloc failed for stream:%s\n", stream->name); in sdw_stream_add_slave()
2037 ret = sdw_slave_port_alloc(slave, s_rt, num_ports); in sdw_stream_add_slave()
2050 ret = sdw_config_stream(&slave->dev, stream, stream_config, true); in sdw_stream_add_slave()
2054 ret = sdw_slave_port_config(slave, s_rt, port_config); in sdw_stream_add_slave()
2076 sdw_slave_rt_free(slave, stream); in sdw_stream_add_slave()
2078 mutex_unlock(&slave->bus->bus_lock); in sdw_stream_add_slave()
2091 int sdw_stream_remove_slave(struct sdw_slave *slave, in sdw_stream_remove_slave() argument
2094 mutex_lock(&slave->bus->bus_lock); in sdw_stream_remove_slave()
2096 sdw_slave_port_free(slave, stream); in sdw_stream_remove_slave()
2097 sdw_slave_rt_free(slave, stream); in sdw_stream_remove_slave()
2099 mutex_unlock(&slave->bus->bus_lock); in sdw_stream_remove_slave()