Lines Matching refs:substream
56 static void s6000_pcm_enqueue_dma(struct snd_pcm_substream *substream) in s6000_pcm_enqueue_dma() argument
58 struct snd_pcm_runtime *runtime = substream->runtime; in s6000_pcm_enqueue_dma()
60 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; in s6000_pcm_enqueue_dma()
68 par = snd_soc_dai_get_dma_data(soc_runtime->cpu_dai, substream); in s6000_pcm_enqueue_dma()
70 period_size = snd_pcm_lib_period_bytes(substream); in s6000_pcm_enqueue_dma()
74 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in s6000_pcm_enqueue_dma()
111 struct snd_pcm_substream *substream = pcm->streams[i].substream; in s6000_pcm_irq() local
113 snd_soc_dai_get_dma_data(runtime->cpu_dai, substream); in s6000_pcm_irq()
117 if (substream == SNDRV_PCM_STREAM_PLAYBACK) in s6000_pcm_irq()
128 substream->runtime && in s6000_pcm_irq()
129 snd_pcm_running(substream)) { in s6000_pcm_irq()
131 snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); in s6000_pcm_irq()
140 if (likely(substream->runtime && in s6000_pcm_irq()
141 snd_pcm_running(substream))) { in s6000_pcm_irq()
142 snd_pcm_period_elapsed(substream); in s6000_pcm_irq()
148 prtd = substream->runtime->private_data; in s6000_pcm_irq()
150 s6000_pcm_enqueue_dma(substream); in s6000_pcm_irq()
176 static int s6000_pcm_start(struct snd_pcm_substream *substream) in s6000_pcm_start() argument
178 struct s6000_runtime_data *prtd = substream->runtime->private_data; in s6000_pcm_start()
179 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; in s6000_pcm_start()
185 par = snd_soc_dai_get_dma_data(soc_runtime->cpu_dai, substream); in s6000_pcm_start()
189 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in s6000_pcm_start()
210 s6000_pcm_enqueue_dma(substream); in s6000_pcm_start()
211 s6000_pcm_enqueue_dma(substream); in s6000_pcm_start()
218 static int s6000_pcm_stop(struct snd_pcm_substream *substream) in s6000_pcm_stop() argument
220 struct s6000_runtime_data *prtd = substream->runtime->private_data; in s6000_pcm_stop()
221 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; in s6000_pcm_stop()
226 par = snd_soc_dai_get_dma_data(soc_runtime->cpu_dai, substream); in s6000_pcm_stop()
228 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in s6000_pcm_stop()
245 static int s6000_pcm_trigger(struct snd_pcm_substream *substream, int cmd) in s6000_pcm_trigger() argument
247 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; in s6000_pcm_trigger()
251 par = snd_soc_dai_get_dma_data(soc_runtime->cpu_dai, substream); in s6000_pcm_trigger()
253 ret = par->trigger(substream, cmd, 0); in s6000_pcm_trigger()
261 ret = s6000_pcm_start(substream); in s6000_pcm_trigger()
266 ret = s6000_pcm_stop(substream); in s6000_pcm_trigger()
274 return par->trigger(substream, cmd, 1); in s6000_pcm_trigger()
277 static int s6000_pcm_prepare(struct snd_pcm_substream *substream) in s6000_pcm_prepare() argument
279 struct s6000_runtime_data *prtd = substream->runtime->private_data; in s6000_pcm_prepare()
286 static snd_pcm_uframes_t s6000_pcm_pointer(struct snd_pcm_substream *substream) in s6000_pcm_pointer() argument
288 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; in s6000_pcm_pointer()
290 struct snd_pcm_runtime *runtime = substream->runtime; in s6000_pcm_pointer()
296 par = snd_soc_dai_get_dma_data(soc_runtime->cpu_dai, substream); in s6000_pcm_pointer()
300 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in s6000_pcm_pointer()
318 static int s6000_pcm_open(struct snd_pcm_substream *substream) in s6000_pcm_open() argument
320 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; in s6000_pcm_open()
322 struct snd_pcm_runtime *runtime = substream->runtime; in s6000_pcm_open()
326 par = snd_soc_dai_get_dma_data(soc_runtime->cpu_dai, substream); in s6000_pcm_open()
327 snd_soc_set_runtime_hwparams(substream, &s6000_pcm_hardware); in s6000_pcm_open()
367 static int s6000_pcm_close(struct snd_pcm_substream *substream) in s6000_pcm_close() argument
369 struct snd_pcm_runtime *runtime = substream->runtime; in s6000_pcm_close()
377 static int s6000_pcm_hw_params(struct snd_pcm_substream *substream, in s6000_pcm_hw_params() argument
380 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; in s6000_pcm_hw_params()
383 ret = snd_pcm_lib_malloc_pages(substream, in s6000_pcm_hw_params()
390 par = snd_soc_dai_get_dma_data(soc_runtime->cpu_dai, substream); in s6000_pcm_hw_params()
395 !(par->in_use & ~(1 << substream->stream))) { in s6000_pcm_hw_params()
397 par->in_use |= 1 << substream->stream; in s6000_pcm_hw_params()
399 snd_pcm_lib_free_pages(substream); in s6000_pcm_hw_params()
400 par->in_use &= ~(1 << substream->stream); in s6000_pcm_hw_params()
408 static int s6000_pcm_hw_free(struct snd_pcm_substream *substream) in s6000_pcm_hw_free() argument
410 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; in s6000_pcm_hw_free()
412 snd_soc_dai_get_dma_data(soc_runtime->cpu_dai, substream); in s6000_pcm_hw_free()
415 par->in_use &= ~(1 << substream->stream); in s6000_pcm_hw_free()
420 return snd_pcm_lib_free_pages(substream); in s6000_pcm_hw_free()
439 pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream); in s6000_pcm_free()
455 pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream); in s6000_pcm_new()