Lines Matching +full:tdm +full:- +full:data +full:- +full:pair
1 // SPDX-License-Identifier: GPL-2.0-only
21 #include <sound/soc-acpi.h>
29 #define CML_RT1011_CODEC_DAI "rt1011-aif"
30 #define CML_RT5682_CODEC_DAI "rt5682-aif1"
44 sof_rt1011_quirk = (unsigned long)id->driver_data; in sof_rt1011_quirk_cb()
107 /* HP jack connectors - unknown if we have jack detection */
137 struct card_private *ctx = snd_soc_card_get_drvdata(rtd->card); in cml_rt5682_codec_init()
138 struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; in cml_rt5682_codec_init()
151 ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack", in cml_rt5682_codec_init()
155 &ctx->headset, in cml_rt5682_codec_init()
159 dev_err(rtd->dev, "Headset Jack creation failed: %d\n", ret); in cml_rt5682_codec_init()
163 jack = &ctx->headset; in cml_rt5682_codec_init()
165 snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE); in cml_rt5682_codec_init()
166 snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND); in cml_rt5682_codec_init()
167 snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); in cml_rt5682_codec_init()
168 snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); in cml_rt5682_codec_init()
171 dev_err(rtd->dev, "Headset Jack call-back failed: %d\n", ret); in cml_rt5682_codec_init()
178 struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; in cml_rt5682_codec_exit()
186 struct snd_soc_card *card = rtd->card; in cml_rt1011_spk_init()
196 ret = snd_soc_dapm_new_controls(&card->dapm, in cml_rt1011_spk_init()
202 ret = snd_soc_dapm_add_routes(&card->dapm, cml_rt1011_tt_map, in cml_rt1011_spk_init()
226 dev_warn(rtd->dev, "snd_soc_dai_set_pll err = %d\n", ret); in cml_rt5682_hw_params()
232 dev_warn(rtd->dev, "snd_soc_dai_set_sysclk err = %d\n", ret); in cml_rt5682_hw_params()
235 * slot_width should be equal or large than data length, set them in cml_rt5682_hw_params()
241 dev_warn(rtd->dev, "set TDM slot err:%d\n", ret); in cml_rt5682_hw_params()
250 struct snd_soc_card *card = rtd->card; in cml_rt1011_hw_params()
257 /* 100 Fs to drive 24 bit data */ in cml_rt1011_hw_params()
261 dev_err(card->dev, "codec_dai clock not set\n"); in cml_rt1011_hw_params()
269 dev_err(card->dev, "codec_dai clock not set\n"); in cml_rt1011_hw_params()
274 * Codec TDM is configured as 24 bit capture/ playback. in cml_rt1011_hw_params()
275 * 2 CH PB is done over 4 codecs - 2 Woofers and 2 Tweeters. in cml_rt1011_hw_params()
276 * The Left woofer and tweeter plays the Left playback data in cml_rt1011_hw_params()
278 * Hence 2 codecs (1 T and 1 W pair) share same Rx slot. in cml_rt1011_hw_params()
284 if (!strcmp(codec_dai->component->name, "i2c-10EC1011:00")) { in cml_rt1011_hw_params()
291 if (!strcmp(codec_dai->component->name, "i2c-10EC1011:01")) { in cml_rt1011_hw_params()
301 if (!strcmp(codec_dai->component->name, "i2c-10EC1011:02")) { in cml_rt1011_hw_params()
308 if (!strcmp(codec_dai->component->name, "i2c-10EC1011:03")) { in cml_rt1011_hw_params()
317 dev_err(rtd->dev, in cml_rt1011_hw_params()
318 "set codec TDM slot for %s failed with error %d\n", in cml_rt1011_hw_params()
319 codec_dai->component->name, ret); in cml_rt1011_hw_params()
339 if (list_empty(&ctx->hdmi_pcm_list)) in sof_card_late_probe()
340 return -EINVAL; in sof_card_late_probe()
342 if (ctx->common_hdmi_codec_drv) { in sof_card_late_probe()
343 pcm = list_first_entry(&ctx->hdmi_pcm_list, struct hdmi_pcm, in sof_card_late_probe()
345 component = pcm->codec_dai->component; in sof_card_late_probe()
349 list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { in sof_card_late_probe()
350 component = pcm->codec_dai->component; in sof_card_late_probe()
352 "HDMI/DP, pcm=%d Jack", pcm->device); in sof_card_late_probe()
358 ret = hdac_hdmi_jack_init(pcm->codec_dai, pcm->device, in sof_card_late_probe()
366 return hdac_hdmi_jack_port_init(component, &card->dapm); in sof_card_late_probe()
371 struct card_private *ctx = snd_soc_card_get_drvdata(rtd->card); in hdmi_init()
375 pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL); in hdmi_init()
377 return -ENOMEM; in hdmi_init()
379 pcm->device = dai->id; in hdmi_init()
380 pcm->codec_dai = dai; in hdmi_init()
382 list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); in hdmi_init()
387 /* Cometlake digital audio interface glue - connects codec <--> CPU */
392 DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC5682:00",
399 /* WL */ COMP_CODEC("i2c-10EC1011:00", CML_RT1011_CODEC_DAI),
400 /* WR */ COMP_CODEC("i2c-10EC1011:01", CML_RT1011_CODEC_DAI)));
403 /* WL */ COMP_CODEC("i2c-10EC1011:00", CML_RT1011_CODEC_DAI),
404 /* WR */ COMP_CODEC("i2c-10EC1011:01", CML_RT1011_CODEC_DAI),
405 /* TL */ COMP_CODEC("i2c-10EC1011:02", CML_RT1011_CODEC_DAI),
406 /* TR */ COMP_CODEC("i2c-10EC1011:03", CML_RT1011_CODEC_DAI)));
416 DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi")));
421 DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi1")));
426 DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi2")));
431 DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi3")));
439 /* SSP0 - Codec */
440 .name = "SSP0-Codec",
493 * SSP1 - Codec : added to end of list ensuring
497 .name = "SSP1-Codec",
510 .dlc = COMP_CODEC_CONF("i2c-10EC1011:00"),
514 .dlc = COMP_CODEC_CONF("i2c-10EC1011:01"),
519 .dlc = COMP_CODEC_CONF("i2c-10EC1011:02"),
523 .dlc = COMP_CODEC_CONF("i2c-10EC1011:03"),
554 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); in snd_cml_rt1011_probe()
556 return -ENOMEM; in snd_cml_rt1011_probe()
558 INIT_LIST_HEAD(&ctx->hdmi_pcm_list); in snd_cml_rt1011_probe()
559 mach = pdev->dev.platform_data; in snd_cml_rt1011_probe()
560 snd_soc_card_cml.dev = &pdev->dev; in snd_cml_rt1011_probe()
561 platform_name = mach->mach_params.platform; in snd_cml_rt1011_probe()
565 dev_dbg(&pdev->dev, "sof_rt1011_quirk = %lx\n", sof_rt1011_quirk); in snd_cml_rt1011_probe()
571 if (!strcmp(dai_link->codecs[0].dai_name, in snd_cml_rt1011_probe()
573 dai_link->codecs = ssp1_codec_4spk; in snd_cml_rt1011_probe()
574 dai_link->num_codecs = ARRAY_SIZE(ssp1_codec_4spk); in snd_cml_rt1011_probe()
585 ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv; in snd_cml_rt1011_probe()
589 return devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cml); in snd_cml_rt1011_probe()
602 MODULE_DESCRIPTION("Cometlake Audio Machine driver - RT1011 and RT5682 in I2S mode");