Lines Matching +full:playback +full:- +full:codecs

1 // SPDX-License-Identifier: GPL-2.0
3 * mt8173-rt5650.c -- MT8173 machine driver with RT5650 codecs
14 #include "../../codecs/rt5645.h"
116 struct snd_soc_card *card = runtime->card; in mt8173_rt5650_init()
117 struct snd_soc_component *component = asoc_rtd_to_codec(runtime, 0)->component; in mt8173_rt5650_init()
118 const char *codec_capture_dai = asoc_rtd_to_codec(runtime, 1)->name; in mt8173_rt5650_init()
125 if (!strcmp(codec_capture_dai, "rt5645-aif1")) { in mt8173_rt5650_init()
129 } else if (!strcmp(codec_capture_dai, "rt5645-aif2")) { in mt8173_rt5650_init()
134 dev_warn(card->dev, in mt8173_rt5650_init()
150 dev_err(card->dev, "Can't new Headset Jack %d\n", ret); in mt8173_rt5650_init()
164 ret = snd_soc_card_jack_new(rtd->card, "HDMI Jack", SND_JACK_LINEOUT, in mt8173_rt5650_hdmi_init()
169 return snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, in mt8173_rt5650_hdmi_init()
181 SND_SOC_DAILINK_DEFS(playback,
198 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "rt5645-aif1"), /* Playback */
199 COMP_CODEC(NULL, "rt5645-aif1")),/* Capture */
204 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "i2s-hifi")),
207 /* Digital audio interface glue - connects codec <---> CPU */
211 .name = "rt5650 Playback",
212 .stream_name = "rt5650 Playback",
216 SND_SOC_DAILINK_REG(playback),
257 .name = "mtk-rt5650",
278 platform_node = of_parse_phandle(pdev->dev.of_node, in mt8173_rt5650_dev_probe()
281 dev_err(&pdev->dev, "Property 'platform' missing or invalid\n"); in mt8173_rt5650_dev_probe()
282 return -EINVAL; in mt8173_rt5650_dev_probe()
286 if (dai_link->platforms->name) in mt8173_rt5650_dev_probe()
288 dai_link->platforms->of_node = platform_node; in mt8173_rt5650_dev_probe()
291 mt8173_rt5650_dais[DAI_LINK_CODEC_I2S].codecs[0].of_node = in mt8173_rt5650_dev_probe()
292 of_parse_phandle(pdev->dev.of_node, "mediatek,audio-codec", 0); in mt8173_rt5650_dev_probe()
293 if (!mt8173_rt5650_dais[DAI_LINK_CODEC_I2S].codecs[0].of_node) { in mt8173_rt5650_dev_probe()
294 dev_err(&pdev->dev, in mt8173_rt5650_dev_probe()
295 "Property 'audio-codec' missing or invalid\n"); in mt8173_rt5650_dev_probe()
296 ret = -EINVAL; in mt8173_rt5650_dev_probe()
299 mt8173_rt5650_dais[DAI_LINK_CODEC_I2S].codecs[1].of_node = in mt8173_rt5650_dev_probe()
300 mt8173_rt5650_dais[DAI_LINK_CODEC_I2S].codecs[0].of_node; in mt8173_rt5650_dev_probe()
302 np = of_get_child_by_name(pdev->dev.of_node, "codec-capture"); in mt8173_rt5650_dev_probe()
307 dev_err(&pdev->dev, in mt8173_rt5650_dev_probe()
312 mt8173_rt5650_dais[DAI_LINK_CODEC_I2S].codecs[1].dai_name = in mt8173_rt5650_dev_probe()
316 if (device_property_present(&pdev->dev, "mediatek,mclk")) { in mt8173_rt5650_dev_probe()
317 ret = device_property_read_u32(&pdev->dev, in mt8173_rt5650_dev_probe()
321 dev_err(&pdev->dev, in mt8173_rt5650_dev_probe()
327 mt8173_rt5650_dais[DAI_LINK_HDMI_I2S].codecs->of_node = in mt8173_rt5650_dev_probe()
328 of_parse_phandle(pdev->dev.of_node, "mediatek,audio-codec", 1); in mt8173_rt5650_dev_probe()
329 if (!mt8173_rt5650_dais[DAI_LINK_HDMI_I2S].codecs->of_node) { in mt8173_rt5650_dev_probe()
330 dev_err(&pdev->dev, in mt8173_rt5650_dev_probe()
331 "Property 'audio-codec' missing or invalid\n"); in mt8173_rt5650_dev_probe()
332 ret = -EINVAL; in mt8173_rt5650_dev_probe()
335 card->dev = &pdev->dev; in mt8173_rt5650_dev_probe()
337 ret = devm_snd_soc_register_card(&pdev->dev, card); in mt8173_rt5650_dev_probe()
345 { .compatible = "mediatek,mt8173-rt5650", },
352 .name = "mtk-rt5650",
365 MODULE_ALIAS("platform:mtk-rt5650");