Lines Matching refs:substream
103 static void dsp_buffer_free(struct snd_pcm_substream *substream) in dsp_buffer_free() argument
105 struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream); in dsp_buffer_free()
109 vfree(substream->runtime->dma_area); in dsp_buffer_free()
110 substream->runtime->dma_area = NULL; in dsp_buffer_free()
111 substream->runtime->dma_bytes = 0; in dsp_buffer_free()
114 static int dsp_buffer_alloc(struct snd_pcm_substream *substream, int size) in dsp_buffer_alloc() argument
116 struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream); in dsp_buffer_alloc()
120 if (substream->runtime->dma_area) { in dsp_buffer_alloc()
121 if (substream->runtime->dma_bytes > size) in dsp_buffer_alloc()
124 dsp_buffer_free(substream); in dsp_buffer_alloc()
127 substream->runtime->dma_area = vmalloc(size); in dsp_buffer_alloc()
128 if (!substream->runtime->dma_area) in dsp_buffer_alloc()
131 substream->runtime->dma_bytes = size; in dsp_buffer_alloc()
169 static int snd_tm6000_pcm_open(struct snd_pcm_substream *substream) in snd_tm6000_pcm_open() argument
171 struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream); in snd_tm6000_pcm_open()
172 struct snd_pcm_runtime *runtime = substream->runtime; in snd_tm6000_pcm_open()
180 chip->substream = substream; in snd_tm6000_pcm_open()
194 static int snd_tm6000_close(struct snd_pcm_substream *substream) in snd_tm6000_close() argument
196 struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream); in snd_tm6000_close()
210 struct snd_pcm_substream *substream = chip->substream; in tm6000_fillbuf() local
219 if (!size || !substream) { in tm6000_fillbuf()
224 runtime = substream->runtime; in tm6000_fillbuf()
257 snd_pcm_stream_lock(substream); in tm6000_fillbuf()
269 snd_pcm_stream_unlock(substream); in tm6000_fillbuf()
272 snd_pcm_period_elapsed(substream); in tm6000_fillbuf()
280 static int snd_tm6000_hw_params(struct snd_pcm_substream *substream, in snd_tm6000_hw_params() argument
287 rc = dsp_buffer_alloc(substream, size); in snd_tm6000_hw_params()
297 static int snd_tm6000_hw_free(struct snd_pcm_substream *substream) in snd_tm6000_hw_free() argument
299 struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream); in snd_tm6000_hw_free()
307 dsp_buffer_free(substream); in snd_tm6000_hw_free()
314 static int snd_tm6000_prepare(struct snd_pcm_substream *substream) in snd_tm6000_prepare() argument
316 struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream); in snd_tm6000_prepare()
343 static int snd_tm6000_card_trigger(struct snd_pcm_substream *substream, int cmd) in snd_tm6000_card_trigger() argument
345 struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream); in snd_tm6000_card_trigger()
371 static snd_pcm_uframes_t snd_tm6000_pointer(struct snd_pcm_substream *substream) in snd_tm6000_pointer() argument
373 struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream); in snd_tm6000_pointer()