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()
219 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { in snd_vortex_pcm_hw_params()
220 int dma, type = VORTEX_PCM_TYPE(substream->pcm); in snd_vortex_pcm_hw_params()
226 substream->number); in snd_vortex_pcm_hw_params()
231 substream->stream, type, in snd_vortex_pcm_hw_params()
232 substream->number); in snd_vortex_pcm_hw_params()
237 stream = substream->runtime->private_data = &chip->dma_adb[dma]; in snd_vortex_pcm_hw_params()
238 stream->substream = substream; in snd_vortex_pcm_hw_params()
243 if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) { in snd_vortex_pcm_hw_params()
244 chip->pcm_vol[substream->number].active = 1; in snd_vortex_pcm_hw_params()
246 chip->pcm_vol[substream->number].kctl, 1); in snd_vortex_pcm_hw_params()
253 vortex_wt_allocroute(chip, substream->number, in snd_vortex_pcm_hw_params()
255 stream = substream->runtime->private_data = in snd_vortex_pcm_hw_params()
256 &chip->dma_wt[substream->number]; in snd_vortex_pcm_hw_params()
257 stream->dma = substream->number; in snd_vortex_pcm_hw_params()
258 stream->substream = substream; in snd_vortex_pcm_hw_params()
259 vortex_wtdma_setbuffers(chip, substream->number, in snd_vortex_pcm_hw_params()
269 static int snd_vortex_pcm_hw_free(struct snd_pcm_substream *substream) in snd_vortex_pcm_hw_free() argument
271 vortex_t *chip = snd_pcm_substream_chip(substream); in snd_vortex_pcm_hw_free()
272 stream_t *stream = (stream_t *) (substream->runtime->private_data); in snd_vortex_pcm_hw_free()
276 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { in snd_vortex_pcm_hw_free()
278 if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) { in snd_vortex_pcm_hw_free()
279 chip->pcm_vol[substream->number].active = 0; in snd_vortex_pcm_hw_free()
281 chip->pcm_vol[substream->number].kctl, in snd_vortex_pcm_hw_free()
287 substream->number); in snd_vortex_pcm_hw_free()
296 substream->runtime->private_data = NULL; in snd_vortex_pcm_hw_free()
303 static int snd_vortex_pcm_prepare(struct snd_pcm_substream *substream) in snd_vortex_pcm_prepare() argument
305 vortex_t *chip = snd_pcm_substream_chip(substream); in snd_vortex_pcm_prepare()
306 struct snd_pcm_runtime *runtime = substream->runtime; in snd_vortex_pcm_prepare()
307 stream_t *stream = (stream_t *) substream->runtime->private_data; in snd_vortex_pcm_prepare()
311 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in snd_vortex_pcm_prepare()
317 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { in snd_vortex_pcm_prepare()
321 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_SPDIF) in snd_vortex_pcm_prepare()
336 static int snd_vortex_pcm_trigger(struct snd_pcm_substream *substream, int cmd) in snd_vortex_pcm_trigger() argument
338 vortex_t *chip = snd_pcm_substream_chip(substream); in snd_vortex_pcm_trigger()
339 stream_t *stream = (stream_t *) substream->runtime->private_data; in snd_vortex_pcm_trigger()
348 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { in snd_vortex_pcm_trigger()
363 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) in snd_vortex_pcm_trigger()
374 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) in snd_vortex_pcm_trigger()
383 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) in snd_vortex_pcm_trigger()
399 static snd_pcm_uframes_t snd_vortex_pcm_pointer(struct snd_pcm_substream *substream) in snd_vortex_pcm_pointer() argument
401 vortex_t *chip = snd_pcm_substream_chip(substream); in snd_vortex_pcm_pointer()
402 stream_t *stream = (stream_t *) substream->runtime->private_data; in snd_vortex_pcm_pointer()
407 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) in snd_vortex_pcm_pointer()
415 current_ptr = bytes_to_frames(substream->runtime, current_ptr); in snd_vortex_pcm_pointer()
416 if (current_ptr >= substream->runtime->buffer_size) in snd_vortex_pcm_pointer()