Lines Matching +full:dai +full:- +full:format
1 // SPDX-License-Identifier: GPL-2.0
3 // Copyright(c) 2021-2022 Intel Corporation
12 static int hda_codec_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in hda_codec_dai_startup() argument
19 codec = dev_to_hda_codec(dai->dev); in hda_codec_dai_startup()
20 stream_info = snd_soc_dai_get_dma_data(dai, substream); in hda_codec_dai_startup()
21 pcm = container_of(stream_info, struct hda_pcm, stream[substream->stream]); in hda_codec_dai_startup()
23 dev_dbg(dai->dev, "open stream codec: %08x, info: %p, pcm: %p %s substream: %p\n", in hda_codec_dai_startup()
24 codec->core.vendor_id, stream_info, pcm, pcm->name, substream); in hda_codec_dai_startup()
28 ret = stream_info->ops.open(stream_info, codec, substream); in hda_codec_dai_startup()
30 dev_err(dai->dev, "codec open failed: %d\n", ret); in hda_codec_dai_startup()
38 static void hda_codec_dai_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in hda_codec_dai_shutdown() argument
45 codec = dev_to_hda_codec(dai->dev); in hda_codec_dai_shutdown()
46 stream_info = snd_soc_dai_get_dma_data(dai, substream); in hda_codec_dai_shutdown()
47 pcm = container_of(stream_info, struct hda_pcm, stream[substream->stream]); in hda_codec_dai_shutdown()
49 dev_dbg(dai->dev, "close stream codec: %08x, info: %p, pcm: %p %s substream: %p\n", in hda_codec_dai_shutdown()
50 codec->core.vendor_id, stream_info, pcm, pcm->name, substream); in hda_codec_dai_shutdown()
52 ret = stream_info->ops.close(stream_info, codec, substream); in hda_codec_dai_shutdown()
54 dev_err(dai->dev, "codec close failed: %d\n", ret); in hda_codec_dai_shutdown()
59 static int hda_codec_dai_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in hda_codec_dai_hw_free() argument
64 codec = dev_to_hda_codec(dai->dev); in hda_codec_dai_hw_free()
65 stream_info = snd_soc_dai_get_dma_data(dai, substream); in hda_codec_dai_hw_free()
72 static int hda_codec_dai_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in hda_codec_dai_prepare() argument
74 struct snd_pcm_runtime *runtime = substream->runtime; in hda_codec_dai_prepare()
78 unsigned int format; in hda_codec_dai_prepare() local
82 codec = dev_to_hda_codec(dai->dev); in hda_codec_dai_prepare()
83 stream = substream->runtime->private_data; in hda_codec_dai_prepare()
84 stream_info = snd_soc_dai_get_dma_data(dai, substream); in hda_codec_dai_prepare()
86 bits = snd_hdac_stream_format_bits(runtime->format, runtime->subformat, in hda_codec_dai_prepare()
87 stream_info->maxbps); in hda_codec_dai_prepare()
88 format = snd_hdac_stream_format(runtime->channels, bits, runtime->rate); in hda_codec_dai_prepare()
90 ret = snd_hda_codec_prepare(codec, stream_info, stream->stream_tag, format, substream); in hda_codec_dai_prepare()
92 dev_err(dai->dev, "codec prepare failed: %d\n", ret); in hda_codec_dai_prepare()