Lines Matching full:stream
53 * The Presence rate of a constant bitrate stream is mean flow rate of the
54 * stream expressed in occupied Segments of that Data Channel per second.
88 * slim_stream_allocate() - Allocate a new SLIMbus Stream
90 * @name: name of the stream
93 * a new SLIMbus stream and return a valid stream runtime pointer for client
94 * to use it in subsequent stream apis. state of stream is set to ALLOCATED
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()
193 * slim_stream_prepare() - Prepare a SLIMbus Stream
195 * @rt: instance of slim stream runtime to configure
196 * @cfg: new configuration for the stream
198 * This API will configure SLIMbus stream with config parameters from cfg.
210 dev_err(&rt->dev->dev, "Stream already Prepared\n"); in slim_stream_prepare()
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()
347 * slim_stream_enable() - Enable a prepared SLIMbus Stream
349 * @stream: instance of slim stream runtime to enable
352 * SLIMbus stream
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()
400 * slim_stream_disable() - Disable a SLIMbus Stream
402 * @stream: instance of slim stream runtime to disable
405 * SLIMbus stream
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()
437 * slim_stream_unprepare() - Un-prepare a SLIMbus Stream
439 * @stream: instance of slim stream runtime to unprepare
442 * SLIMbus stream
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()
466 * slim_stream_free() - Free a SLIMbus Stream
468 * @stream: instance of slim stream runtime to free
471 * slim stream runtime, user is not allowed to make an dereference
472 * to stream after this call.
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()