Lines Matching +full:audio +full:- +full:tx

1 // SPDX-License-Identifier: GPL-2.0-only
19 #include <sound/soc-acpi.h>
28 #define RT5682_DAI_NAME "rt5682-aif1"
29 #define RT5682S_DAI_NAME "rt5682s-aif1"
31 #define RT5682_DEV0_NAME "i2c-10EC5682:00"
32 #define RT5682S_DEV0_NAME "i2c-RTL5682:00"
93 /* HP jack connectors - unknown if we have jack detection */
107 { "HiFi Playback", NULL, "ssp1 Tx" },
108 { "ssp1 Tx", NULL, "codec0_out" },
110 { "AIF1 Playback", NULL, "ssp2 Tx" },
111 { "ssp2 Tx", NULL, "codec1_out" },
116 { "HDMI1", NULL, "hif5-0 Output" },
117 { "HDMI2", NULL, "hif6-0 Output" },
118 { "HDMI2", NULL, "hif7-0 Output" },
120 { "hifi3", NULL, "iDisp3 Tx" },
121 { "iDisp3 Tx", NULL, "iDisp3_out" },
122 { "hifi2", NULL, "iDisp2 Tx" },
123 { "iDisp2 Tx", NULL, "iDisp2_out" },
124 { "hifi1", NULL, "iDisp1 Tx" },
125 { "iDisp1 Tx", NULL, "iDisp1_out" },
142 rate->min = rate->max = 48000; in geminilake_ssp_fixup()
143 chan->min = chan->max = DUAL_CHANNEL; in geminilake_ssp_fixup()
154 struct glk_card_private *ctx = snd_soc_card_get_drvdata(rtd->card); in geminilake_rt5682_codec_init()
155 struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; in geminilake_rt5682_codec_init()
160 if (ctx->is_rt5682s) { in geminilake_rt5682_codec_init()
173 dev_err(rtd->dev, "can't set codec pll: %d\n", ret); in geminilake_rt5682_codec_init()
181 dev_err(rtd->dev, "snd_soc_dai_set_sysclk err = %d\n", ret); in geminilake_rt5682_codec_init()
187 ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack", in geminilake_rt5682_codec_init()
190 &ctx->geminilake_headset, in geminilake_rt5682_codec_init()
194 dev_err(rtd->dev, "Headset Jack creation failed: %d\n", ret); in geminilake_rt5682_codec_init()
198 jack = &ctx->geminilake_headset; in geminilake_rt5682_codec_init()
200 snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE); in geminilake_rt5682_codec_init()
201 snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND); in geminilake_rt5682_codec_init()
202 snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); in geminilake_rt5682_codec_init()
203 snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); in geminilake_rt5682_codec_init()
208 dev_err(rtd->dev, "Headset Jack call-back failed: %d\n", ret); in geminilake_rt5682_codec_init()
225 dev_err(rtd->dev, "set TDM slot err:%d\n", ret); in geminilake_rt5682_hw_params()
238 struct glk_card_private *ctx = snd_soc_card_get_drvdata(rtd->card); in geminilake_hdmi_init()
242 pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL); in geminilake_hdmi_init()
244 return -ENOMEM; in geminilake_hdmi_init()
246 pcm->device = GLK_DPCM_AUDIO_HDMI1_PB + dai->id; in geminilake_hdmi_init()
247 pcm->codec_dai = dai; in geminilake_hdmi_init()
249 list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); in geminilake_hdmi_init()
256 struct snd_soc_component *component = asoc_rtd_to_cpu(rtd, 0)->component; in geminilake_rt5682_fe_init()
263 dev_err(rtd->dev, "Ref Cap ignore suspend failed %d\n", ret); in geminilake_rt5682_fe_init()
299 chan->min = chan->max = 4; in geminilake_dmic_fixup()
306 struct snd_pcm_runtime *runtime = substream->runtime; in geminilake_dmic_startup()
308 runtime->hw.channels_min = runtime->hw.channels_max = QUAD_CHANNEL; in geminilake_dmic_startup()
312 return snd_pcm_hw_constraint_list(substream->runtime, 0, in geminilake_dmic_startup()
331 return snd_pcm_hw_constraint_list(substream->runtime, 0, in geminilake_refcap_startup()
385 DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi")));
390 DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi1")));
395 DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi2")));
400 DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi3")));
405 /* geminilake digital audio interface glue - connects codec <--> CPU */
409 .name = "Glk Audio Port",
410 .stream_name = "Audio",
420 .name = "Glk Audio Capture Port",
421 .stream_name = "Audio Record",
430 .name = "Glk Audio Headset Playback",
431 .stream_name = "Headset Audio",
438 .name = "Glk Audio Echo Reference cap",
447 .name = "Glk Audio Reference cap",
457 .name = "Glk Audio DMIC cap",
501 /* SSP1 - Codec */
502 .name = "SSP1-Codec",
514 /* SSP2 - Codec */
515 .name = "SSP2-Codec",
572 if (list_empty(&ctx->hdmi_pcm_list)) in glk_card_late_probe()
573 return -EINVAL; in glk_card_late_probe()
575 if (ctx->common_hdmi_codec_drv) { in glk_card_late_probe()
576 pcm = list_first_entry(&ctx->hdmi_pcm_list, struct glk_hdmi_pcm, in glk_card_late_probe()
578 component = pcm->codec_dai->component; in glk_card_late_probe()
582 list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { in glk_card_late_probe()
583 component = pcm->codec_dai->component; in glk_card_late_probe()
585 "HDMI/DP, pcm=%d Jack", pcm->device); in glk_card_late_probe()
592 err = hdac_hdmi_jack_init(pcm->codec_dai, pcm->device, in glk_card_late_probe()
600 return hdac_hdmi_jack_port_init(component, &card->dapm); in glk_card_late_probe()
603 /* geminilake audio machine driver for SPT + RT5682 */
627 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); in geminilake_audio_probe()
629 return -ENOMEM; in geminilake_audio_probe()
632 if (acpi_dev_present("RTL5682", NULL, -1)) { in geminilake_audio_probe()
633 /* ALC5682I-VS is detected */ in geminilake_audio_probe()
634 ctx->is_rt5682s = 1; in geminilake_audio_probe()
637 if (strcmp(geminilake_dais[i].name, "SSP2-Codec")) in geminilake_audio_probe()
647 INIT_LIST_HEAD(&ctx->hdmi_pcm_list); in geminilake_audio_probe()
650 card->dev = &pdev->dev; in geminilake_audio_probe()
652 if (!snd_soc_acpi_sof_parent(&pdev->dev)) in geminilake_audio_probe()
653 card->disable_route_checks = true; in geminilake_audio_probe()
656 mach = pdev->dev.platform_data; in geminilake_audio_probe()
657 platform_name = mach->mach_params.platform; in geminilake_audio_probe()
663 ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv; in geminilake_audio_probe()
665 return devm_snd_soc_register_card(&pdev->dev, card); in geminilake_audio_probe()
689 MODULE_DESCRIPTION("Geminilake Audio Machine driver-RT5682 & MAX98357A in I2S mode");