Lines Matching +full:dmic +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Intel Broxton-P I2S Machine Driver
19 #include <sound/soc-acpi.h>
22 #include "../../codecs/da7219-aad.h"
23 #include "../common/soc-intel-quirks.h"
26 #define BXT_DIALOG_CODEC_DAI "da7219-hifi"
28 #define MAX98390_DEV0_NAME "i2c-MX98390:00"
29 #define MAX98390_DEV1_NAME "i2c-MX98390:01"
66 struct snd_soc_dapm_context *dapm = w->dapm; in platform_clock_control()
67 struct snd_soc_card *card = dapm->card; in platform_clock_control()
72 dev_err(card->dev, "Codec dai not found; Unable to set/unset codec pll\n"); in platform_clock_control()
73 return -EIO; in platform_clock_control()
80 dev_err(card->dev, "failed to stop PLL: %d\n", ret); in platform_clock_control()
85 dev_err(card->dev, "failed to start PLL: %d\n", ret); in platform_clock_control()
108 SND_SOC_DAPM_MIC("SoC DMIC", NULL),
126 /* HP jack connectors - unknown if we have jack detection */
134 {"DMic", NULL, "SoC DMIC"},
137 {"HDMI1", NULL, "hif5-0 Output"},
138 {"HDMI2", NULL, "hif6-0 Output"},
139 {"HDMI2", NULL, "hif7-0 Output"},
148 /* DMIC */
150 {"DMIC01 Rx", NULL, "DMIC AIF"},
199 rate->min = rate->max = 48000; in broxton_ssp_fixup()
200 chan->min = chan->max = DUAL_CHANNEL; in broxton_ssp_fixup()
213 struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; in broxton_da7219_codec_init()
226 dev_err(rtd->dev, "can't set codec sysclk configuration\n"); in broxton_da7219_codec_init()
234 ret = snd_soc_card_jack_new(rtd->card, "Headset Jack", in broxton_da7219_codec_init()
239 dev_err(rtd->dev, "Headset Jack creation failed: %d\n", ret); in broxton_da7219_codec_init()
251 snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC"); in broxton_da7219_codec_init()
258 struct bxt_card_private *ctx = snd_soc_card_get_drvdata(rtd->card); in broxton_hdmi_init()
262 pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL); in broxton_hdmi_init()
264 return -ENOMEM; in broxton_hdmi_init()
266 pcm->device = BXT_DPCM_AUDIO_HDMI1_PB + dai->id; in broxton_hdmi_init()
267 pcm->codec_dai = dai; in broxton_hdmi_init()
269 list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); in broxton_hdmi_init()
277 struct snd_soc_component *component = asoc_rtd_to_cpu(rtd, 0)->component; in broxton_da7219_fe_init()
317 struct snd_pcm_runtime *runtime = substream->runtime; in bxt_fe_startup()
326 runtime->hw.channels_max = DUAL_CHANNEL; in bxt_fe_startup()
330 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE; in bxt_fe_startup()
349 chan->min = chan->max = 2; in broxton_dmic_fixup()
351 chan->min = chan->max = 4; in broxton_dmic_fixup()
358 struct snd_pcm_runtime *runtime = substream->runtime; in broxton_dmic_startup()
360 runtime->hw.channels_min = runtime->hw.channels_max = QUAD_CHANNEL; in broxton_dmic_startup()
364 return snd_pcm_hw_constraint_list(substream->runtime, 0, in broxton_dmic_startup()
392 substream->runtime->hw.channels_max = 1; in broxton_refcap_startup()
393 snd_pcm_hw_constraint_list(substream->runtime, 0, in broxton_refcap_startup()
397 return snd_pcm_hw_constraint_list(substream->runtime, 0, in broxton_refcap_startup()
406 /* broxton digital audio interface glue - connects codec <--> CPU */
419 SND_SOC_DAILINK_DEF(dmic,
420 DAILINK_COMP_ARRAY(COMP_CPU("DMIC Pin")));
439 /* Left */ COMP_CODEC(MAX98390_DEV0_NAME, "max98390-aif1"),
440 /* Right */ COMP_CODEC(MAX98390_DEV1_NAME, "max98390-aif1")));
445 DAILINK_COMP_ARRAY(COMP_CODEC("i2c-DLGS7219:00",
455 DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi")));
460 DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi1")));
466 "intel-hdmi-hifi2")));
472 "intel-hdmi-hifi3")));
528 .name = "Bxt Audio DMIC cap",
535 SND_SOC_DAILINK_REG(dmic, dummy, platform),
569 /* SSP5 - Codec */
570 .name = "SSP5-Codec",
582 /* SSP1 - Codec */
583 .name = "SSP1-Codec",
661 switch (ctx->spkamp) { in bxt_card_late_probe()
679 dev_err(card->dev, "Invalid speaker amplifier %d\n", ctx->spkamp); in bxt_card_late_probe()
680 return -EINVAL; in bxt_card_late_probe()
683 err = snd_soc_dapm_new_controls(&card->dapm, widgets, num_widgets); in bxt_card_late_probe()
685 dev_err(card->dev, "Fail to new widgets\n"); in bxt_card_late_probe()
691 dev_err(card->dev, "Fail to add controls\n"); in bxt_card_late_probe()
695 err = snd_soc_dapm_add_routes(&card->dapm, routes, num_routes); in bxt_card_late_probe()
697 dev_err(card->dev, "Fail to add routes\n"); in bxt_card_late_probe()
702 snd_soc_dapm_add_routes(&card->dapm, gemini_map, in bxt_card_late_probe()
705 snd_soc_dapm_add_routes(&card->dapm, broxton_map, in bxt_card_late_probe()
708 if (list_empty(&ctx->hdmi_pcm_list)) in bxt_card_late_probe()
709 return -EINVAL; in bxt_card_late_probe()
711 if (ctx->common_hdmi_codec_drv) { in bxt_card_late_probe()
712 pcm = list_first_entry(&ctx->hdmi_pcm_list, struct bxt_hdmi_pcm, in bxt_card_late_probe()
714 component = pcm->codec_dai->component; in bxt_card_late_probe()
718 list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { in bxt_card_late_probe()
719 component = pcm->codec_dai->component; in bxt_card_late_probe()
721 "HDMI/DP, pcm=%d Jack", pcm->device); in bxt_card_late_probe()
729 err = hdac_hdmi_jack_init(pcm->codec_dai, pcm->device, in bxt_card_late_probe()
737 return hdac_hdmi_jack_port_init(component, &card->dapm); in bxt_card_late_probe()
763 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); in broxton_audio_probe()
765 return -ENOMEM; in broxton_audio_probe()
767 INIT_LIST_HEAD(&ctx->hdmi_pcm_list); in broxton_audio_probe()
769 if (acpi_dev_present("MX98390", NULL, -1)) in broxton_audio_probe()
770 ctx->spkamp = SPKAMP_MAX98390; in broxton_audio_probe()
772 ctx->spkamp = SPKAMP_MAX98357A; in broxton_audio_probe()
774 broxton_audio_card.dev = &pdev->dev; in broxton_audio_probe()
783 if (!strcmp(broxton_dais[i].codecs->dai_name, in broxton_audio_probe()
785 broxton_dais[i].name = "SSP1-Codec"; in broxton_audio_probe()
786 broxton_dais[i].cpus->dai_name = "SSP1 Pin"; in broxton_audio_probe()
789 else if (!strcmp(broxton_dais[i].codecs->dai_name, in broxton_audio_probe()
791 broxton_dais[i].name = "SSP2-Codec"; in broxton_audio_probe()
792 broxton_dais[i].cpus->dai_name = "SSP2 Pin"; in broxton_audio_probe()
798 if (ctx->spkamp == SPKAMP_MAX98390) { in broxton_audio_probe()
808 if (!strcmp(broxton_dais[i].codecs->dai_name, in broxton_audio_probe()
810 broxton_dais[i].name = "SSP1-Codec"; in broxton_audio_probe()
811 broxton_dais[i].cpus->dai_name = "SSP1 Pin"; in broxton_audio_probe()
813 if (ctx->spkamp == SPKAMP_MAX98390) { in broxton_audio_probe()
819 else if (!strcmp(broxton_dais[i].codecs->dai_name, in broxton_audio_probe()
821 broxton_dais[i].name = "SSP0-Codec"; in broxton_audio_probe()
822 broxton_dais[i].cpus->dai_name = "SSP0 Pin"; in broxton_audio_probe()
828 mach = pdev->dev.platform_data; in broxton_audio_probe()
829 platform_name = mach->mach_params.platform; in broxton_audio_probe()
836 ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv; in broxton_audio_probe()
838 return devm_snd_soc_register_card(&pdev->dev, &broxton_audio_card); in broxton_audio_probe()
859 MODULE_DESCRIPTION("Audio Machine driver-DA7219 & MAX98357A in I2S mode");