Lines Matching full:dai
36 avs_dai_find_path_template(struct snd_soc_dai *dai, bool is_fe, int direction) in avs_dai_find_path_template() argument
38 struct snd_soc_dapm_widget *dw = snd_soc_dai_get_widget(dai, direction); in avs_dai_find_path_template()
58 static int avs_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai, bool is_fe, in avs_dai_startup() argument
62 struct avs_dev *adev = to_avs_dev(dai->dev); in avs_dai_startup()
66 template = avs_dai_find_path_template(dai, is_fe, substream->stream); in avs_dai_startup()
68 dev_err(dai->dev, "no %s path for dai %s, invalid tplg?\n", in avs_dai_startup()
69 snd_pcm_stream_str(substream), dai->name); in avs_dai_startup()
79 snd_soc_dai_set_dma_data(dai, substream, data); in avs_dai_startup()
89 struct snd_pcm_hw_params *be_hw_params, struct snd_soc_dai *dai, in avs_dai_hw_params() argument
94 struct avs_dev *adev = to_avs_dev(dai->dev); in avs_dai_hw_params()
97 data = snd_soc_dai_get_dma_data(dai, substream); in avs_dai_hw_params()
99 dev_dbg(dai->dev, "%s FE hw_params str %p rtd %p", in avs_dai_hw_params()
101 dev_dbg(dai->dev, "rate %d chn %d vbd %d bd %d\n", in avs_dai_hw_params()
105 dev_dbg(dai->dev, "%s BE hw_params str %p rtd %p", in avs_dai_hw_params()
107 dev_dbg(dai->dev, "rate %d chn %d vbd %d bd %d\n", in avs_dai_hw_params()
114 dev_err(dai->dev, "create path failed: %d\n", ret); in avs_dai_hw_params()
123 struct snd_pcm_hw_params *be_hw_params, struct snd_soc_dai *dai, in avs_dai_be_hw_params() argument
136 return avs_dai_hw_params(substream, fe_hw_params, be_hw_params, dai, dma_id); in avs_dai_be_hw_params()
140 struct snd_soc_dai *dai) in avs_dai_prepare() argument
145 data = snd_soc_dai_get_dma_data(dai, substream); in avs_dai_prepare()
151 dev_err(dai->dev, "reset path failed: %d\n", ret); in avs_dai_prepare()
157 dev_err(dai->dev, "pause path failed: %d\n", ret); in avs_dai_prepare()
163 static int avs_dai_nonhda_be_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in avs_dai_nonhda_be_startup() argument
165 return avs_dai_startup(substream, dai, false, &avs_dai_nonhda_be_ops); in avs_dai_nonhda_be_startup()
168 static void avs_dai_nonhda_be_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in avs_dai_nonhda_be_shutdown() argument
171 struct avs_dev *adev = to_avs_dev(dai->dev); in avs_dai_nonhda_be_shutdown()
177 data = snd_soc_dai_get_dma_data(dai, substream); in avs_dai_nonhda_be_shutdown()
179 snd_soc_dai_set_dma_data(dai, substream, NULL); in avs_dai_nonhda_be_shutdown()
184 struct snd_pcm_hw_params *hw_params, struct snd_soc_dai *dai) in avs_dai_nonhda_be_hw_params() argument
188 data = snd_soc_dai_get_dma_data(dai, substream); in avs_dai_nonhda_be_hw_params()
193 return avs_dai_be_hw_params(substream, hw_params, dai, 0); in avs_dai_nonhda_be_hw_params()
196 static int avs_dai_nonhda_be_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in avs_dai_nonhda_be_hw_free() argument
200 dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name); in avs_dai_nonhda_be_hw_free()
202 data = snd_soc_dai_get_dma_data(dai, substream); in avs_dai_nonhda_be_hw_free()
211 static int avs_dai_nonhda_be_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in avs_dai_nonhda_be_prepare() argument
213 return avs_dai_prepare(to_avs_dev(dai->dev), substream, dai); in avs_dai_nonhda_be_prepare()
217 struct snd_soc_dai *dai) in avs_dai_nonhda_be_trigger() argument
223 data = snd_soc_dai_get_dma_data(dai, substream); in avs_dai_nonhda_be_trigger()
234 dev_err(dai->dev, "pause BE path failed: %d\n", ret); in avs_dai_nonhda_be_trigger()
240 dev_err(dai->dev, "run BE path failed: %d\n", ret); in avs_dai_nonhda_be_trigger()
251 dev_err(dai->dev, "pause BE path failed: %d\n", ret); in avs_dai_nonhda_be_trigger()
255 dev_err(dai->dev, "reset BE path failed: %d\n", ret); in avs_dai_nonhda_be_trigger()
277 static int avs_dai_hda_be_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in avs_dai_hda_be_startup() argument
279 return avs_dai_startup(substream, dai, false, &avs_dai_hda_be_ops); in avs_dai_hda_be_startup()
282 static void avs_dai_hda_be_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in avs_dai_hda_be_shutdown() argument
284 return avs_dai_nonhda_be_shutdown(substream, dai); in avs_dai_hda_be_shutdown()
288 struct snd_pcm_hw_params *hw_params, struct snd_soc_dai *dai) in avs_dai_hda_be_hw_params() argument
293 data = snd_soc_dai_get_dma_data(dai, substream); in avs_dai_hda_be_hw_params()
299 return avs_dai_be_hw_params(substream, hw_params, dai, in avs_dai_hda_be_hw_params()
303 static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in avs_dai_hda_be_hw_free() argument
311 dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name); in avs_dai_hda_be_hw_free()
313 data = snd_soc_dai_get_dma_data(dai, substream); in avs_dai_hda_be_hw_free()
334 static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in avs_dai_hda_be_prepare() argument
364 ret = avs_dai_prepare(to_avs_dev(dai->dev), substream, dai); in avs_dai_hda_be_prepare()
373 struct snd_soc_dai *dai) in avs_dai_hda_be_trigger() argument
380 dev_dbg(dai->dev, "entry %s cmd=%d\n", __func__, cmd); in avs_dai_hda_be_trigger()
382 data = snd_soc_dai_get_dma_data(dai, substream); in avs_dai_hda_be_trigger()
396 dev_err(dai->dev, "pause BE path failed: %d\n", ret); in avs_dai_hda_be_trigger()
402 dev_err(dai->dev, "run BE path failed: %d\n", ret); in avs_dai_hda_be_trigger()
413 dev_err(dai->dev, "pause BE path failed: %d\n", ret); in avs_dai_hda_be_trigger()
419 dev_err(dai->dev, "reset BE path failed: %d\n", ret); in avs_dai_hda_be_trigger()
454 static int avs_dai_fe_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in avs_dai_fe_startup() argument
458 struct avs_dev *adev = to_avs_dev(dai->dev); in avs_dai_fe_startup()
463 ret = avs_dai_startup(substream, dai, true, &avs_dai_fe_ops); in avs_dai_fe_startup()
467 data = snd_soc_dai_get_dma_data(dai, substream); in avs_dai_fe_startup()
491 dev_dbg(dai->dev, "%s fe STARTUP tag %d str %p", in avs_dai_fe_startup()
501 static void avs_dai_fe_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in avs_dai_fe_shutdown() argument
504 struct avs_dev *adev = to_avs_dev(dai->dev); in avs_dai_fe_shutdown()
510 data = snd_soc_dai_get_dma_data(dai, substream); in avs_dai_fe_shutdown()
512 snd_soc_dai_set_dma_data(dai, substream, NULL); in avs_dai_fe_shutdown()
518 struct snd_pcm_hw_params *hw_params, struct snd_soc_dai *dai) in avs_dai_fe_hw_params() argument
527 data = snd_soc_dai_get_dma_data(dai, substream); in avs_dai_fe_hw_params()
543 ret = avs_dai_hw_params(substream, hw_params, be_hw_params, dai, in avs_dai_fe_hw_params()
550 dev_err(dai->dev, "bind FE <-> BE failed: %d\n", ret); in avs_dai_fe_hw_params()
564 static int __avs_dai_fe_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in __avs_dai_fe_hw_free() argument
570 dev_dbg(dai->dev, "%s fe HW_FREE str %p rtd %p", in __avs_dai_fe_hw_free()
573 data = snd_soc_dai_get_dma_data(dai, substream); in __avs_dai_fe_hw_free()
581 dev_err(dai->dev, "unbind FE <-> BE failed: %d\n", ret); in __avs_dai_fe_hw_free()
591 static int avs_dai_fe_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in avs_dai_fe_hw_free() argument
595 ret = __avs_dai_fe_hw_free(substream, dai); in avs_dai_fe_hw_free()
601 static int avs_dai_fe_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in avs_dai_fe_prepare() argument
605 struct avs_dev *adev = to_avs_dev(dai->dev); in avs_dai_fe_prepare()
611 data = snd_soc_dai_get_dma_data(dai, substream); in avs_dai_fe_prepare()
632 ret = avs_dai_prepare(adev, substream, dai); in avs_dai_fe_prepare()
640 static int avs_dai_fe_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) in avs_dai_fe_trigger() argument
649 data = snd_soc_dai_get_dma_data(dai, substream); in avs_dai_fe_trigger()
670 dev_err(dai->dev, "pause FE path failed: %d\n", ret); in avs_dai_fe_trigger()
676 dev_err(dai->dev, "run FE path failed: %d\n", ret); in avs_dai_fe_trigger()
688 dev_err(dai->dev, "pause FE path failed: %d\n", ret); in avs_dai_fe_trigger()
696 dev_err(dai->dev, "reset FE path failed: %d\n", ret); in avs_dai_fe_trigger()
865 static int avs_dai_resume_hw_params(struct snd_soc_dai *dai, struct avs_dma_data *data) in avs_dai_resume_hw_params() argument
874 ret = dai->driver->ops->hw_params(substream, &rtd->dpcm[substream->stream].hw_params, dai); in avs_dai_resume_hw_params()
876 dev_err(dai->dev, "hw_params on resume failed: %d\n", ret); in avs_dai_resume_hw_params()
881 static int avs_dai_resume_fe_prepare(struct snd_soc_dai *dai, struct avs_dma_data *data) in avs_dai_resume_fe_prepare() argument
895 ret = dai->driver->ops->prepare(data->substream, dai); in avs_dai_resume_fe_prepare()
897 dev_err(dai->dev, "prepare FE on resume failed: %d\n", ret); in avs_dai_resume_fe_prepare()
913 static int avs_dai_resume_be_prepare(struct snd_soc_dai *dai, struct avs_dma_data *data) in avs_dai_resume_be_prepare() argument
917 ret = dai->driver->ops->prepare(data->substream, dai); in avs_dai_resume_be_prepare()
919 dev_err(dai->dev, "prepare BE on resume failed: %d\n", ret); in avs_dai_resume_be_prepare()
924 static int avs_dai_suspend_fe_hw_free(struct snd_soc_dai *dai, struct avs_dma_data *data) in avs_dai_suspend_fe_hw_free() argument
938 ret = __avs_dai_fe_hw_free(data->substream, dai); in avs_dai_suspend_fe_hw_free()
940 dev_err(dai->dev, "hw_free FE on suspend failed: %d\n", ret); in avs_dai_suspend_fe_hw_free()
945 static int avs_dai_suspend_be_hw_free(struct snd_soc_dai *dai, struct avs_dma_data *data) in avs_dai_suspend_be_hw_free() argument
949 ret = dai->driver->ops->hw_free(data->substream, dai); in avs_dai_suspend_be_hw_free()
951 dev_err(dai->dev, "hw_free BE on suspend failed: %d\n", ret); in avs_dai_suspend_be_hw_free()
961 struct snd_soc_dai *dai; in avs_component_pm_op() local
964 for_each_component_dais(component, dai) { in avs_component_pm_op()
965 data = snd_soc_dai_dma_data_get_playback(dai); in avs_component_pm_op()
969 ret = op(dai, data); in avs_component_pm_op()
978 data = snd_soc_dai_dma_data_get_capture(dai); in avs_component_pm_op()
982 ret = op(dai, data); in avs_component_pm_op()
1002 int (*prepare_cb)(struct snd_soc_dai *dai, struct avs_dma_data *data); in avs_component_resume_prepare()
1014 int (*hw_free_cb)(struct snd_soc_dai *dai, struct avs_dma_data *data); in avs_component_suspend_hw_free()
1086 /* only FE DAI links are handled here */ in avs_component_open()
1132 struct snd_soc_dai *dai = asoc_rtd_to_cpu(rtd, 0); in avs_component_construct() local
1135 if (dai->driver->playback.channels_min) in avs_component_construct()
1140 if (dai->driver->capture.channels_min) in avs_component_construct()
1240 struct snd_soc_dai_driver *cpus, *dai; in avs_i2s_platform_register() local
1254 dai = cpus; in avs_i2s_platform_register()
1256 memcpy(dai, &i2s_dai_template, sizeof(*dai)); in avs_i2s_platform_register()
1258 dai->name = in avs_i2s_platform_register()
1260 dai->playback.stream_name = in avs_i2s_platform_register()
1262 dai->capture.stream_name = in avs_i2s_platform_register()
1265 if (!dai->name || !dai->playback.stream_name || !dai->capture.stream_name) in avs_i2s_platform_register()
1267 dai++; in avs_i2s_platform_register()
1275 memcpy(dai, &i2s_dai_template, sizeof(*dai)); in avs_i2s_platform_register()
1277 dai->name = in avs_i2s_platform_register()
1279 dai->playback.stream_name = in avs_i2s_platform_register()
1281 dai->capture.stream_name = in avs_i2s_platform_register()
1284 if (!dai->name || !dai->playback.stream_name || !dai->capture.stream_name) in avs_i2s_platform_register()
1286 dai++; in avs_i2s_platform_register()
1294 /* HD-Audio CPU DAI template */
1318 struct snd_soc_dai *dai, *save; in avs_component_hda_unregister_dais() local
1326 for_each_component_dais_safe(component, dai, save) { in avs_component_hda_unregister_dais()
1329 if (!strstr(dai->driver->name, name)) in avs_component_hda_unregister_dais()
1333 snd_soc_dapm_free_widget(snd_soc_dai_get_widget(dai, stream)); in avs_component_hda_unregister_dais()
1335 snd_soc_unregister_dai(dai); in avs_component_hda_unregister_dais()
1369 struct snd_soc_dai *dai; in avs_component_hda_probe() local
1400 dai = snd_soc_register_dai(component, &dais[i], false); in avs_component_hda_probe()
1401 if (!dai) { in avs_component_hda_probe()
1402 dev_err(component->dev, "register dai for %s failed\n", in avs_component_hda_probe()
1408 ret = snd_soc_dapm_new_dai_widgets(dapm, dai); in avs_component_hda_probe()
1483 /* only BE DAI links are handled here */ in avs_component_hda_close()