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