Lines Matching +full:dmic +full:- +full:codec
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Intel Broxton-P I2S Machine Driver
19 #include <sound/soc-acpi.h>
22 #include "../common/soc-intel-quirks.h"
25 #define BXT_DIALOG_CODEC_DAI "da7219-hifi"
27 #define MAX98390_DEV0_NAME "i2c-MX98390:00"
28 #define MAX98390_DEV1_NAME "i2c-MX98390:01"
65 struct snd_soc_dapm_context *dapm = w->dapm; in platform_clock_control()
66 struct snd_soc_card *card = dapm->card; in platform_clock_control()
71 dev_err(card->dev, "Codec dai not found; Unable to set/unset codec pll\n"); in platform_clock_control()
72 return -EIO; in platform_clock_control()
79 dev_err(card->dev, "failed to stop PLL: %d\n", ret); in platform_clock_control()
84 dev_err(card->dev, "failed to start PLL: %d\n", ret); in platform_clock_control()
109 SND_SOC_DAPM_MIC("SoC DMIC", NULL),
127 /* HP jack connectors - unknown if we have jack detection */
135 {"DMic", NULL, "SoC DMIC"},
137 /* CODEC BE connections */
138 {"HDMI1", NULL, "hif5-0 Output"},
139 {"HDMI2", NULL, "hif6-0 Output"},
140 {"HDMI2", NULL, "hif7-0 Output"},
149 /* DMIC */
151 {"DMIC01 Rx", NULL, "DMIC AIF"},
216 rate->min = rate->max = 48000; in broxton_ssp_fixup()
217 chan->min = chan->max = DUAL_CHANNEL; in broxton_ssp_fixup()
230 struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; in broxton_da7219_codec_init()
233 /* Configure sysclk for codec */ in broxton_da7219_codec_init()
243 dev_err(rtd->dev, "can't set codec sysclk configuration\n"); in broxton_da7219_codec_init()
251 ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack", in broxton_da7219_codec_init()
258 dev_err(rtd->dev, "Headset Jack creation failed: %d\n", ret); in broxton_da7219_codec_init()
270 snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC"); in broxton_da7219_codec_init()
277 struct bxt_card_private *ctx = snd_soc_card_get_drvdata(rtd->card); in broxton_hdmi_init()
281 pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL); in broxton_hdmi_init()
283 return -ENOMEM; in broxton_hdmi_init()
285 pcm->device = BXT_DPCM_AUDIO_HDMI1_PB + dai->id; in broxton_hdmi_init()
286 pcm->codec_dai = dai; in broxton_hdmi_init()
288 list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); in broxton_hdmi_init()
296 struct snd_soc_component *component = snd_soc_rtd_to_cpu(rtd, 0)->component; in broxton_da7219_fe_init()
336 struct snd_pcm_runtime *runtime = substream->runtime; in bxt_fe_startup()
345 runtime->hw.channels_max = DUAL_CHANNEL; in bxt_fe_startup()
349 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE; in bxt_fe_startup()
368 chan->min = chan->max = 2; in broxton_dmic_fixup()
370 chan->min = chan->max = 4; in broxton_dmic_fixup()
377 struct snd_pcm_runtime *runtime = substream->runtime; in broxton_dmic_startup()
379 runtime->hw.channels_min = runtime->hw.channels_max = QUAD_CHANNEL; in broxton_dmic_startup()
383 return snd_pcm_hw_constraint_list(substream->runtime, 0, in broxton_dmic_startup()
411 substream->runtime->hw.channels_max = 1; in broxton_refcap_startup()
412 snd_pcm_hw_constraint_list(substream->runtime, 0, in broxton_refcap_startup()
416 return snd_pcm_hw_constraint_list(substream->runtime, 0, in broxton_refcap_startup()
425 /* broxton digital audio interface glue - connects codec <--> CPU */
438 SND_SOC_DAILINK_DEF(dmic,
439 DAILINK_COMP_ARRAY(COMP_CPU("DMIC Pin")));
458 /* Left */ COMP_CODEC(MAX98390_DEV0_NAME, "max98390-aif1"),
459 /* Right */ COMP_CODEC(MAX98390_DEV1_NAME, "max98390-aif1")));
464 DAILINK_COMP_ARRAY(COMP_CODEC("i2c-DLGS7219:00",
474 DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi")));
479 DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi1")));
485 "intel-hdmi-hifi2")));
491 "intel-hdmi-hifi3")));
547 .name = "Bxt Audio DMIC cap",
554 SND_SOC_DAILINK_REG(dmic, dummy, platform),
588 /* SSP5 - Codec */
589 .name = "SSP5-Codec",
601 /* SSP1 - Codec */
602 .name = "SSP1-Codec",
680 switch (ctx->spkamp) { in bxt_card_late_probe()
698 dev_err(card->dev, "Invalid speaker amplifier %d\n", ctx->spkamp); in bxt_card_late_probe()
699 return -EINVAL; in bxt_card_late_probe()
702 err = snd_soc_dapm_new_controls(&card->dapm, widgets, num_widgets); in bxt_card_late_probe()
704 dev_err(card->dev, "Fail to new widgets\n"); in bxt_card_late_probe()
710 dev_err(card->dev, "Fail to add controls\n"); in bxt_card_late_probe()
714 err = snd_soc_dapm_add_routes(&card->dapm, routes, num_routes); in bxt_card_late_probe()
716 dev_err(card->dev, "Fail to add routes\n"); in bxt_card_late_probe()
721 snd_soc_dapm_add_routes(&card->dapm, gemini_map, in bxt_card_late_probe()
724 snd_soc_dapm_add_routes(&card->dapm, broxton_map, in bxt_card_late_probe()
727 if (list_empty(&ctx->hdmi_pcm_list)) in bxt_card_late_probe()
728 return -EINVAL; in bxt_card_late_probe()
730 if (ctx->common_hdmi_codec_drv) { in bxt_card_late_probe()
731 pcm = list_first_entry(&ctx->hdmi_pcm_list, struct bxt_hdmi_pcm, in bxt_card_late_probe()
733 component = pcm->codec_dai->component; in bxt_card_late_probe()
737 list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { in bxt_card_late_probe()
738 component = pcm->codec_dai->component; in bxt_card_late_probe()
740 "HDMI/DP, pcm=%d Jack", pcm->device); in bxt_card_late_probe()
747 err = hdac_hdmi_jack_init(pcm->codec_dai, pcm->device, in bxt_card_late_probe()
755 return hdac_hdmi_jack_port_init(component, &card->dapm); in bxt_card_late_probe()
781 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); in broxton_audio_probe()
783 return -ENOMEM; in broxton_audio_probe()
785 INIT_LIST_HEAD(&ctx->hdmi_pcm_list); in broxton_audio_probe()
787 if (acpi_dev_present("MX98390", NULL, -1)) in broxton_audio_probe()
788 ctx->spkamp = SPKAMP_MAX98390; in broxton_audio_probe()
790 ctx->spkamp = SPKAMP_MAX98357A; in broxton_audio_probe()
792 broxton_audio_card.dev = &pdev->dev; in broxton_audio_probe()
800 if (!broxton_dais[i].codecs->dai_name) in broxton_audio_probe()
804 if (!strcmp(broxton_dais[i].codecs->dai_name, in broxton_audio_probe()
806 broxton_dais[i].name = "SSP1-Codec"; in broxton_audio_probe()
807 broxton_dais[i].cpus->dai_name = "SSP1 Pin"; in broxton_audio_probe()
810 else if (!strcmp(broxton_dais[i].codecs->dai_name, in broxton_audio_probe()
812 broxton_dais[i].name = "SSP2-Codec"; in broxton_audio_probe()
813 broxton_dais[i].cpus->dai_name = "SSP2 Pin"; in broxton_audio_probe()
819 if (ctx->spkamp == SPKAMP_MAX98390) { in broxton_audio_probe()
828 if (!broxton_dais[i].codecs->dai_name) in broxton_audio_probe()
832 if (!strcmp(broxton_dais[i].codecs->dai_name, in broxton_audio_probe()
834 broxton_dais[i].name = "SSP1-Codec"; in broxton_audio_probe()
835 broxton_dais[i].cpus->dai_name = "SSP1 Pin"; in broxton_audio_probe()
837 if (ctx->spkamp == SPKAMP_MAX98390) { in broxton_audio_probe()
844 else if (!strcmp(broxton_dais[i].codecs->dai_name, in broxton_audio_probe()
846 broxton_dais[i].name = "SSP0-Codec"; in broxton_audio_probe()
847 broxton_dais[i].cpus->dai_name = "SSP0 Pin"; in broxton_audio_probe()
853 mach = pdev->dev.platform_data; in broxton_audio_probe()
854 platform_name = mach->mach_params.platform; in broxton_audio_probe()
861 ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv; in broxton_audio_probe()
863 return devm_snd_soc_register_card(&pdev->dev, &broxton_audio_card); in broxton_audio_probe()
885 MODULE_DESCRIPTION("Audio Machine driver-DA7219 & MAX98357A in I2S mode");