Lines Matching +full:sco +full:- +full:routing

1 // SPDX-License-Identifier: GPL-2.0
3 * mt2701-cs42448.c -- MT2701 CS42448 ALSA SoC machine driver
17 #include "mt2701-afe-common.h"
41 ucontrol->value.integer.value[0] = priv->i2s1_in_mux; in mt2701_cs42448_i2sin1_mux_get()
51 if (ucontrol->value.integer.value[0] == priv->i2s1_in_mux) in mt2701_cs42448_i2sin1_mux_set()
54 switch (ucontrol->value.integer.value[0]) { in mt2701_cs42448_i2sin1_mux_set()
56 gpio_set_value(priv->i2s1_in_mux_gpio_sel_1, 0); in mt2701_cs42448_i2sin1_mux_set()
57 gpio_set_value(priv->i2s1_in_mux_gpio_sel_2, 0); in mt2701_cs42448_i2sin1_mux_set()
60 gpio_set_value(priv->i2s1_in_mux_gpio_sel_1, 1); in mt2701_cs42448_i2sin1_mux_set()
61 gpio_set_value(priv->i2s1_in_mux_gpio_sel_2, 0); in mt2701_cs42448_i2sin1_mux_set()
64 gpio_set_value(priv->i2s1_in_mux_gpio_sel_1, 0); in mt2701_cs42448_i2sin1_mux_set()
65 gpio_set_value(priv->i2s1_in_mux_gpio_sel_2, 1); in mt2701_cs42448_i2sin1_mux_set()
68 gpio_set_value(priv->i2s1_in_mux_gpio_sel_1, 1); in mt2701_cs42448_i2sin1_mux_set()
69 gpio_set_value(priv->i2s1_in_mux_gpio_sel_2, 1); in mt2701_cs42448_i2sin1_mux_set()
72 dev_warn(card->dev, "%s invalid setting\n", __func__); in mt2701_cs42448_i2sin1_mux_set()
75 priv->i2s1_in_mux = ucontrol->value.integer.value[0]; in mt2701_cs42448_i2sin1_mux_set()
111 err = snd_pcm_hw_constraint_list(substream->runtime, 0, in mt2701_cs42448_fe_ops_startup()
115 dev_err(substream->pcm->card->dev, in mt2701_cs42448_fe_ops_startup()
213 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "bt-sco-pcm-wb")),
219 .name = "mt2701-cs42448-multi-ch-out",
220 .stream_name = "mt2701-cs42448-multi-ch-out",
229 .name = "mt2701-cs42448-pcm0",
230 .stream_name = "mt2701-cs42448-pcm0-data-UL",
239 .name = "mt2701-cs42448-pcm1-data-UL",
240 .stream_name = "mt2701-cs42448-pcm1-data-UL",
249 .name = "mt2701-cs42448-pcm-BT-out",
250 .stream_name = "mt2701-cs42448-pcm-BT",
258 .name = "mt2701-cs42448-pcm-BT-in",
259 .stream_name = "mt2701-cs42448-pcm-BT",
268 .name = "mt2701-cs42448-I2S0",
278 .name = "mt2701-cs42448-I2S1",
288 .name = "mt2701-cs42448-I2S2",
298 .name = "mt2701-cs42448-I2S3",
308 .name = "mt2701-cs42448-MRG-BT",
317 .name = "mt2701-cs42448",
334 devm_kzalloc(&pdev->dev, sizeof(struct mt2701_cs42448_private), in mt2701_cs42448_machine_probe()
336 struct device *dev = &pdev->dev; in mt2701_cs42448_machine_probe()
340 return -ENOMEM; in mt2701_cs42448_machine_probe()
342 platform_node = of_parse_phandle(pdev->dev.of_node, in mt2701_cs42448_machine_probe()
345 dev_err(&pdev->dev, "Property 'platform' missing or invalid\n"); in mt2701_cs42448_machine_probe()
346 return -EINVAL; in mt2701_cs42448_machine_probe()
349 if (dai_link->platforms->name) in mt2701_cs42448_machine_probe()
351 dai_link->platforms->of_node = platform_node; in mt2701_cs42448_machine_probe()
354 card->dev = dev; in mt2701_cs42448_machine_probe()
356 codec_node = of_parse_phandle(pdev->dev.of_node, in mt2701_cs42448_machine_probe()
357 "mediatek,audio-codec", 0); in mt2701_cs42448_machine_probe()
359 dev_err(&pdev->dev, in mt2701_cs42448_machine_probe()
360 "Property 'audio-codec' missing or invalid\n"); in mt2701_cs42448_machine_probe()
361 return -EINVAL; in mt2701_cs42448_machine_probe()
364 if (dai_link->codecs->name) in mt2701_cs42448_machine_probe()
366 dai_link->codecs->of_node = codec_node; in mt2701_cs42448_machine_probe()
369 codec_node_bt_mrg = of_parse_phandle(pdev->dev.of_node, in mt2701_cs42448_machine_probe()
370 "mediatek,audio-codec-bt-mrg", 0); in mt2701_cs42448_machine_probe()
372 dev_err(&pdev->dev, in mt2701_cs42448_machine_probe()
373 "Property 'audio-codec-bt-mrg' missing or invalid\n"); in mt2701_cs42448_machine_probe()
374 return -EINVAL; in mt2701_cs42448_machine_probe()
376 mt2701_cs42448_dai_links[DAI_LINK_BE_MRG_BT].codecs->of_node in mt2701_cs42448_machine_probe()
379 ret = snd_soc_of_parse_audio_routing(card, "audio-routing"); in mt2701_cs42448_machine_probe()
381 dev_err(&pdev->dev, "failed to parse audio-routing: %d\n", ret); in mt2701_cs42448_machine_probe()
385 priv->i2s1_in_mux_gpio_sel_1 = in mt2701_cs42448_machine_probe()
386 of_get_named_gpio(dev->of_node, "i2s1-in-sel-gpio1", 0); in mt2701_cs42448_machine_probe()
387 if (gpio_is_valid(priv->i2s1_in_mux_gpio_sel_1)) { in mt2701_cs42448_machine_probe()
388 ret = devm_gpio_request(dev, priv->i2s1_in_mux_gpio_sel_1, in mt2701_cs42448_machine_probe()
391 dev_warn(&pdev->dev, "%s devm_gpio_request fail %d\n", in mt2701_cs42448_machine_probe()
393 gpio_direction_output(priv->i2s1_in_mux_gpio_sel_1, 0); in mt2701_cs42448_machine_probe()
396 priv->i2s1_in_mux_gpio_sel_2 = in mt2701_cs42448_machine_probe()
397 of_get_named_gpio(dev->of_node, "i2s1-in-sel-gpio2", 0); in mt2701_cs42448_machine_probe()
398 if (gpio_is_valid(priv->i2s1_in_mux_gpio_sel_2)) { in mt2701_cs42448_machine_probe()
399 ret = devm_gpio_request(dev, priv->i2s1_in_mux_gpio_sel_2, in mt2701_cs42448_machine_probe()
402 dev_warn(&pdev->dev, "%s devm_gpio_request fail2 %d\n", in mt2701_cs42448_machine_probe()
404 gpio_direction_output(priv->i2s1_in_mux_gpio_sel_2, 0); in mt2701_cs42448_machine_probe()
408 ret = devm_snd_soc_register_card(&pdev->dev, card); in mt2701_cs42448_machine_probe()
411 dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n", in mt2701_cs42448_machine_probe()
418 {.compatible = "mediatek,mt2701-cs42448-machine",},
426 .name = "mt2701-cs42448",