• Home
  • Raw
  • Download

Lines Matching full:stream

2  *  hdac-ext-stream.c - HD-audio extended stream operations.
27 * snd_hdac_ext_stream_init - initialize each stream (aka device)
29 * @stream: HD-audio ext core stream object to initialize
30 * @idx: stream index number
31 * @direction: stream direction (SNDRV_PCM_STREAM_PLAYBACK or SNDRV_PCM_STREAM_CAPTURE)
34 * initialize the stream, if ppcap is enabled then init those and then
35 * invoke hdac stream initialization routine
38 struct hdac_ext_stream *stream, in snd_hdac_ext_stream_init() argument
42 stream->pphc_addr = bus->ppcap + AZX_PPHC_BASE + in snd_hdac_ext_stream_init()
45 stream->pplc_addr = bus->ppcap + AZX_PPLC_BASE + in snd_hdac_ext_stream_init()
51 stream->spib_addr = bus->spbcap + AZX_SPB_BASE + in snd_hdac_ext_stream_init()
55 stream->fifo_addr = bus->spbcap + AZX_SPB_BASE + in snd_hdac_ext_stream_init()
61 stream->dpibr_addr = bus->drsmcap + AZX_DRSM_BASE + in snd_hdac_ext_stream_init()
64 stream->decoupled = false; in snd_hdac_ext_stream_init()
65 snd_hdac_stream_init(bus, &stream->hstream, idx, direction, tag); in snd_hdac_ext_stream_init()
70 * snd_hdac_ext_stream_init_all - create and initialize the stream objects
84 struct hdac_ext_stream *stream = in snd_hdac_ext_stream_init_all() local
85 kzalloc(sizeof(*stream), GFP_KERNEL); in snd_hdac_ext_stream_init_all()
86 if (!stream) in snd_hdac_ext_stream_init_all()
89 snd_hdac_ext_stream_init(bus, stream, idx, dir, tag); in snd_hdac_ext_stream_init_all()
99 * snd_hdac_stream_free_all - free hdac extended stream objects
106 struct hdac_ext_stream *stream; in snd_hdac_stream_free_all() local
109 stream = stream_to_hdac_ext_stream(s); in snd_hdac_stream_free_all()
110 snd_hdac_ext_stream_decouple(bus, stream, false); in snd_hdac_stream_free_all()
112 kfree(stream); in snd_hdac_stream_free_all()
118 * snd_hdac_ext_stream_decouple - decouple the hdac stream
120 * @stream: HD-audio ext core stream object to initialize
124 struct hdac_ext_stream *stream, bool decouple) in snd_hdac_ext_stream_decouple() argument
126 struct hdac_stream *hstream = &stream->hstream; in snd_hdac_ext_stream_decouple()
138 stream->decoupled = decouple; in snd_hdac_ext_stream_decouple()
144 * snd_hdac_ext_linkstream_start - start a stream
145 * @stream: HD-audio ext core stream to start
147 void snd_hdac_ext_link_stream_start(struct hdac_ext_stream *stream) in snd_hdac_ext_link_stream_start() argument
149 snd_hdac_updatel(stream->pplc_addr, AZX_REG_PPLCCTL, in snd_hdac_ext_link_stream_start()
155 * snd_hdac_ext_link_stream_clear - stop a stream DMA
156 * @stream: HD-audio ext core stream to stop
158 void snd_hdac_ext_link_stream_clear(struct hdac_ext_stream *stream) in snd_hdac_ext_link_stream_clear() argument
160 snd_hdac_updatel(stream->pplc_addr, AZX_REG_PPLCCTL, AZX_PPLCCTL_RUN, 0); in snd_hdac_ext_link_stream_clear()
165 * snd_hdac_ext_link_stream_reset - reset a stream
166 * @stream: HD-audio ext core stream to reset
168 void snd_hdac_ext_link_stream_reset(struct hdac_ext_stream *stream) in snd_hdac_ext_link_stream_reset() argument
173 snd_hdac_ext_link_stream_clear(stream); in snd_hdac_ext_link_stream_reset()
175 snd_hdac_updatel(stream->pplc_addr, AZX_REG_PPLCCTL, in snd_hdac_ext_link_stream_reset()
180 val = readl(stream->pplc_addr + AZX_REG_PPLCCTL) & in snd_hdac_ext_link_stream_reset()
187 writel(val, stream->pplc_addr + AZX_REG_PPLCCTL); in snd_hdac_ext_link_stream_reset()
191 /* waiting for hardware to report that the stream is out of reset */ in snd_hdac_ext_link_stream_reset()
193 val = readl(stream->pplc_addr + AZX_REG_PPLCCTL) & AZX_PPLCCTL_STRST; in snd_hdac_ext_link_stream_reset()
204 * @stream: HD-audio ext core stream to set up
205 * @fmt: stream format
207 int snd_hdac_ext_link_stream_setup(struct hdac_ext_stream *stream, int fmt) in snd_hdac_ext_link_stream_setup() argument
209 struct hdac_stream *hstream = &stream->hstream; in snd_hdac_ext_link_stream_setup()
213 snd_hdac_ext_link_stream_clear(stream); in snd_hdac_ext_link_stream_setup()
215 val = readl(stream->pplc_addr + AZX_REG_PPLCCTL); in snd_hdac_ext_link_stream_setup()
218 writel(val, stream->pplc_addr + AZX_REG_PPLCCTL); in snd_hdac_ext_link_stream_setup()
220 /* program the stream format */ in snd_hdac_ext_link_stream_setup()
221 writew(fmt, stream->pplc_addr + AZX_REG_PPLCFMT); in snd_hdac_ext_link_stream_setup()
228 * snd_hdac_ext_link_set_stream_id - maps stream id to link output
230 * @stream: stream id
233 int stream) in snd_hdac_ext_link_set_stream_id() argument
235 snd_hdac_updatew(link->ml_addr, AZX_REG_ML_LOSIDV, (1 << stream), 1 << stream); in snd_hdac_ext_link_set_stream_id()
240 * snd_hdac_ext_link_clear_stream_id - maps stream id to link output
242 * @stream: stream id
245 int stream) in snd_hdac_ext_link_clear_stream_id() argument
247 snd_hdac_updatew(link->ml_addr, AZX_REG_ML_LOSIDV, (1 << stream), 0); in snd_hdac_ext_link_clear_stream_id()
256 struct hdac_stream *stream = NULL; in hdac_ext_link_stream_assign() local
259 dev_err(bus->dev, "stream type not supported\n"); in hdac_ext_link_stream_assign()
263 list_for_each_entry(stream, &bus->stream_list, list) { in hdac_ext_link_stream_assign()
264 struct hdac_ext_stream *hstream = container_of(stream, in hdac_ext_link_stream_assign()
267 if (stream->direction != substream->stream) in hdac_ext_link_stream_assign()
270 /* check if decoupled stream and not in use is available */ in hdac_ext_link_stream_assign()
296 struct hdac_stream *stream = NULL; in hdac_ext_host_stream_assign() local
299 dev_err(bus->dev, "stream type not supported\n"); in hdac_ext_host_stream_assign()
303 list_for_each_entry(stream, &bus->stream_list, list) { in hdac_ext_host_stream_assign()
304 struct hdac_ext_stream *hstream = container_of(stream, in hdac_ext_host_stream_assign()
307 if (stream->direction != substream->stream) in hdac_ext_host_stream_assign()
310 if (!stream->opened) { in hdac_ext_host_stream_assign()
329 * snd_hdac_ext_stream_assign - assign a stream for the PCM
332 * @type: type of stream (coupled, host or link stream)
334 * This assigns the stream based on the type (coupled/host/link), for the
335 * given PCM substream, assigns it and returns the stream object
337 * coupled: Looks for an unused stream
338 * host: Looks for an unused decoupled host stream
339 * link: Looks for an unused decoupled link stream
341 * If no stream is free, returns NULL. The function tries to keep using
342 * the same stream object when it's used beforehand. when a stream is
343 * decoupled, it becomes a host stream and link stream.
350 struct hdac_stream *stream = NULL; in snd_hdac_ext_stream_assign() local
354 stream = snd_hdac_stream_assign(bus, substream); in snd_hdac_ext_stream_assign()
355 if (stream) in snd_hdac_ext_stream_assign()
356 hstream = container_of(stream, in snd_hdac_ext_stream_assign()
373 * snd_hdac_ext_stream_release - release the assigned stream
374 * @stream: HD-audio ext core stream to release
375 * @type: type of stream (coupled, host or link stream)
377 * Release the stream that has been assigned by snd_hdac_ext_stream_assign().
379 void snd_hdac_ext_stream_release(struct hdac_ext_stream *stream, int type) in snd_hdac_ext_stream_release() argument
381 struct hdac_bus *bus = stream->hstream.bus; in snd_hdac_ext_stream_release()
385 snd_hdac_stream_release(&stream->hstream); in snd_hdac_ext_stream_release()
389 if (stream->decoupled && !stream->link_locked) in snd_hdac_ext_stream_release()
390 snd_hdac_ext_stream_decouple(bus, stream, false); in snd_hdac_ext_stream_release()
391 snd_hdac_stream_release(&stream->hstream); in snd_hdac_ext_stream_release()
395 if (stream->decoupled && !stream->hstream.opened) in snd_hdac_ext_stream_release()
396 snd_hdac_ext_stream_decouple(bus, stream, false); in snd_hdac_ext_stream_release()
398 stream->link_locked = 0; in snd_hdac_ext_stream_release()
399 stream->link_substream = NULL; in snd_hdac_ext_stream_release()
411 * snd_hdac_ext_stream_spbcap_enable - enable SPIB for a stream
414 * @index: stream index for which SPIB need to be enabled
436 * snd_hdac_ext_stream_set_spib - sets the spib value of a stream
438 * @stream: hdac_ext_stream
442 struct hdac_ext_stream *stream, u32 value) in snd_hdac_ext_stream_set_spib() argument
450 writel(value, stream->spib_addr); in snd_hdac_ext_stream_set_spib()
457 * snd_hdac_ext_stream_get_spbmaxfifo - gets the spib value of a stream
459 * @stream: hdac_ext_stream
461 * Return maxfifo for the stream
464 struct hdac_ext_stream *stream) in snd_hdac_ext_stream_get_spbmaxfifo() argument
472 return readl(stream->fifo_addr); in snd_hdac_ext_stream_get_spbmaxfifo()
478 * snd_hdac_ext_stop_streams - stop all stream if running
483 struct hdac_stream *stream; in snd_hdac_ext_stop_streams() local
486 list_for_each_entry(stream, &bus->stream_list, list) in snd_hdac_ext_stop_streams()
487 snd_hdac_stream_stop(stream); in snd_hdac_ext_stop_streams()
494 * snd_hdac_ext_stream_drsm_enable - enable DMA resume for a stream
497 * @index: stream index for which DRSM need to be enabled
519 * snd_hdac_ext_stream_set_dpibr - sets the dpibr value of a stream
521 * @stream: hdac_ext_stream
525 struct hdac_ext_stream *stream, u32 value) in snd_hdac_ext_stream_set_dpibr() argument
533 writel(value, stream->dpibr_addr); in snd_hdac_ext_stream_set_dpibr()
540 * snd_hdac_ext_stream_set_lpib - sets the lpib value of a stream
542 * @stream: hdac_ext_stream
545 int snd_hdac_ext_stream_set_lpib(struct hdac_ext_stream *stream, u32 value) in snd_hdac_ext_stream_set_lpib() argument
547 snd_hdac_stream_writel(&stream->hstream, SD_LPIB, value); in snd_hdac_ext_stream_set_lpib()