Lines Matching +full:dmic +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0-only
24 #include "../codecs/da7219-aad.h"
27 #define DRV_NAME "rk3399-gru-sound"
75 dev_err(rtd->card->dev, "%s() error setting sysclk to %u: %d\n", in rockchip_sound_max98357a_hw_params()
97 dev_err(rtd->card->dev, "Can't set cpu clock out %d\n", ret); in rockchip_sound_rt5514_hw_params()
104 dev_err(rtd->card->dev, "%s() error setting sysclk to %u: %d\n", in rockchip_sound_rt5514_hw_params()
109 /* Wait for DMIC stable */ in rockchip_sound_rt5514_hw_params()
123 /* in bypass mode, the mclk has to be one of the frequencies below */ in rockchip_sound_da7219_hw_params()
141 return -EINVAL; in rockchip_sound_da7219_hw_params()
147 dev_err(codec_dai->dev, "Can't set cpu clock out %d\n", ret); in rockchip_sound_da7219_hw_params()
154 dev_err(codec_dai->dev, "Can't set codec clock in %d\n", ret); in rockchip_sound_da7219_hw_params()
160 dev_err(codec_dai->dev, "Can't set pll sysclk mclk %d\n", ret); in rockchip_sound_da7219_hw_params()
171 struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; in rockchip_sound_cdndp_init()
172 struct snd_soc_card *card = rtd->card; in rockchip_sound_cdndp_init()
179 dev_err(card->dev, "Can't create DP Jack %d\n", ret); in rockchip_sound_cdndp_init()
188 struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; in rockchip_sound_da7219_init()
196 dev_err(codec_dai->dev, "Init can't set codec clock in %d\n", ret); in rockchip_sound_da7219_init()
202 dev_err(codec_dai->dev, "Init can't set pll sysclk mclk %d\n", ret); in rockchip_sound_da7219_init()
207 ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack", in rockchip_sound_da7219_init()
216 dev_err(rtd->card->dev, "New Headset Jack failed! (%d)\n", ret); in rockchip_sound_da7219_init()
245 dev_err(rtd->card->dev, "%s() error setting sysclk to %u: %d\n", in rockchip_sound_dmic_hw_params()
250 /* Wait for DMIC stable */ in rockchip_sound_dmic_hw_params()
258 struct snd_pcm_runtime *runtime = substream->runtime; in rockchip_sound_startup()
260 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE; in rockchip_sound_startup()
286 .name = "rk3399-gru-sound",
305 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "spdif-hifi")),
310 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "da7219-hifi")),
313 SND_SOC_DAILINK_DEFS(dmic,
315 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "dmic-hifi")),
325 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "rt5514-aif1")),
353 .name = "DMIC",
354 .stream_name = "DMIC PCM",
358 SND_SOC_DAILINK_REG(dmic),
402 {"DMic", NULL, "Int Mic"},
452 .compatible = "rockchip,rk3399-cdn-dp",
458 .compatible = "dmic-codec",
493 return -1; in rockchip_sound_codec_node_match()
506 card->dai_link = devm_kzalloc(dev, sizeof(rockchip_dais), in rockchip_sound_of_parse_dais()
508 if (!card->dai_link) in rockchip_sound_of_parse_dais()
509 return -ENOMEM; in rockchip_sound_of_parse_dais()
517 return -ENOMEM; in rockchip_sound_of_parse_dais()
518 card->dapm_routes = routes; in rockchip_sound_of_parse_dais()
520 np_cpu0 = of_parse_phandle(dev->of_node, "rockchip,cpu", 0); in rockchip_sound_of_parse_dais()
521 np_cpu1 = of_parse_phandle(dev->of_node, "rockchip,cpu", 1); in rockchip_sound_of_parse_dais()
523 card->num_dapm_routes = 0; in rockchip_sound_of_parse_dais()
524 card->num_links = 0; in rockchip_sound_of_parse_dais()
526 np_codec = of_parse_phandle(dev->of_node, in rockchip_sound_of_parse_dais()
553 return -EINVAL; in rockchip_sound_of_parse_dais()
556 dai = &card->dai_link[card->num_links++]; in rockchip_sound_of_parse_dais()
559 if (!dai->codecs->name) in rockchip_sound_of_parse_dais()
560 dai->codecs->of_node = np_codec; in rockchip_sound_of_parse_dais()
561 dai->platforms->of_node = np_cpu; in rockchip_sound_of_parse_dais()
562 dai->cpus->of_node = np_cpu; in rockchip_sound_of_parse_dais()
564 if (card->num_dapm_routes + rockchip_routes[index].num_routes > in rockchip_sound_of_parse_dais()
567 return -EINVAL; in rockchip_sound_of_parse_dais()
570 memcpy(routes + card->num_dapm_routes, in rockchip_sound_of_parse_dais()
573 card->num_dapm_routes += rockchip_routes[index].num_routes; in rockchip_sound_of_parse_dais()
584 ret = rockchip_sound_of_parse_dais(&pdev->dev, card); in rockchip_sound_probe()
586 dev_err(&pdev->dev, "Failed to parse dais: %d\n", ret); in rockchip_sound_probe()
590 /* Set DMIC wakeup delay */ in rockchip_sound_probe()
591 ret = device_property_read_u32(&pdev->dev, "dmic-wakeup-delay-ms", in rockchip_sound_probe()
595 dev_dbg(&pdev->dev, in rockchip_sound_probe()
596 "no optional property 'dmic-wakeup-delay-ms' found, default: no delay\n"); in rockchip_sound_probe()
599 card->dev = &pdev->dev; in rockchip_sound_probe()
600 return devm_snd_soc_register_card(&pdev->dev, card); in rockchip_sound_probe()
604 { .compatible = "rockchip,rk3399-gru-sound", },
621 MODULE_AUTHOR("Xing Zheng <zhengxing@rock-chips.com>");