Lines Matching +full:codec +full:- +full:aif1

1 // SPDX-License-Identifier: GPL-2.0
3 * mt8173-rt5650.c -- MT8173 machine driver with RT5650 codecs
114 struct snd_soc_card *card = runtime->card; in mt8173_rt5650_init()
115 struct snd_soc_component *component = snd_soc_rtd_to_codec(runtime, 0)->component; in mt8173_rt5650_init()
116 const char *codec_capture_dai = snd_soc_rtd_to_codec(runtime, 1)->name; in mt8173_rt5650_init()
123 if (!strcmp(codec_capture_dai, "rt5645-aif1")) { in mt8173_rt5650_init()
127 } else if (!strcmp(codec_capture_dai, "rt5645-aif2")) { in mt8173_rt5650_init()
132 dev_warn(card->dev, in mt8173_rt5650_init()
133 "Only one dai codec found in DTS, enabled rt5645 AD filter\n"); in mt8173_rt5650_init()
148 dev_err(card->dev, "Can't new Headset Jack %d\n", ret); in mt8173_rt5650_init()
162 ret = snd_soc_card_jack_new(rtd->card, "HDMI Jack", SND_JACK_LINEOUT, in mt8173_rt5650_hdmi_init()
167 return snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component, in mt8173_rt5650_hdmi_init()
194 SND_SOC_DAILINK_DEFS(codec,
196 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "rt5645-aif1"), /* Playback */
197 COMP_CODEC(NULL, "rt5645-aif1")),/* Capture */
202 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "i2s-hifi")),
205 /* Digital audio interface glue - connects codec <---> CPU */
234 .name = "Codec",
241 SND_SOC_DAILINK_REG(codec),
253 .name = "mtk-rt5650",
274 platform_node = of_parse_phandle(pdev->dev.of_node, in mt8173_rt5650_dev_probe()
277 dev_err(&pdev->dev, "Property 'platform' missing or invalid\n"); in mt8173_rt5650_dev_probe()
278 return -EINVAL; in mt8173_rt5650_dev_probe()
282 if (dai_link->platforms->name) in mt8173_rt5650_dev_probe()
284 dai_link->platforms->of_node = platform_node; in mt8173_rt5650_dev_probe()
288 of_parse_phandle(pdev->dev.of_node, "mediatek,audio-codec", 0); in mt8173_rt5650_dev_probe()
290 dev_err(&pdev->dev, in mt8173_rt5650_dev_probe()
291 "Property 'audio-codec' missing or invalid\n"); in mt8173_rt5650_dev_probe()
292 ret = -EINVAL; in mt8173_rt5650_dev_probe()
298 np = of_get_child_by_name(pdev->dev.of_node, "codec-capture"); in mt8173_rt5650_dev_probe()
303 dev_err(&pdev->dev, in mt8173_rt5650_dev_probe()
312 if (device_property_present(&pdev->dev, "mediatek,mclk")) { in mt8173_rt5650_dev_probe()
313 ret = device_property_read_u32(&pdev->dev, in mt8173_rt5650_dev_probe()
317 dev_err(&pdev->dev, in mt8173_rt5650_dev_probe()
323 mt8173_rt5650_dais[DAI_LINK_HDMI_I2S].codecs->of_node = in mt8173_rt5650_dev_probe()
324 of_parse_phandle(pdev->dev.of_node, "mediatek,audio-codec", 1); in mt8173_rt5650_dev_probe()
325 if (!mt8173_rt5650_dais[DAI_LINK_HDMI_I2S].codecs->of_node) { in mt8173_rt5650_dev_probe()
326 dev_err(&pdev->dev, in mt8173_rt5650_dev_probe()
327 "Property 'audio-codec' missing or invalid\n"); in mt8173_rt5650_dev_probe()
328 ret = -EINVAL; in mt8173_rt5650_dev_probe()
331 card->dev = &pdev->dev; in mt8173_rt5650_dev_probe()
333 ret = devm_snd_soc_register_card(&pdev->dev, card); in mt8173_rt5650_dev_probe()
341 { .compatible = "mediatek,mt8173-rt5650", },
348 .name = "mtk-rt5650",
361 MODULE_ALIAS("platform:mtk-rt5650");