Lines Matching +full:dai +full:- +full:links

1 // SPDX-License-Identifier: GPL-2.0-only
2 // Copyright(c) 2018-2020 Intel Corporation.
20 #include <sound/soc-acpi.h>
22 #include "../common/soc-intel-quirks.h"
55 sof_pcm512x_quirk = (unsigned long)id->driver_data; in sof_pcm512x_quirk_cb()
64 DMI_MATCH(DMI_PRODUCT_NAME, "UP-CHT01"),
73 struct sof_card_private *ctx = snd_soc_card_get_drvdata(rtd->card); in sof_hdmi_init()
74 struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0); in sof_hdmi_init() local
77 pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL); in sof_hdmi_init()
79 return -ENOMEM; in sof_hdmi_init()
82 pcm->device = rtd->dai_link->id; in sof_hdmi_init()
83 pcm->codec_dai = dai; in sof_hdmi_init()
85 list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); in sof_hdmi_init()
92 struct snd_soc_component *codec = asoc_rtd_to_codec(rtd, 0)->component; in sof_pcm512x_codec_init()
105 struct snd_soc_component *codec = asoc_rtd_to_codec(rtd, 0)->component; in aif1_startup()
116 struct snd_soc_component *codec = asoc_rtd_to_codec(rtd, 0)->component; in aif1_shutdown()
143 if (list_empty(&ctx->hdmi_pcm_list)) in sof_card_late_probe()
144 return -EINVAL; in sof_card_late_probe()
146 if (!ctx->idisp_codec) in sof_card_late_probe()
149 pcm = list_first_entry(&ctx->hdmi_pcm_list, struct sof_hdmi_pcm, head); in sof_card_late_probe()
151 return hda_dsp_hdmi_build_controls(card, pcm->codec_dai->component); in sof_card_late_probe()
179 struct snd_soc_card *card = rtd->card; in dmic_init()
182 ret = snd_soc_dapm_new_controls(&card->dapm, dmic_widgets, in dmic_init()
185 dev_err(card->dev, "DMic widget addition failed: %d\n", ret); in dmic_init()
190 ret = snd_soc_dapm_add_routes(&card->dapm, dmic_map, in dmic_init()
194 dev_err(card->dev, "DMic map addition failed: %d\n", ret); in dmic_init()
214 DAILINK_COMP_ARRAY(COMP_CODEC("i2c-104C5122:00", "pcm512x-hifi")));
216 DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi")));
226 struct snd_soc_dai_link *links; in sof_card_dai_links_create() local
229 links = devm_kcalloc(dev, sof_audio_card_pcm512x.num_links, in sof_card_dai_links_create()
233 if (!links || !cpus) in sof_card_dai_links_create()
237 links[id].name = devm_kasprintf(dev, GFP_KERNEL, in sof_card_dai_links_create()
238 "SSP%d-Codec", ssp_codec); in sof_card_dai_links_create()
239 if (!links[id].name) in sof_card_dai_links_create()
242 links[id].id = id; in sof_card_dai_links_create()
243 links[id].codecs = pcm512x_component; in sof_card_dai_links_create()
244 links[id].num_codecs = ARRAY_SIZE(pcm512x_component); in sof_card_dai_links_create()
245 links[id].platforms = platform_component; in sof_card_dai_links_create()
246 links[id].num_platforms = ARRAY_SIZE(platform_component); in sof_card_dai_links_create()
247 links[id].init = sof_pcm512x_codec_init; in sof_card_dai_links_create()
248 links[id].ops = &sof_pcm512x_ops; in sof_card_dai_links_create()
249 links[id].dpcm_playback = 1; in sof_card_dai_links_create()
254 links[id].dpcm_capture = 1; in sof_card_dai_links_create()
255 links[id].no_pcm = 1; in sof_card_dai_links_create()
256 links[id].cpus = &cpus[id]; in sof_card_dai_links_create()
257 links[id].num_cpus = 1; in sof_card_dai_links_create()
259 links[id].cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, in sof_card_dai_links_create()
260 "ssp%d-port", in sof_card_dai_links_create()
262 if (!links[id].cpus->dai_name) in sof_card_dai_links_create()
265 links[id].cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, in sof_card_dai_links_create()
268 if (!links[id].cpus->dai_name) in sof_card_dai_links_create()
276 links[id].name = "dmic01"; in sof_card_dai_links_create()
277 links[id].cpus = &cpus[id]; in sof_card_dai_links_create()
278 links[id].cpus->dai_name = "DMIC01 Pin"; in sof_card_dai_links_create()
279 links[id].init = dmic_init; in sof_card_dai_links_create()
281 /* set up 2 BE links at most */ in sof_card_dai_links_create()
282 links[id + 1].name = "dmic16k"; in sof_card_dai_links_create()
283 links[id + 1].cpus = &cpus[id + 1]; in sof_card_dai_links_create()
284 links[id + 1].cpus->dai_name = "DMIC16k Pin"; in sof_card_dai_links_create()
290 links[id].id = id; in sof_card_dai_links_create()
291 links[id].num_cpus = 1; in sof_card_dai_links_create()
292 links[id].codecs = dmic_component; in sof_card_dai_links_create()
293 links[id].num_codecs = ARRAY_SIZE(dmic_component); in sof_card_dai_links_create()
294 links[id].platforms = platform_component; in sof_card_dai_links_create()
295 links[id].num_platforms = ARRAY_SIZE(platform_component); in sof_card_dai_links_create()
296 links[id].ignore_suspend = 1; in sof_card_dai_links_create()
297 links[id].dpcm_capture = 1; in sof_card_dai_links_create()
298 links[id].no_pcm = 1; in sof_card_dai_links_create()
311 links[id].name = devm_kasprintf(dev, GFP_KERNEL, in sof_card_dai_links_create()
313 if (!links[id].name) in sof_card_dai_links_create()
316 links[id].id = id; in sof_card_dai_links_create()
317 links[id].cpus = &cpus[id]; in sof_card_dai_links_create()
318 links[id].num_cpus = 1; in sof_card_dai_links_create()
319 links[id].cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, in sof_card_dai_links_create()
321 if (!links[id].cpus->dai_name) in sof_card_dai_links_create()
329 idisp_components[i - 1].name = "ehdaudio0D2"; in sof_card_dai_links_create()
330 idisp_components[i - 1].dai_name = in sof_card_dai_links_create()
332 "intel-hdmi-hifi%d", i); in sof_card_dai_links_create()
334 idisp_components[i - 1].name = "snd-soc-dummy"; in sof_card_dai_links_create()
335 idisp_components[i - 1].dai_name = "snd-soc-dummy-dai"; in sof_card_dai_links_create()
337 if (!idisp_components[i - 1].dai_name) in sof_card_dai_links_create()
340 links[id].codecs = &idisp_components[i - 1]; in sof_card_dai_links_create()
341 links[id].num_codecs = 1; in sof_card_dai_links_create()
342 links[id].platforms = platform_component; in sof_card_dai_links_create()
343 links[id].num_platforms = ARRAY_SIZE(platform_component); in sof_card_dai_links_create()
344 links[id].init = sof_hdmi_init; in sof_card_dai_links_create()
345 links[id].dpcm_playback = 1; in sof_card_dai_links_create()
346 links[id].no_pcm = 1; in sof_card_dai_links_create()
350 return links; in sof_card_dai_links_create()
357 struct snd_soc_acpi_mach *mach = pdev->dev.platform_data; in sof_audio_probe()
363 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); in sof_audio_probe()
365 return -ENOMEM; in sof_audio_probe()
375 if (mach->mach_params.common_hdmi_codec_drv && in sof_audio_probe()
376 (mach->mach_params.codec_mask & IDISP_CODEC_MASK)) in sof_audio_probe()
377 ctx->idisp_codec = true; in sof_audio_probe()
379 /* links are always present in topology */ in sof_audio_probe()
385 dev_dbg(&pdev->dev, "sof_pcm512x_quirk = %lx\n", sof_pcm512x_quirk); in sof_audio_probe()
392 /* compute number of dai links */ in sof_audio_probe()
395 dai_links = sof_card_dai_links_create(&pdev->dev, ssp_codec, in sof_audio_probe()
397 ctx->idisp_codec); in sof_audio_probe()
399 return -ENOMEM; in sof_audio_probe()
403 INIT_LIST_HEAD(&ctx->hdmi_pcm_list); in sof_audio_probe()
405 sof_audio_card_pcm512x.dev = &pdev->dev; in sof_audio_probe()
409 mach->mach_params.platform); in sof_audio_probe()
415 return devm_snd_soc_register_card(&pdev->dev, in sof_audio_probe()
425 if (!strcmp(component->name, pcm512x_component[0].name)) { in sof_pcm512x_remove()
445 MODULE_AUTHOR("Pierre-Louis Bossart");