• Home
  • Raw
  • Download

Lines Matching full:stream

3  *  hdac-ext-stream.c - HD-audio extended stream operations.
19 * snd_hdac_ext_stream_init - initialize each stream (aka device)
21 * @stream: HD-audio ext core stream object to initialize
22 * @idx: stream index number
23 * @direction: stream direction (SNDRV_PCM_STREAM_PLAYBACK or SNDRV_PCM_STREAM_CAPTURE)
26 * initialize the stream, if ppcap is enabled then init those and then
27 * invoke hdac stream initialization routine
30 struct hdac_ext_stream *stream, in snd_hdac_ext_stream_init() argument
34 stream->pphc_addr = bus->ppcap + AZX_PPHC_BASE + in snd_hdac_ext_stream_init()
37 stream->pplc_addr = bus->ppcap + AZX_PPLC_BASE + in snd_hdac_ext_stream_init()
43 stream->spib_addr = bus->spbcap + AZX_SPB_BASE + in snd_hdac_ext_stream_init()
47 stream->fifo_addr = bus->spbcap + AZX_SPB_BASE + in snd_hdac_ext_stream_init()
53 stream->dpibr_addr = bus->drsmcap + AZX_DRSM_BASE + in snd_hdac_ext_stream_init()
56 stream->decoupled = false; in snd_hdac_ext_stream_init()
57 snd_hdac_stream_init(bus, &stream->hstream, idx, direction, tag); in snd_hdac_ext_stream_init()
62 * snd_hdac_ext_stream_init_all - create and initialize the stream objects
76 struct hdac_ext_stream *stream = in snd_hdac_ext_stream_init_all() local
77 kzalloc(sizeof(*stream), GFP_KERNEL); in snd_hdac_ext_stream_init_all()
78 if (!stream) in snd_hdac_ext_stream_init_all()
81 snd_hdac_ext_stream_init(bus, stream, idx, dir, tag); in snd_hdac_ext_stream_init_all()
91 * snd_hdac_stream_free_all - free hdac extended stream objects
98 struct hdac_ext_stream *stream; in snd_hdac_stream_free_all() local
101 stream = stream_to_hdac_ext_stream(s); in snd_hdac_stream_free_all()
102 snd_hdac_ext_stream_decouple(bus, stream, false); in snd_hdac_stream_free_all()
104 kfree(stream); in snd_hdac_stream_free_all()
110 struct hdac_ext_stream *stream, in snd_hdac_ext_stream_decouple_locked() argument
113 struct hdac_stream *hstream = &stream->hstream; in snd_hdac_ext_stream_decouple_locked()
124 stream->decoupled = decouple; in snd_hdac_ext_stream_decouple_locked()
129 * snd_hdac_ext_stream_decouple - decouple the hdac stream
131 * @stream: HD-audio ext core stream object to initialize
135 struct hdac_ext_stream *stream, bool decouple) in snd_hdac_ext_stream_decouple() argument
138 snd_hdac_ext_stream_decouple_locked(bus, stream, 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()
264 list_for_each_entry(stream, &bus->stream_list, list) { in hdac_ext_link_stream_assign()
265 struct hdac_ext_stream *hstream = container_of(stream, in hdac_ext_link_stream_assign()
268 if (stream->direction != substream->stream) in hdac_ext_link_stream_assign()
271 /* 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()
304 list_for_each_entry(stream, &bus->stream_list, list) { in hdac_ext_host_stream_assign()
305 struct hdac_ext_stream *hstream = container_of(stream, in hdac_ext_host_stream_assign()
308 if (stream->direction != substream->stream) in hdac_ext_host_stream_assign()
311 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()
390 if (stream->decoupled && !stream->link_locked) in snd_hdac_ext_stream_release()
391 snd_hdac_ext_stream_decouple_locked(bus, stream, false); in snd_hdac_ext_stream_release()
393 snd_hdac_stream_release(&stream->hstream); in snd_hdac_ext_stream_release()
398 if (stream->decoupled && !stream->hstream.opened) in snd_hdac_ext_stream_release()
399 snd_hdac_ext_stream_decouple_locked(bus, stream, false); in snd_hdac_ext_stream_release()
400 stream->link_locked = 0; in snd_hdac_ext_stream_release()
401 stream->link_substream = NULL; in snd_hdac_ext_stream_release()
413 * snd_hdac_ext_stream_spbcap_enable - enable SPIB for a stream
416 * @index: stream index for which SPIB need to be enabled
438 * snd_hdac_ext_stream_set_spib - sets the spib value of a stream
440 * @stream: hdac_ext_stream
444 struct hdac_ext_stream *stream, u32 value) in snd_hdac_ext_stream_set_spib() argument
452 writel(value, stream->spib_addr); in snd_hdac_ext_stream_set_spib()
459 * snd_hdac_ext_stream_get_spbmaxfifo - gets the spib value of a stream
461 * @stream: hdac_ext_stream
463 * Return maxfifo for the stream
466 struct hdac_ext_stream *stream) in snd_hdac_ext_stream_get_spbmaxfifo() argument
474 return readl(stream->fifo_addr); in snd_hdac_ext_stream_get_spbmaxfifo()
480 * snd_hdac_ext_stop_streams - stop all stream if running
485 struct hdac_stream *stream; in snd_hdac_ext_stop_streams() local
488 list_for_each_entry(stream, &bus->stream_list, list) in snd_hdac_ext_stop_streams()
489 snd_hdac_stream_stop(stream); in snd_hdac_ext_stop_streams()
496 * snd_hdac_ext_stream_drsm_enable - enable DMA resume for a stream
499 * @index: stream index for which DRSM need to be enabled
521 * snd_hdac_ext_stream_set_dpibr - sets the dpibr value of a stream
523 * @stream: hdac_ext_stream
527 struct hdac_ext_stream *stream, u32 value) in snd_hdac_ext_stream_set_dpibr() argument
535 writel(value, stream->dpibr_addr); in snd_hdac_ext_stream_set_dpibr()
542 * snd_hdac_ext_stream_set_lpib - sets the lpib value of a stream
543 * @stream: hdac_ext_stream
546 int snd_hdac_ext_stream_set_lpib(struct hdac_ext_stream *stream, u32 value) in snd_hdac_ext_stream_set_lpib() argument
548 snd_hdac_stream_writel(&stream->hstream, SD_LPIB, value); in snd_hdac_ext_stream_set_lpib()