Lines Matching refs:substream
126 static int snd_vortex_pcm_open(struct snd_pcm_substream *substream) in snd_vortex_pcm_open() argument
128 vortex_t *vortex = snd_pcm_substream_chip(substream); in snd_vortex_pcm_open()
129 struct snd_pcm_runtime *runtime = substream->runtime; in snd_vortex_pcm_open()
146 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { in snd_vortex_pcm_open()
148 if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_A3D) { in snd_vortex_pcm_open()
152 if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_SPDIF) { in snd_vortex_pcm_open()
166 if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB in snd_vortex_pcm_open()
167 || VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_I2S) in snd_vortex_pcm_open()
170 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && in snd_vortex_pcm_open()
172 VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) { in snd_vortex_pcm_open()
179 substream->runtime->private_data = NULL; in snd_vortex_pcm_open()
184 substream->runtime->private_data = NULL; in snd_vortex_pcm_open()
191 static int snd_vortex_pcm_close(struct snd_pcm_substream *substream) in snd_vortex_pcm_close() argument
194 stream_t *stream = (stream_t *) substream->runtime->private_data; in snd_vortex_pcm_close()
198 stream->substream = NULL; in snd_vortex_pcm_close()
201 substream->runtime->private_data = NULL; in snd_vortex_pcm_close()
207 snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream, in snd_vortex_pcm_hw_params() argument
210 vortex_t *chip = snd_pcm_substream_chip(substream); in snd_vortex_pcm_hw_params()
211 stream_t *stream = (stream_t *) (substream->runtime->private_data); in snd_vortex_pcm_hw_params()
216 snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); in snd_vortex_pcm_hw_params()
227 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { in snd_vortex_pcm_hw_params()
228 int dma, type = VORTEX_PCM_TYPE(substream->pcm); in snd_vortex_pcm_hw_params()
234 substream->number); in snd_vortex_pcm_hw_params()
239 substream->stream, type, in snd_vortex_pcm_hw_params()
240 substream->number); in snd_vortex_pcm_hw_params()
245 stream = substream->runtime->private_data = &chip->dma_adb[dma]; in snd_vortex_pcm_hw_params()
246 stream->substream = substream; in snd_vortex_pcm_hw_params()
251 if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) { in snd_vortex_pcm_hw_params()
252 chip->pcm_vol[substream->number].active = 1; in snd_vortex_pcm_hw_params()
254 chip->pcm_vol[substream->number].kctl, 1); in snd_vortex_pcm_hw_params()
261 vortex_wt_allocroute(chip, substream->number, in snd_vortex_pcm_hw_params()
263 stream = substream->runtime->private_data = in snd_vortex_pcm_hw_params()
264 &chip->dma_wt[substream->number]; in snd_vortex_pcm_hw_params()
265 stream->dma = substream->number; in snd_vortex_pcm_hw_params()
266 stream->substream = substream; in snd_vortex_pcm_hw_params()
267 vortex_wtdma_setbuffers(chip, substream->number, in snd_vortex_pcm_hw_params()
277 static int snd_vortex_pcm_hw_free(struct snd_pcm_substream *substream) in snd_vortex_pcm_hw_free() argument
279 vortex_t *chip = snd_pcm_substream_chip(substream); in snd_vortex_pcm_hw_free()
280 stream_t *stream = (stream_t *) (substream->runtime->private_data); in snd_vortex_pcm_hw_free()
284 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { in snd_vortex_pcm_hw_free()
286 if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) { in snd_vortex_pcm_hw_free()
287 chip->pcm_vol[substream->number].active = 0; in snd_vortex_pcm_hw_free()
289 chip->pcm_vol[substream->number].kctl, in snd_vortex_pcm_hw_free()
295 substream->number); in snd_vortex_pcm_hw_free()
304 substream->runtime->private_data = NULL; in snd_vortex_pcm_hw_free()
307 return snd_pcm_lib_free_pages(substream); in snd_vortex_pcm_hw_free()
311 static int snd_vortex_pcm_prepare(struct snd_pcm_substream *substream) in snd_vortex_pcm_prepare() argument
313 vortex_t *chip = snd_pcm_substream_chip(substream); in snd_vortex_pcm_prepare()
314 struct snd_pcm_runtime *runtime = substream->runtime; in snd_vortex_pcm_prepare()
315 stream_t *stream = (stream_t *) substream->runtime->private_data; in snd_vortex_pcm_prepare()
319 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in snd_vortex_pcm_prepare()
325 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { in snd_vortex_pcm_prepare()
329 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_SPDIF) in snd_vortex_pcm_prepare()
344 static int snd_vortex_pcm_trigger(struct snd_pcm_substream *substream, int cmd) in snd_vortex_pcm_trigger() argument
346 vortex_t *chip = snd_pcm_substream_chip(substream); in snd_vortex_pcm_trigger()
347 stream_t *stream = (stream_t *) substream->runtime->private_data; in snd_vortex_pcm_trigger()
356 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { in snd_vortex_pcm_trigger()
371 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) in snd_vortex_pcm_trigger()
382 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) in snd_vortex_pcm_trigger()
391 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) in snd_vortex_pcm_trigger()
407 static snd_pcm_uframes_t snd_vortex_pcm_pointer(struct snd_pcm_substream *substream) in snd_vortex_pcm_pointer() argument
409 vortex_t *chip = snd_pcm_substream_chip(substream); in snd_vortex_pcm_pointer()
410 stream_t *stream = (stream_t *) substream->runtime->private_data; in snd_vortex_pcm_pointer()
415 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) in snd_vortex_pcm_pointer()
423 current_ptr = bytes_to_frames(substream->runtime, current_ptr); in snd_vortex_pcm_pointer()
424 if (current_ptr >= substream->runtime->buffer_size) in snd_vortex_pcm_pointer()