Lines Matching refs:substream

44 azx_assign_device(struct azx *chip, struct snd_pcm_substream *substream)  in azx_assign_device()  argument
48 s = snd_hdac_stream_assign(azx_bus(chip), substream); in azx_assign_device()
61 to_hda_pcm_stream(struct snd_pcm_substream *substream) in to_hda_pcm_stream() argument
63 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in to_hda_pcm_stream()
64 return &apcm->info->stream[substream->stream]; in to_hda_pcm_stream()
67 static u64 azx_adjust_codec_delay(struct snd_pcm_substream *substream, in azx_adjust_codec_delay() argument
70 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_adjust_codec_delay()
71 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); in azx_adjust_codec_delay()
77 codec_frames = hinfo->ops.get_delay(hinfo, apcm->codec, substream); in azx_adjust_codec_delay()
79 substream->runtime->rate); in azx_adjust_codec_delay()
81 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) in azx_adjust_codec_delay()
91 static int azx_pcm_close(struct snd_pcm_substream *substream) in azx_pcm_close() argument
93 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_pcm_close()
94 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); in azx_pcm_close()
96 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_pcm_close()
102 hinfo->ops.close(hinfo, apcm->codec, substream); in azx_pcm_close()
109 static int azx_pcm_hw_params(struct snd_pcm_substream *substream, in azx_pcm_hw_params() argument
112 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_pcm_hw_params()
114 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_pcm_hw_params()
127 ret = chip->ops->substream_alloc_pages(chip, substream, in azx_pcm_hw_params()
134 static int azx_pcm_hw_free(struct snd_pcm_substream *substream) in azx_pcm_hw_free() argument
136 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_pcm_hw_free()
137 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_pcm_hw_free()
139 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); in azx_pcm_hw_free()
147 snd_hda_codec_cleanup(apcm->codec, hinfo, substream); in azx_pcm_hw_free()
149 err = chip->ops->substream_free_pages(chip, substream); in azx_pcm_hw_free()
155 static int azx_pcm_prepare(struct snd_pcm_substream *substream) in azx_pcm_prepare() argument
157 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_pcm_prepare()
159 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_pcm_prepare()
160 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); in azx_pcm_prepare()
161 struct snd_pcm_runtime *runtime = substream->runtime; in azx_pcm_prepare()
201 azx_dev->core.format_val, substream); in azx_pcm_prepare()
210 static int azx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) in azx_pcm_trigger() argument
212 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_pcm_trigger()
222 azx_dev = get_azx_dev(substream); in azx_pcm_trigger()
249 snd_pcm_group_for_each_entry(s, substream) { in azx_pcm_trigger()
250 if (s->pcm->card != substream->pcm->card) in azx_pcm_trigger()
254 snd_pcm_trigger_done(s, substream); in azx_pcm_trigger()
262 snd_pcm_group_for_each_entry(s, substream) { in azx_pcm_trigger()
263 if (s->pcm->card != substream->pcm->card) in azx_pcm_trigger()
301 struct snd_pcm_substream *substream = azx_dev->core.substream; in azx_get_position() local
303 int stream = substream->stream; in azx_get_position()
314 if (substream->runtime) { in azx_get_position()
315 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_get_position()
316 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); in azx_get_position()
322 substream); in azx_get_position()
323 substream->runtime->delay = delay; in azx_get_position()
331 static snd_pcm_uframes_t azx_pcm_pointer(struct snd_pcm_substream *substream) in azx_pcm_pointer() argument
333 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_pcm_pointer()
335 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_pcm_pointer()
336 return bytes_to_frames(substream->runtime, in azx_pcm_pointer()
340 static int azx_get_time_info(struct snd_pcm_substream *substream, in azx_get_time_info() argument
345 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_get_time_info()
348 if ((substream->runtime->hw.info & SNDRV_PCM_INFO_HAS_LINK_ATIME) && in azx_get_time_info()
351 snd_pcm_gettime(substream->runtime, system_ts); in azx_get_time_info()
356 nsec = azx_adjust_codec_delay(substream, nsec); in azx_get_time_info()
396 static int azx_pcm_open(struct snd_pcm_substream *substream) in azx_pcm_open() argument
398 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_pcm_open()
399 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); in azx_pcm_open()
402 struct snd_pcm_runtime *runtime = substream->runtime; in azx_pcm_open()
408 azx_dev = azx_assign_device(chip, substream); in azx_pcm_open()
449 err = hinfo->ops.open(hinfo, apcm->codec, substream); in azx_pcm_open()
464 hinfo->ops.close(hinfo, apcm->codec, substream); in azx_pcm_open()
471 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { in azx_pcm_open()
476 snd_pcm_set_sync(substream); in azx_pcm_open()
488 static int azx_pcm_mmap(struct snd_pcm_substream *substream, in azx_pcm_mmap() argument
491 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_pcm_mmap()
494 chip->ops->pcm_mmap_prepare(substream, area); in azx_pcm_mmap()
495 return snd_pcm_lib_default_mmap(substream, area); in azx_pcm_mmap()
923 snd_pcm_period_elapsed(azx_stream(azx_dev)->substream); in stream_update()