Lines Matching refs:substream

170 azx_assign_device(struct azx *chip, struct snd_pcm_substream *substream)  in azx_assign_device()  argument
175 int key = (substream->pcm->device << 16) | (substream->number << 2) | in azx_assign_device()
176 (substream->stream + 1); in azx_assign_device()
178 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in azx_assign_device()
219 struct snd_pcm_substream *substream = azx_dev->substream; in azx_cc_read() local
220 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_cc_read()
226 static void azx_timecounter_init(struct snd_pcm_substream *substream, in azx_timecounter_init() argument
229 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_timecounter_init()
261 to_hda_pcm_stream(struct snd_pcm_substream *substream) in to_hda_pcm_stream() argument
263 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in to_hda_pcm_stream()
264 return &apcm->info->stream[substream->stream]; in to_hda_pcm_stream()
267 static u64 azx_adjust_codec_delay(struct snd_pcm_substream *substream, in azx_adjust_codec_delay() argument
270 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_adjust_codec_delay()
271 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); in azx_adjust_codec_delay()
277 codec_frames = hinfo->ops.get_delay(hinfo, apcm->codec, substream); in azx_adjust_codec_delay()
279 substream->runtime->rate); in azx_adjust_codec_delay()
281 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) in azx_adjust_codec_delay()
334 struct snd_pcm_substream *substream, in azx_setup_periods() argument
356 struct snd_pcm_runtime *runtime = substream->runtime; in azx_setup_periods()
370 ofs = setup_bdle(chip, snd_pcm_get_dma_buf(substream), in azx_setup_periods()
381 ofs = setup_bdle(chip, snd_pcm_get_dma_buf(substream), in azx_setup_periods()
385 ofs = setup_bdle(chip, snd_pcm_get_dma_buf(substream), in azx_setup_periods()
404 static int azx_pcm_close(struct snd_pcm_substream *substream) in azx_pcm_close() argument
406 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_pcm_close()
407 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); in azx_pcm_close()
409 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_pcm_close()
414 azx_dev->substream = NULL; in azx_pcm_close()
419 hinfo->ops.close(hinfo, apcm->codec, substream); in azx_pcm_close()
426 static int azx_pcm_hw_params(struct snd_pcm_substream *substream, in azx_pcm_hw_params() argument
429 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_pcm_hw_params()
433 dsp_lock(get_azx_dev(substream)); in azx_pcm_hw_params()
434 if (dsp_is_locked(get_azx_dev(substream))) { in azx_pcm_hw_params()
439 ret = chip->ops->substream_alloc_pages(chip, substream, in azx_pcm_hw_params()
442 dsp_unlock(get_azx_dev(substream)); in azx_pcm_hw_params()
446 static int azx_pcm_hw_free(struct snd_pcm_substream *substream) in azx_pcm_hw_free() argument
448 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_pcm_hw_free()
449 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_pcm_hw_free()
451 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); in azx_pcm_hw_free()
465 snd_hda_codec_cleanup(apcm->codec, hinfo, substream); in azx_pcm_hw_free()
467 err = chip->ops->substream_free_pages(chip, substream); in azx_pcm_hw_free()
473 static int azx_pcm_prepare(struct snd_pcm_substream *substream) in azx_pcm_prepare() argument
475 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_pcm_prepare()
477 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_pcm_prepare()
478 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); in azx_pcm_prepare()
479 struct snd_pcm_runtime *runtime = substream->runtime; in azx_pcm_prepare()
507 bufsize = snd_pcm_lib_buffer_bytes(substream); in azx_pcm_prepare()
508 period_bytes = snd_pcm_lib_period_bytes(substream); in azx_pcm_prepare()
521 err = azx_setup_periods(chip, substream, azx_dev); in azx_pcm_prepare()
539 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in azx_pcm_prepare()
551 azx_dev->format_val, substream); in azx_pcm_prepare()
560 static int azx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) in azx_pcm_trigger() argument
562 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_pcm_trigger()
569 azx_dev = get_azx_dev(substream); in azx_pcm_trigger()
591 snd_pcm_group_for_each_entry(s, substream) { in azx_pcm_trigger()
592 if (s->pcm->card != substream->pcm->card) in azx_pcm_trigger()
597 snd_pcm_trigger_done(s, substream); in azx_pcm_trigger()
609 snd_pcm_group_for_each_entry(s, substream) { in azx_pcm_trigger()
610 if (s->pcm->card != substream->pcm->card) in azx_pcm_trigger()
629 snd_pcm_group_for_each_entry(s, substream) { in azx_pcm_trigger()
630 if (s->pcm->card != substream->pcm->card) in azx_pcm_trigger()
645 snd_pcm_group_for_each_entry(s, substream) { in azx_pcm_trigger()
646 if (s->pcm->card != substream->pcm->card) in azx_pcm_trigger()
666 azx_timecounter_init(substream, 0, 0); in azx_pcm_trigger()
667 snd_pcm_gettime(substream->runtime, &substream->runtime->trigger_tstamp); in azx_pcm_trigger()
668 substream->runtime->trigger_tstamp_latched = true; in azx_pcm_trigger()
674 azx_dev = get_azx_dev(substream); in azx_pcm_trigger()
677 snd_pcm_group_for_each_entry(s, substream) { in azx_pcm_trigger()
678 if (s->pcm->card != substream->pcm->card) in azx_pcm_trigger()
703 struct snd_pcm_substream *substream = azx_dev->substream; in azx_get_position() local
705 int stream = substream->stream; in azx_get_position()
716 if (substream->runtime) { in azx_get_position()
717 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_get_position()
718 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); in azx_get_position()
724 substream); in azx_get_position()
725 substream->runtime->delay = delay; in azx_get_position()
733 static snd_pcm_uframes_t azx_pcm_pointer(struct snd_pcm_substream *substream) in azx_pcm_pointer() argument
735 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_pcm_pointer()
737 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_pcm_pointer()
738 return bytes_to_frames(substream->runtime, in azx_pcm_pointer()
742 static int azx_get_time_info(struct snd_pcm_substream *substream, in azx_get_time_info() argument
747 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_get_time_info()
750 if ((substream->runtime->hw.info & SNDRV_PCM_INFO_HAS_LINK_ATIME) && in azx_get_time_info()
753 snd_pcm_gettime(substream->runtime, system_ts); in azx_get_time_info()
758 nsec = azx_adjust_codec_delay(substream, nsec); in azx_get_time_info()
798 static int azx_pcm_open(struct snd_pcm_substream *substream) in azx_pcm_open() argument
800 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_pcm_open()
801 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); in azx_pcm_open()
804 struct snd_pcm_runtime *runtime = substream->runtime; in azx_pcm_open()
811 azx_dev = azx_assign_device(chip, substream); in azx_pcm_open()
850 err = hinfo->ops.open(hinfo, apcm->codec, substream); in azx_pcm_open()
865 hinfo->ops.close(hinfo, apcm->codec, substream); in azx_pcm_open()
872 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { in azx_pcm_open()
878 azx_dev->substream = substream; in azx_pcm_open()
883 snd_pcm_set_sync(substream); in azx_pcm_open()
895 static int azx_pcm_mmap(struct snd_pcm_substream *substream, in azx_pcm_mmap() argument
898 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); in azx_pcm_mmap()
901 chip->ops->pcm_mmap_prepare(substream, area); in azx_pcm_mmap()
902 return snd_pcm_lib_default_mmap(substream, area); in azx_pcm_mmap()
1724 if (!azx_dev->substream || !azx_dev->running || in azx_interrupt()
1731 snd_pcm_period_elapsed(azx_dev->substream); in azx_interrupt()