Lines Matching +full:dmic +full:- +full:sample +full:- +full:rate

1 // SPDX-License-Identifier: GPL-2.0
23 #include "imx-audmux.h"
40 * struct codec_priv - CODEC private data
41 * @mclk_freq: Clock rate of MCLK
42 * @free_freq: Clock rate of MCLK for hw_free()
56 * struct cpu_priv - CPU private data
72 * struct fsl_asoc_card_priv - Freescale Generic ASOC card private data
81 * @sample_rate: Current sample rate
82 * @sample_format: Current sample format
83 * @asrc_rate: ASRC sample rate used by Back-Ends
84 * @asrc_format: ASRC sample format used by Back-Ends
111 * to drop them easily for non-ASRC cases.
114 /* 1st half -- Normal DAPM routes */
115 {"Playback", NULL, "CPU-Playback"},
116 {"CPU-Capture", NULL, "Capture"},
117 /* 2nd half -- ASRC DAPM routes */
118 {"CPU-Playback", NULL, "ASRC-Playback"},
119 {"ASRC-Capture", NULL, "CPU-Capture"},
123 /* 1st half -- Normal DAPM routes */
126 /* 2nd half -- ASRC DAPM routes */
127 {"AC97 Playback", NULL, "ASRC-Playback"},
128 {"ASRC-Capture", NULL, "AC97 Capture"},
132 /* 1st half -- Normal DAPM routes */
133 {"Playback", NULL, "CPU-Playback"},
134 /* 2nd half -- ASRC DAPM routes */
135 {"CPU-Playback", NULL, "ASRC-Playback"},
139 /* 1st half -- Normal DAPM routes */
140 {"CPU-Capture", NULL, "Capture"},
141 /* 2nd half -- ASRC DAPM routes */
142 {"ASRC-Capture", NULL, "CPU-Capture"},
153 SND_SOC_DAPM_MIC("DMIC", NULL),
158 return priv->dai_fmt == SND_SOC_DAIFMT_AC97; in fsl_asoc_card_is_ac97()
165 struct fsl_asoc_card_priv *priv = snd_soc_card_get_drvdata(rtd->card); in fsl_asoc_card_hw_params()
166 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in fsl_asoc_card_hw_params()
167 struct codec_priv *codec_priv = &priv->codec_priv; in fsl_asoc_card_hw_params()
168 struct cpu_priv *cpu_priv = &priv->cpu_priv; in fsl_asoc_card_hw_params()
169 struct device *dev = rtd->card->dev; in fsl_asoc_card_hw_params()
173 priv->sample_rate = params_rate(params); in fsl_asoc_card_hw_params()
174 priv->sample_format = params_format(params); in fsl_asoc_card_hw_params()
175 priv->streams |= BIT(substream->stream); in fsl_asoc_card_hw_params()
181 ret = snd_soc_dai_set_sysclk(asoc_rtd_to_cpu(rtd, 0), cpu_priv->sysclk_id[tx], in fsl_asoc_card_hw_params()
182 cpu_priv->sysclk_freq[tx], in fsl_asoc_card_hw_params()
183 cpu_priv->sysclk_dir[tx]); in fsl_asoc_card_hw_params()
184 if (ret && ret != -ENOTSUPP) { in fsl_asoc_card_hw_params()
189 if (cpu_priv->slot_width) { in fsl_asoc_card_hw_params()
191 cpu_priv->slot_width); in fsl_asoc_card_hw_params()
192 if (ret && ret != -ENOTSUPP) { in fsl_asoc_card_hw_params()
199 if (codec_priv->pll_id && codec_priv->fll_id) { in fsl_asoc_card_hw_params()
200 if (priv->sample_format == SNDRV_PCM_FORMAT_S24_LE) in fsl_asoc_card_hw_params()
201 pll_out = priv->sample_rate * 384; in fsl_asoc_card_hw_params()
203 pll_out = priv->sample_rate * 256; in fsl_asoc_card_hw_params()
206 codec_priv->pll_id, in fsl_asoc_card_hw_params()
207 codec_priv->mclk_id, in fsl_asoc_card_hw_params()
208 codec_priv->mclk_freq, pll_out); in fsl_asoc_card_hw_params()
215 codec_priv->fll_id, in fsl_asoc_card_hw_params()
218 if (ret && ret != -ENOTSUPP) { in fsl_asoc_card_hw_params()
227 priv->streams &= ~BIT(substream->stream); in fsl_asoc_card_hw_params()
233 struct snd_soc_pcm_runtime *rtd = substream->private_data; in fsl_asoc_card_hw_free()
234 struct fsl_asoc_card_priv *priv = snd_soc_card_get_drvdata(rtd->card); in fsl_asoc_card_hw_free()
235 struct codec_priv *codec_priv = &priv->codec_priv; in fsl_asoc_card_hw_free()
236 struct device *dev = rtd->card->dev; in fsl_asoc_card_hw_free()
239 priv->streams &= ~BIT(substream->stream); in fsl_asoc_card_hw_free()
241 if (!priv->streams && codec_priv->pll_id && codec_priv->fll_id) { in fsl_asoc_card_hw_free()
244 codec_priv->mclk_id, in fsl_asoc_card_hw_free()
245 codec_priv->free_freq, in fsl_asoc_card_hw_free()
253 codec_priv->pll_id, 0, 0, 0); in fsl_asoc_card_hw_free()
254 if (ret && ret != -ENOTSUPP) { in fsl_asoc_card_hw_free()
271 struct fsl_asoc_card_priv *priv = snd_soc_card_get_drvdata(rtd->card); in be_hw_params_fixup()
272 struct snd_interval *rate; in be_hw_params_fixup() local
275 rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); in be_hw_params_fixup()
276 rate->max = rate->min = priv->asrc_rate; in be_hw_params_fixup()
280 snd_mask_set_format(mask, priv->asrc_format); in be_hw_params_fixup()
308 /* DPCM Link between Front-End and Back-End (Optional) */
310 .name = "HiFi-ASRC-FE",
311 .stream_name = "HiFi-ASRC-FE",
318 .name = "HiFi-ASRC-BE",
319 .stream_name = "HiFi-ASRC-BE",
332 struct device *dev = &priv->pdev->dev; in fsl_asoc_card_audmux_init()
337 ret = of_property_read_u32(np, "mux-int-port", &int_port); in fsl_asoc_card_audmux_init()
339 dev_err(dev, "mux-int-port missing or invalid\n"); in fsl_asoc_card_audmux_init()
342 ret = of_property_read_u32(np, "mux-ext-port", &ext_port); in fsl_asoc_card_audmux_init()
344 dev_err(dev, "mux-ext-port missing or invalid\n"); in fsl_asoc_card_audmux_init()
352 int_port--; in fsl_asoc_card_audmux_init()
353 ext_port--; in fsl_asoc_card_audmux_init()
360 switch (priv->dai_fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) { in fsl_asoc_card_audmux_init()
403 return -EINVAL; in fsl_asoc_card_audmux_init()
461 struct snd_soc_dapm_context *dapm = &jack->card->dapm; in hp_jack_event()
478 struct snd_soc_dapm_context *dapm = &jack->card->dapm; in mic_jack_event()
481 /* Disable dmic if microphone is plugged in */ in mic_jack_event()
482 return snd_soc_dapm_disable_pin(dapm, "DMIC"); in mic_jack_event()
484 return snd_soc_dapm_enable_pin(dapm, "DMIC"); in mic_jack_event()
495 &card->rtd_list, struct snd_soc_pcm_runtime, list); in fsl_asoc_card_late_probe()
497 struct codec_priv *codec_priv = &priv->codec_priv; in fsl_asoc_card_late_probe()
498 struct device *dev = card->dev; in fsl_asoc_card_late_probe()
503 struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; in fsl_asoc_card_late_probe()
518 ret = snd_soc_dai_set_sysclk(codec_dai, codec_priv->mclk_id, in fsl_asoc_card_late_probe()
519 codec_priv->mclk_freq, SND_SOC_CLOCK_IN); in fsl_asoc_card_late_probe()
520 if (ret && ret != -ENOTSUPP) { in fsl_asoc_card_late_probe()
531 struct device_node *np = pdev->dev.of_node; in fsl_asoc_card_probe()
544 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); in fsl_asoc_card_probe()
546 return -ENOMEM; in fsl_asoc_card_probe()
548 cpu_np = of_parse_phandle(np, "audio-cpu", 0); in fsl_asoc_card_probe()
551 cpu_np = of_parse_phandle(np, "ssi-controller", 0); in fsl_asoc_card_probe()
553 dev_err(&pdev->dev, "CPU phandle missing or invalid\n"); in fsl_asoc_card_probe()
554 ret = -EINVAL; in fsl_asoc_card_probe()
560 dev_err(&pdev->dev, "failed to find CPU DAI device\n"); in fsl_asoc_card_probe()
561 ret = -EINVAL; in fsl_asoc_card_probe()
565 codec_np = of_parse_phandle(np, "audio-codec", 0); in fsl_asoc_card_probe()
572 codec_dev = &codec_i2c->dev; in fsl_asoc_card_probe()
573 codec_dev_name = codec_i2c->name; in fsl_asoc_card_probe()
578 codec_dev = &codec_pdev->dev; in fsl_asoc_card_probe()
579 codec_dev_name = codec_pdev->name; in fsl_asoc_card_probe()
584 asrc_np = of_parse_phandle(np, "audio-asrc", 0); in fsl_asoc_card_probe()
588 /* Get the MCLK rate only, and leave it controlled by CODEC drivers */ in fsl_asoc_card_probe()
593 priv->codec_priv.mclk_freq = clk_get_rate(codec_clk); in fsl_asoc_card_probe()
598 /* Default sample rate and format, will be updated in hw_params() */ in fsl_asoc_card_probe()
599 priv->sample_rate = 44100; in fsl_asoc_card_probe()
600 priv->sample_format = SNDRV_PCM_FORMAT_S16_LE; in fsl_asoc_card_probe()
603 priv->dai_fmt = DAI_FMT_BASE; in fsl_asoc_card_probe()
605 memcpy(priv->dai_link, fsl_asoc_card_dai, in fsl_asoc_card_probe()
606 sizeof(struct snd_soc_dai_link) * ARRAY_SIZE(priv->dai_link)); in fsl_asoc_card_probe()
608 priv->card.dapm_routes = audio_map; in fsl_asoc_card_probe()
609 priv->card.num_dapm_routes = ARRAY_SIZE(audio_map); in fsl_asoc_card_probe()
611 if (of_device_is_compatible(np, "fsl,imx-audio-cs42888")) { in fsl_asoc_card_probe()
613 priv->cpu_priv.sysclk_freq[TX] = priv->codec_priv.mclk_freq; in fsl_asoc_card_probe()
614 priv->cpu_priv.sysclk_freq[RX] = priv->codec_priv.mclk_freq; in fsl_asoc_card_probe()
615 priv->cpu_priv.sysclk_dir[TX] = SND_SOC_CLOCK_OUT; in fsl_asoc_card_probe()
616 priv->cpu_priv.sysclk_dir[RX] = SND_SOC_CLOCK_OUT; in fsl_asoc_card_probe()
617 priv->cpu_priv.slot_width = 32; in fsl_asoc_card_probe()
618 priv->dai_fmt |= SND_SOC_DAIFMT_CBC_CFC; in fsl_asoc_card_probe()
619 } else if (of_device_is_compatible(np, "fsl,imx-audio-cs427x")) { in fsl_asoc_card_probe()
620 codec_dai_name = "cs4271-hifi"; in fsl_asoc_card_probe()
621 priv->codec_priv.mclk_id = CS427x_SYSCLK_MCLK; in fsl_asoc_card_probe()
622 priv->dai_fmt |= SND_SOC_DAIFMT_CBP_CFP; in fsl_asoc_card_probe()
623 } else if (of_device_is_compatible(np, "fsl,imx-audio-sgtl5000")) { in fsl_asoc_card_probe()
625 priv->codec_priv.mclk_id = SGTL5000_SYSCLK; in fsl_asoc_card_probe()
626 priv->dai_fmt |= SND_SOC_DAIFMT_CBP_CFP; in fsl_asoc_card_probe()
627 } else if (of_device_is_compatible(np, "fsl,imx-audio-tlv320aic32x4")) { in fsl_asoc_card_probe()
628 codec_dai_name = "tlv320aic32x4-hifi"; in fsl_asoc_card_probe()
629 priv->dai_fmt |= SND_SOC_DAIFMT_CBP_CFP; in fsl_asoc_card_probe()
630 } else if (of_device_is_compatible(np, "fsl,imx-audio-tlv320aic31xx")) { in fsl_asoc_card_probe()
631 codec_dai_name = "tlv320dac31xx-hifi"; in fsl_asoc_card_probe()
632 priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS; in fsl_asoc_card_probe()
633 priv->dai_link[1].dpcm_capture = 0; in fsl_asoc_card_probe()
634 priv->dai_link[2].dpcm_capture = 0; in fsl_asoc_card_probe()
635 priv->cpu_priv.sysclk_dir[TX] = SND_SOC_CLOCK_OUT; in fsl_asoc_card_probe()
636 priv->cpu_priv.sysclk_dir[RX] = SND_SOC_CLOCK_OUT; in fsl_asoc_card_probe()
637 priv->card.dapm_routes = audio_map_tx; in fsl_asoc_card_probe()
638 priv->card.num_dapm_routes = ARRAY_SIZE(audio_map_tx); in fsl_asoc_card_probe()
639 } else if (of_device_is_compatible(np, "fsl,imx-audio-wm8962")) { in fsl_asoc_card_probe()
641 priv->codec_priv.mclk_id = WM8962_SYSCLK_MCLK; in fsl_asoc_card_probe()
642 priv->codec_priv.fll_id = WM8962_SYSCLK_FLL; in fsl_asoc_card_probe()
643 priv->codec_priv.pll_id = WM8962_FLL; in fsl_asoc_card_probe()
644 priv->dai_fmt |= SND_SOC_DAIFMT_CBP_CFP; in fsl_asoc_card_probe()
645 } else if (of_device_is_compatible(np, "fsl,imx-audio-wm8960")) { in fsl_asoc_card_probe()
646 codec_dai_name = "wm8960-hifi"; in fsl_asoc_card_probe()
647 priv->codec_priv.fll_id = WM8960_SYSCLK_AUTO; in fsl_asoc_card_probe()
648 priv->codec_priv.pll_id = WM8960_SYSCLK_AUTO; in fsl_asoc_card_probe()
649 priv->dai_fmt |= SND_SOC_DAIFMT_CBP_CFP; in fsl_asoc_card_probe()
650 } else if (of_device_is_compatible(np, "fsl,imx-audio-ac97")) { in fsl_asoc_card_probe()
651 codec_dai_name = "ac97-hifi"; in fsl_asoc_card_probe()
652 priv->dai_fmt = SND_SOC_DAIFMT_AC97; in fsl_asoc_card_probe()
653 priv->card.dapm_routes = audio_map_ac97; in fsl_asoc_card_probe()
654 priv->card.num_dapm_routes = ARRAY_SIZE(audio_map_ac97); in fsl_asoc_card_probe()
655 } else if (of_device_is_compatible(np, "fsl,imx-audio-mqs")) { in fsl_asoc_card_probe()
656 codec_dai_name = "fsl-mqs-dai"; in fsl_asoc_card_probe()
657 priv->dai_fmt = SND_SOC_DAIFMT_LEFT_J | in fsl_asoc_card_probe()
660 priv->dai_link[1].dpcm_capture = 0; in fsl_asoc_card_probe()
661 priv->dai_link[2].dpcm_capture = 0; in fsl_asoc_card_probe()
662 priv->card.dapm_routes = audio_map_tx; in fsl_asoc_card_probe()
663 priv->card.num_dapm_routes = ARRAY_SIZE(audio_map_tx); in fsl_asoc_card_probe()
664 } else if (of_device_is_compatible(np, "fsl,imx-audio-wm8524")) { in fsl_asoc_card_probe()
665 codec_dai_name = "wm8524-hifi"; in fsl_asoc_card_probe()
666 priv->dai_fmt |= SND_SOC_DAIFMT_CBC_CFC; in fsl_asoc_card_probe()
667 priv->dai_link[1].dpcm_capture = 0; in fsl_asoc_card_probe()
668 priv->dai_link[2].dpcm_capture = 0; in fsl_asoc_card_probe()
669 priv->cpu_priv.slot_width = 32; in fsl_asoc_card_probe()
670 priv->card.dapm_routes = audio_map_tx; in fsl_asoc_card_probe()
671 priv->card.num_dapm_routes = ARRAY_SIZE(audio_map_tx); in fsl_asoc_card_probe()
672 } else if (of_device_is_compatible(np, "fsl,imx-audio-si476x")) { in fsl_asoc_card_probe()
673 codec_dai_name = "si476x-codec"; in fsl_asoc_card_probe()
674 priv->dai_fmt |= SND_SOC_DAIFMT_CBC_CFC; in fsl_asoc_card_probe()
675 priv->card.dapm_routes = audio_map_rx; in fsl_asoc_card_probe()
676 priv->card.num_dapm_routes = ARRAY_SIZE(audio_map_rx); in fsl_asoc_card_probe()
677 } else if (of_device_is_compatible(np, "fsl,imx-audio-wm8958")) { in fsl_asoc_card_probe()
678 codec_dai_name = "wm8994-aif1"; in fsl_asoc_card_probe()
679 priv->dai_fmt |= SND_SOC_DAIFMT_CBP_CFP; in fsl_asoc_card_probe()
680 priv->codec_priv.mclk_id = WM8994_FLL_SRC_MCLK1; in fsl_asoc_card_probe()
681 priv->codec_priv.fll_id = WM8994_SYSCLK_FLL1; in fsl_asoc_card_probe()
682 priv->codec_priv.pll_id = WM8994_FLL1; in fsl_asoc_card_probe()
683 priv->codec_priv.free_freq = priv->codec_priv.mclk_freq; in fsl_asoc_card_probe()
684 priv->card.dapm_routes = NULL; in fsl_asoc_card_probe()
685 priv->card.num_dapm_routes = 0; in fsl_asoc_card_probe()
687 dev_err(&pdev->dev, "unknown Device Tree compatible\n"); in fsl_asoc_card_probe()
688 ret = -EINVAL; in fsl_asoc_card_probe()
693 * Allow setting mclk-id from the device-tree node. Otherwise, the in fsl_asoc_card_probe()
696 of_property_read_u32(np, "mclk-id", &priv->codec_priv.mclk_id); in fsl_asoc_card_probe()
711 priv->dai_fmt = daifmt; in fsl_asoc_card_probe()
715 if (priv->dai_fmt & SND_SOC_DAIFMT_CBP_CFP) { in fsl_asoc_card_probe()
716 priv->cpu_priv.sysclk_dir[TX] = SND_SOC_CLOCK_IN; in fsl_asoc_card_probe()
717 priv->cpu_priv.sysclk_dir[RX] = SND_SOC_CLOCK_IN; in fsl_asoc_card_probe()
724 dev_dbg(&pdev->dev, "failed to find codec device\n"); in fsl_asoc_card_probe()
725 ret = -EPROBE_DEFER; in fsl_asoc_card_probe()
734 dev_err(&pdev->dev, "failed to init audmux\n"); in fsl_asoc_card_probe()
738 struct clk *esai_clk = clk_get(&cpu_pdev->dev, "extal"); in fsl_asoc_card_probe()
741 priv->cpu_priv.sysclk_freq[TX] = clk_get_rate(esai_clk); in fsl_asoc_card_probe()
742 priv->cpu_priv.sysclk_freq[RX] = clk_get_rate(esai_clk); in fsl_asoc_card_probe()
744 } else if (PTR_ERR(esai_clk) == -EPROBE_DEFER) { in fsl_asoc_card_probe()
745 ret = -EPROBE_DEFER; in fsl_asoc_card_probe()
749 priv->cpu_priv.sysclk_id[1] = ESAI_HCKT_EXTAL; in fsl_asoc_card_probe()
750 priv->cpu_priv.sysclk_id[0] = ESAI_HCKR_EXTAL; in fsl_asoc_card_probe()
752 priv->cpu_priv.sysclk_id[1] = FSL_SAI_CLK_MAST1; in fsl_asoc_card_probe()
753 priv->cpu_priv.sysclk_id[0] = FSL_SAI_CLK_MAST1; in fsl_asoc_card_probe()
757 priv->pdev = pdev; in fsl_asoc_card_probe()
758 priv->card.dev = &pdev->dev; in fsl_asoc_card_probe()
759 priv->card.owner = THIS_MODULE; in fsl_asoc_card_probe()
760 ret = snd_soc_of_parse_card_name(&priv->card, "model"); in fsl_asoc_card_probe()
762 snprintf(priv->name, sizeof(priv->name), "%s-audio", in fsl_asoc_card_probe()
764 priv->card.name = priv->name; in fsl_asoc_card_probe()
766 priv->card.dai_link = priv->dai_link; in fsl_asoc_card_probe()
767 priv->card.late_probe = fsl_asoc_card_late_probe; in fsl_asoc_card_probe()
768 priv->card.dapm_widgets = fsl_asoc_card_dapm_widgets; in fsl_asoc_card_probe()
769 priv->card.num_dapm_widgets = ARRAY_SIZE(fsl_asoc_card_dapm_widgets); in fsl_asoc_card_probe()
771 /* Drop the second half of DAPM routes -- ASRC */ in fsl_asoc_card_probe()
773 priv->card.num_dapm_routes /= 2; in fsl_asoc_card_probe()
775 if (of_property_read_bool(np, "audio-routing")) { in fsl_asoc_card_probe()
776 ret = snd_soc_of_parse_audio_routing(&priv->card, "audio-routing"); in fsl_asoc_card_probe()
778 dev_err(&pdev->dev, "failed to parse audio-routing: %d\n", ret); in fsl_asoc_card_probe()
784 priv->dai_link[0].cpus->of_node = cpu_np; in fsl_asoc_card_probe()
785 priv->dai_link[0].codecs->dai_name = codec_dai_name; in fsl_asoc_card_probe()
788 priv->dai_link[0].codecs->of_node = codec_np; in fsl_asoc_card_probe()
792 ret = of_property_read_u32(cpu_np, "cell-index", &idx); in fsl_asoc_card_probe()
794 dev_err(&pdev->dev, in fsl_asoc_card_probe()
799 priv->dai_link[0].codecs->name = in fsl_asoc_card_probe()
800 devm_kasprintf(&pdev->dev, GFP_KERNEL, in fsl_asoc_card_probe()
801 "ac97-codec.%u", in fsl_asoc_card_probe()
803 if (!priv->dai_link[0].codecs->name) { in fsl_asoc_card_probe()
804 ret = -ENOMEM; in fsl_asoc_card_probe()
809 priv->dai_link[0].platforms->of_node = cpu_np; in fsl_asoc_card_probe()
810 priv->dai_link[0].dai_fmt = priv->dai_fmt; in fsl_asoc_card_probe()
811 priv->card.num_links = 1; in fsl_asoc_card_probe()
815 priv->dai_link[1].cpus->of_node = asrc_np; in fsl_asoc_card_probe()
816 priv->dai_link[1].platforms->of_node = asrc_np; in fsl_asoc_card_probe()
817 priv->dai_link[2].codecs->dai_name = codec_dai_name; in fsl_asoc_card_probe()
818 priv->dai_link[2].codecs->of_node = codec_np; in fsl_asoc_card_probe()
819 priv->dai_link[2].codecs->name = in fsl_asoc_card_probe()
820 priv->dai_link[0].codecs->name; in fsl_asoc_card_probe()
821 priv->dai_link[2].cpus->of_node = cpu_np; in fsl_asoc_card_probe()
822 priv->dai_link[2].dai_fmt = priv->dai_fmt; in fsl_asoc_card_probe()
823 priv->card.num_links = 3; in fsl_asoc_card_probe()
825 ret = of_property_read_u32(asrc_np, "fsl,asrc-rate", in fsl_asoc_card_probe()
826 &priv->asrc_rate); in fsl_asoc_card_probe()
828 dev_err(&pdev->dev, "failed to get output rate\n"); in fsl_asoc_card_probe()
829 ret = -EINVAL; in fsl_asoc_card_probe()
833 ret = of_property_read_u32(asrc_np, "fsl,asrc-format", &asrc_fmt); in fsl_asoc_card_probe()
834 priv->asrc_format = (__force snd_pcm_format_t)asrc_fmt; in fsl_asoc_card_probe()
837 ret = of_property_read_u32(asrc_np, "fsl,asrc-width", in fsl_asoc_card_probe()
840 dev_err(&pdev->dev, in fsl_asoc_card_probe()
846 priv->asrc_format = SNDRV_PCM_FORMAT_S24_LE; in fsl_asoc_card_probe()
848 priv->asrc_format = SNDRV_PCM_FORMAT_S16_LE; in fsl_asoc_card_probe()
854 snd_soc_card_set_drvdata(&priv->card, priv); in fsl_asoc_card_probe()
856 ret = devm_snd_soc_register_card(&pdev->dev, &priv->card); in fsl_asoc_card_probe()
858 dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n"); in fsl_asoc_card_probe()
863 * Properties "hp-det-gpio" and "mic-det-gpio" are optional, and in fsl_asoc_card_probe()
870 if (of_property_read_bool(np, "hp-det-gpio")) { in fsl_asoc_card_probe()
871 ret = asoc_simple_init_jack(&priv->card, &priv->hp_jack, in fsl_asoc_card_probe()
876 snd_soc_jack_notifier_register(&priv->hp_jack.jack, &hp_jack_nb); in fsl_asoc_card_probe()
879 if (of_property_read_bool(np, "mic-det-gpio")) { in fsl_asoc_card_probe()
880 ret = asoc_simple_init_jack(&priv->card, &priv->mic_jack, in fsl_asoc_card_probe()
885 snd_soc_jack_notifier_register(&priv->mic_jack.jack, &mic_jack_nb); in fsl_asoc_card_probe()
891 put_device(&cpu_pdev->dev); in fsl_asoc_card_probe()
899 { .compatible = "fsl,imx-audio-ac97", },
900 { .compatible = "fsl,imx-audio-cs42888", },
901 { .compatible = "fsl,imx-audio-cs427x", },
902 { .compatible = "fsl,imx-audio-tlv320aic32x4", },
903 { .compatible = "fsl,imx-audio-tlv320aic31xx", },
904 { .compatible = "fsl,imx-audio-sgtl5000", },
905 { .compatible = "fsl,imx-audio-wm8962", },
906 { .compatible = "fsl,imx-audio-wm8960", },
907 { .compatible = "fsl,imx-audio-mqs", },
908 { .compatible = "fsl,imx-audio-wm8524", },
909 { .compatible = "fsl,imx-audio-si476x", },
910 { .compatible = "fsl,imx-audio-wm8958", },
918 .name = "fsl-asoc-card",
927 MODULE_ALIAS("platform:fsl-asoc-card");