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

1 // SPDX-License-Identifier: GPL-2.0-only
20 #include <sound/soc-acpi.h>
22 #include "../common/soc-intel-quirks.h"
67 struct sof_card_private *ctx = snd_soc_card_get_drvdata(rtd->card); in sof_hdmi_init()
68 struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0); in sof_hdmi_init() local
71 pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL); in sof_hdmi_init()
73 return -ENOMEM; in sof_hdmi_init()
76 pcm->device = rtd->dai_link->id; in sof_hdmi_init()
77 pcm->codec_dai = dai; in sof_hdmi_init()
79 list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); in sof_hdmi_init()
97 struct sof_card_private *ctx = snd_soc_card_get_drvdata(rtd->card); in sof_nau8825_codec_init()
98 struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; in sof_nau8825_codec_init()
107 ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack", in sof_nau8825_codec_init()
111 &ctx->sof_headset, in sof_nau8825_codec_init()
115 dev_err(rtd->dev, "Headset Jack creation failed: %d\n", ret); in sof_nau8825_codec_init()
119 jack = &ctx->sof_headset; in sof_nau8825_codec_init()
121 snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE); in sof_nau8825_codec_init()
122 snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND); in sof_nau8825_codec_init()
123 snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); in sof_nau8825_codec_init()
124 snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); in sof_nau8825_codec_init()
128 dev_err(rtd->dev, "Headset Jack call-back failed: %d\n", ret); in sof_nau8825_codec_init()
137 struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; in sof_nau8825_codec_exit()
152 dev_err(rtd->dev, "get bclk freq failed: %d\n", clk_freq); in sof_nau8825_hw_params()
153 return -EINVAL; in sof_nau8825_hw_params()
160 dev_err(codec_dai->dev, "can't set BCLK clock %d\n", ret); in sof_nau8825_hw_params()
168 dev_err(codec_dai->dev, "can't set BCLK: %d\n", ret); in sof_nau8825_hw_params()
189 struct snd_soc_dapm_context *dapm = &card->dapm; in sof_card_late_probe()
202 if (list_empty(&ctx->hdmi_pcm_list)) in sof_card_late_probe()
203 return -EINVAL; in sof_card_late_probe()
205 pcm = list_first_entry(&ctx->hdmi_pcm_list, struct sof_hdmi_pcm, head); in sof_card_late_probe()
207 return hda_dsp_hdmi_build_controls(card, pcm->codec_dai->component); in sof_card_late_probe()
237 /* HP jack connectors - unknown if we have jack detection */
257 struct snd_soc_card *card = rtd->card; in speaker_codec_init()
260 ret = snd_soc_dapm_new_controls(&card->dapm, speaker_widgets, in speaker_codec_init()
263 dev_err(rtd->dev, "unable to add dapm controls, ret %d\n", ret); in speaker_codec_init()
271 dev_err(rtd->dev, "unable to add card controls, ret %d\n", ret); in speaker_codec_init()
275 ret = snd_soc_dapm_add_routes(&card->dapm, speaker_map, in speaker_codec_init()
279 dev_err(rtd->dev, "Speaker map addition failed: %d\n", ret); in speaker_codec_init()
285 struct snd_soc_card *card = rtd->card; in dmic_init()
288 ret = snd_soc_dapm_new_controls(&card->dapm, dmic_widgets, in dmic_init()
291 dev_err(card->dev, "DMic widget addition failed: %d\n", ret); in dmic_init()
296 ret = snd_soc_dapm_add_routes(&card->dapm, dmic_map, in dmic_init()
300 dev_err(card->dev, "DMic map addition failed: %d\n", ret); in dmic_init()
307 .name = "nau8825", /* the sof- prefix is added by the core */
321 .name = "i2c-10508825:00",
322 .dai_name = "nau8825-hifi",
328 .name = "dmic-codec",
329 .dai_name = "dmic-hifi",
342 .name = "snd-soc-dummy",
343 .dai_name = "snd-soc-dummy-dai",
355 struct snd_soc_dai_link *links; in sof_card_dai_links_create() local
358 links = devm_kcalloc(dev, sof_audio_card_nau8825.num_links, in sof_card_dai_links_create()
362 if (!links || !cpus) in sof_card_dai_links_create()
366 links[id].name = devm_kasprintf(dev, GFP_KERNEL, in sof_card_dai_links_create()
367 "SSP%d-Codec", ssp_codec); in sof_card_dai_links_create()
368 if (!links[id].name) in sof_card_dai_links_create()
371 links[id].id = id; in sof_card_dai_links_create()
372 links[id].codecs = nau8825_component; in sof_card_dai_links_create()
373 links[id].num_codecs = ARRAY_SIZE(nau8825_component); in sof_card_dai_links_create()
374 links[id].platforms = platform_component; in sof_card_dai_links_create()
375 links[id].num_platforms = ARRAY_SIZE(platform_component); in sof_card_dai_links_create()
376 links[id].init = sof_nau8825_codec_init; in sof_card_dai_links_create()
377 links[id].exit = sof_nau8825_codec_exit; in sof_card_dai_links_create()
378 links[id].ops = &sof_nau8825_ops; in sof_card_dai_links_create()
379 links[id].dpcm_playback = 1; in sof_card_dai_links_create()
380 links[id].dpcm_capture = 1; in sof_card_dai_links_create()
381 links[id].no_pcm = 1; in sof_card_dai_links_create()
382 links[id].cpus = &cpus[id]; in sof_card_dai_links_create()
383 links[id].num_cpus = 1; in sof_card_dai_links_create()
385 links[id].cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, in sof_card_dai_links_create()
388 if (!links[id].cpus->dai_name) in sof_card_dai_links_create()
396 links[id].name = "dmic01"; in sof_card_dai_links_create()
397 links[id].cpus = &cpus[id]; in sof_card_dai_links_create()
398 links[id].cpus->dai_name = "DMIC01 Pin"; in sof_card_dai_links_create()
399 links[id].init = dmic_init; in sof_card_dai_links_create()
401 /* set up 2 BE links at most */ in sof_card_dai_links_create()
402 links[id + 1].name = "dmic16k"; in sof_card_dai_links_create()
403 links[id + 1].cpus = &cpus[id + 1]; in sof_card_dai_links_create()
404 links[id + 1].cpus->dai_name = "DMIC16k Pin"; in sof_card_dai_links_create()
410 links[id].id = id; in sof_card_dai_links_create()
411 links[id].num_cpus = 1; in sof_card_dai_links_create()
412 links[id].codecs = dmic_component; in sof_card_dai_links_create()
413 links[id].num_codecs = ARRAY_SIZE(dmic_component); in sof_card_dai_links_create()
414 links[id].platforms = platform_component; in sof_card_dai_links_create()
415 links[id].num_platforms = ARRAY_SIZE(platform_component); in sof_card_dai_links_create()
416 links[id].ignore_suspend = 1; in sof_card_dai_links_create()
417 links[id].dpcm_capture = 1; in sof_card_dai_links_create()
418 links[id].no_pcm = 1; in sof_card_dai_links_create()
432 links[id].name = devm_kasprintf(dev, GFP_KERNEL, in sof_card_dai_links_create()
434 if (!links[id].name) in sof_card_dai_links_create()
437 links[id].id = id; in sof_card_dai_links_create()
438 links[id].cpus = &cpus[id]; in sof_card_dai_links_create()
439 links[id].num_cpus = 1; in sof_card_dai_links_create()
440 links[id].cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, in sof_card_dai_links_create()
442 if (!links[id].cpus->dai_name) in sof_card_dai_links_create()
445 idisp_components[i - 1].name = "ehdaudio0D2"; in sof_card_dai_links_create()
446 idisp_components[i - 1].dai_name = devm_kasprintf(dev, in sof_card_dai_links_create()
448 "intel-hdmi-hifi%d", in sof_card_dai_links_create()
450 if (!idisp_components[i - 1].dai_name) in sof_card_dai_links_create()
453 links[id].codecs = &idisp_components[i - 1]; in sof_card_dai_links_create()
454 links[id].num_codecs = 1; in sof_card_dai_links_create()
455 links[id].platforms = platform_component; in sof_card_dai_links_create()
456 links[id].num_platforms = ARRAY_SIZE(platform_component); in sof_card_dai_links_create()
457 links[id].init = sof_hdmi_init; in sof_card_dai_links_create()
458 links[id].dpcm_playback = 1; in sof_card_dai_links_create()
459 links[id].no_pcm = 1; in sof_card_dai_links_create()
465 links[id].name = devm_kasprintf(dev, GFP_KERNEL, in sof_card_dai_links_create()
466 "SSP%d-Codec", ssp_amp); in sof_card_dai_links_create()
467 if (!links[id].name) in sof_card_dai_links_create()
470 links[id].id = id; in sof_card_dai_links_create()
472 links[id].codecs = rt1019p_component; in sof_card_dai_links_create()
473 links[id].num_codecs = ARRAY_SIZE(rt1019p_component); in sof_card_dai_links_create()
474 links[id].init = speaker_codec_init; in sof_card_dai_links_create()
477 links[id].codecs = max_98373_components; in sof_card_dai_links_create()
478 links[id].num_codecs = ARRAY_SIZE(max_98373_components); in sof_card_dai_links_create()
479 links[id].init = max_98373_spk_codec_init; in sof_card_dai_links_create()
480 links[id].ops = &max_98373_ops; in sof_card_dai_links_create()
482 links[id].dpcm_capture = 1; in sof_card_dai_links_create()
485 max_98360a_dai_link(&links[id]); in sof_card_dai_links_create()
490 links[id].platforms = platform_component; in sof_card_dai_links_create()
491 links[id].num_platforms = ARRAY_SIZE(platform_component); in sof_card_dai_links_create()
492 links[id].dpcm_playback = 1; in sof_card_dai_links_create()
493 links[id].no_pcm = 1; in sof_card_dai_links_create()
494 links[id].cpus = &cpus[id]; in sof_card_dai_links_create()
495 links[id].num_cpus = 1; in sof_card_dai_links_create()
496 links[id].cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, in sof_card_dai_links_create()
499 if (!links[id].cpus->dai_name) in sof_card_dai_links_create()
509 links[id].id = id; in sof_card_dai_links_create()
510 links[id].cpus = &cpus[id]; in sof_card_dai_links_create()
511 links[id].cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, in sof_card_dai_links_create()
513 if (!links[id].cpus->dai_name) in sof_card_dai_links_create()
515 links[id].name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-BT", port); in sof_card_dai_links_create()
516 if (!links[id].name) in sof_card_dai_links_create()
518 links[id].codecs = dummy_component; in sof_card_dai_links_create()
519 links[id].num_codecs = ARRAY_SIZE(dummy_component); in sof_card_dai_links_create()
520 links[id].platforms = platform_component; in sof_card_dai_links_create()
521 links[id].num_platforms = ARRAY_SIZE(platform_component); in sof_card_dai_links_create()
522 links[id].dpcm_playback = 1; in sof_card_dai_links_create()
523 links[id].dpcm_capture = 1; in sof_card_dai_links_create()
524 links[id].no_pcm = 1; in sof_card_dai_links_create()
525 links[id].num_cpus = 1; in sof_card_dai_links_create()
528 return links; in sof_card_dai_links_create()
541 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); in sof_audio_probe()
543 return -ENOMEM; in sof_audio_probe()
545 if (pdev->id_entry && pdev->id_entry->driver_data) in sof_audio_probe()
546 sof_nau8825_quirk = (unsigned long)pdev->id_entry->driver_data; in sof_audio_probe()
548 mach = pdev->dev.platform_data; in sof_audio_probe()
553 if ((sof_nau8825_quirk & SOF_SPEAKER_AMP_PRESENT) && !mach->quirk_data) in sof_audio_probe()
556 dev_dbg(&pdev->dev, "sof_nau8825_quirk = %lx\n", sof_nau8825_quirk); in sof_audio_probe()
558 /* default number of DMIC DAI's */ in sof_audio_probe()
562 /* default number of HDMI DAI's */ in sof_audio_probe()
571 /* compute number of dai links */ in sof_audio_probe()
583 dai_links = sof_card_dai_links_create(&pdev->dev, ssp_codec, ssp_amp, in sof_audio_probe()
586 return -ENOMEM; in sof_audio_probe()
590 INIT_LIST_HEAD(&ctx->hdmi_pcm_list); in sof_audio_probe()
592 sof_audio_card_nau8825.dev = &pdev->dev; in sof_audio_probe()
596 mach->mach_params.platform); in sof_audio_probe()
602 return devm_snd_soc_register_card(&pdev->dev, in sof_audio_probe()