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.
263 static int slim_define_channel_content(struct slim_stream_runtime *stream,
266 struct slim_device *sdev = stream->dev;
270 DEFINE_SLIM_LDEST_TXN(txn, mc, 8, stream->dev->laddr, &msg);
276 if (stream->prot != SLIM_PROTO_ISO)
280 wbuf[3] = stream->bps/SLIM_SLOT_LEN_BITS;
298 static int slim_define_channel(struct slim_stream_runtime *stream,
301 struct slim_device *sdev = stream->dev;
305 DEFINE_SLIM_LDEST_TXN(txn, mc, 8, stream->dev->laddr, &msg);
307 port->ch.seg_dist = slim_get_segdist_code(stream->ratem);
311 wbuf[2] = (stream->prot << 4) | ((port->ch.seg_dist & 0xF00) >> 8);
312 if (stream->prot == SLIM_PROTO_ISO)
313 wbuf[3] = stream->bps/SLIM_SLOT_LEN_BITS;
315 wbuf[3] = stream->bps/SLIM_SLOT_LEN_BITS + 1;
322 static int slim_activate_channel(struct slim_stream_runtime *stream,
325 struct slim_device *sdev = stream->dev;
329 DEFINE_SLIM_LDEST_TXN(txn, mc, 5, stream->dev->laddr, &msg);
342 * @stream: instance of slim stream runtime to enable
345 * SLIMbus stream
350 int slim_stream_enable(struct slim_stream_runtime *stream)
354 struct slim_controller *ctrl = stream->dev->ctrl;
358 ret = ctrl->enable_stream(stream);
362 for (i = 0; i < stream->num_ports; i++)
363 stream->ports[i].ch.state = SLIM_CH_STATE_ACTIVE;
373 for (i = 0; i < stream->num_ports; i++) {
374 struct slim_port *port = &stream->ports[i];
376 slim_define_channel(stream, port);
377 slim_define_channel_content(stream, port);
380 for (i = 0; i < stream->num_ports; i++) {
381 struct slim_port *port = &stream->ports[i];
383 slim_activate_channel(stream, port);
395 * @stream: instance of slim stream runtime to disable
398 * SLIMbus stream
403 int slim_stream_disable(struct slim_stream_runtime *stream)
407 struct slim_controller *ctrl = stream->dev->ctrl;
411 ctrl->disable_stream(stream);
417 for (i = 0; i < stream->num_ports; i++)
418 slim_deactivate_remove_channel(stream, &stream->ports[i]);
429 * @stream: instance of slim stream runtime to unprepare
432 * SLIMbus stream
437 int slim_stream_unprepare(struct slim_stream_runtime *stream)
441 for (i = 0; i < stream->num_ports; i++)
442 slim_disconnect_port(stream, &stream->ports[i]);
444 kfree(stream->ports);
445 stream->ports = NULL;
446 stream->num_ports = 0;
455 * @stream: instance of slim stream runtime to free
458 * slim stream runtime, user is not allowed to make an dereference
459 * to stream after this call.
464 int slim_stream_free(struct slim_stream_runtime *stream)
466 struct slim_device *sdev = stream->dev;
469 list_del(&stream->node);
472 kfree(stream->name);
473 kfree(stream);