Lines Matching refs:stream
123 static int slim_connect_port_channel(struct slim_stream_runtime *stream, in slim_connect_port_channel() argument
126 struct slim_device *sdev = stream->dev; in slim_connect_port_channel()
130 DEFINE_SLIM_LDEST_TXN(txn, mc, 6, stream->dev->laddr, &msg); in slim_connect_port_channel()
143 static int slim_disconnect_port(struct slim_stream_runtime *stream, in slim_disconnect_port() argument
146 struct slim_device *sdev = stream->dev; in slim_disconnect_port()
150 DEFINE_SLIM_LDEST_TXN(txn, mc, 5, stream->dev->laddr, &msg); in slim_disconnect_port()
159 static int slim_deactivate_remove_channel(struct slim_stream_runtime *stream, in slim_deactivate_remove_channel() argument
162 struct slim_device *sdev = stream->dev; in slim_deactivate_remove_channel()
166 DEFINE_SLIM_LDEST_TXN(txn, mc, 5, stream->dev->laddr, &msg); in slim_deactivate_remove_channel()
270 static int slim_define_channel_content(struct slim_stream_runtime *stream, in slim_define_channel_content() argument
273 struct slim_device *sdev = stream->dev; in slim_define_channel_content()
277 DEFINE_SLIM_LDEST_TXN(txn, mc, 8, stream->dev->laddr, &msg); in slim_define_channel_content()
283 if (stream->prot != SLIM_PROTO_ISO) in slim_define_channel_content()
287 wbuf[3] = stream->bps/SLIM_SLOT_LEN_BITS; in slim_define_channel_content()
305 static int slim_define_channel(struct slim_stream_runtime *stream, in slim_define_channel() argument
308 struct slim_device *sdev = stream->dev; in slim_define_channel()
312 DEFINE_SLIM_LDEST_TXN(txn, mc, 8, stream->dev->laddr, &msg); in slim_define_channel()
314 port->ch.seg_dist = slim_get_segdist_code(stream->ratem); in slim_define_channel()
318 wbuf[2] = (stream->prot << 4) | ((port->ch.seg_dist & 0xF00) >> 8); in slim_define_channel()
319 if (stream->prot == SLIM_PROTO_ISO) in slim_define_channel()
320 wbuf[3] = stream->bps/SLIM_SLOT_LEN_BITS; in slim_define_channel()
322 wbuf[3] = stream->bps/SLIM_SLOT_LEN_BITS + 1; in slim_define_channel()
329 static int slim_activate_channel(struct slim_stream_runtime *stream, in slim_activate_channel() argument
332 struct slim_device *sdev = stream->dev; in slim_activate_channel()
336 DEFINE_SLIM_LDEST_TXN(txn, mc, 5, stream->dev->laddr, &msg); in slim_activate_channel()
357 int slim_stream_enable(struct slim_stream_runtime *stream) in slim_stream_enable() argument
361 struct slim_controller *ctrl = stream->dev->ctrl; in slim_stream_enable()
365 ret = ctrl->enable_stream(stream); in slim_stream_enable()
369 for (i = 0; i < stream->num_ports; i++) in slim_stream_enable()
370 stream->ports[i].ch.state = SLIM_CH_STATE_ACTIVE; in slim_stream_enable()
380 for (i = 0; i < stream->num_ports; i++) { in slim_stream_enable()
381 struct slim_port *port = &stream->ports[i]; in slim_stream_enable()
383 slim_define_channel(stream, port); in slim_stream_enable()
384 slim_define_channel_content(stream, port); in slim_stream_enable()
387 for (i = 0; i < stream->num_ports; i++) { in slim_stream_enable()
388 struct slim_port *port = &stream->ports[i]; in slim_stream_enable()
390 slim_activate_channel(stream, port); in slim_stream_enable()
410 int slim_stream_disable(struct slim_stream_runtime *stream) in slim_stream_disable() argument
414 struct slim_controller *ctrl = stream->dev->ctrl; in slim_stream_disable()
417 if (!stream->ports || !stream->num_ports) in slim_stream_disable()
421 ctrl->disable_stream(stream); in slim_stream_disable()
427 for (i = 0; i < stream->num_ports; i++) in slim_stream_disable()
428 slim_deactivate_remove_channel(stream, &stream->ports[i]); in slim_stream_disable()
447 int slim_stream_unprepare(struct slim_stream_runtime *stream) in slim_stream_unprepare() argument
451 if (!stream->ports || !stream->num_ports) in slim_stream_unprepare()
454 for (i = 0; i < stream->num_ports; i++) in slim_stream_unprepare()
455 slim_disconnect_port(stream, &stream->ports[i]); in slim_stream_unprepare()
457 kfree(stream->ports); in slim_stream_unprepare()
458 stream->ports = NULL; in slim_stream_unprepare()
459 stream->num_ports = 0; in slim_stream_unprepare()
477 int slim_stream_free(struct slim_stream_runtime *stream) in slim_stream_free() argument
479 struct slim_device *sdev = stream->dev; in slim_stream_free()
482 list_del(&stream->node); in slim_stream_free()
485 kfree(stream->name); in slim_stream_free()
486 kfree(stream); in slim_stream_free()