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()
169 struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; in rockchip_sound_da7219_init()
177 dev_err(codec_dai->dev, "Init can't set codec clock in %d\n", ret); in rockchip_sound_da7219_init()
183 dev_err(codec_dai->dev, "Init can't set pll sysclk mclk %d\n", ret); in rockchip_sound_da7219_init()
188 ret = snd_soc_card_jack_new(rtd->card, "Headset Jack", in rockchip_sound_da7219_init()
197 dev_err(rtd->card->dev, "New Headset Jack failed! (%d)\n", ret); in rockchip_sound_da7219_init()
226 dev_err(rtd->card->dev, "%s() error setting sysclk to %u: %d\n", in rockchip_sound_dmic_hw_params()
231 /* Wait for DMIC stable */ in rockchip_sound_dmic_hw_params()
239 struct snd_pcm_runtime *runtime = substream->runtime; in rockchip_sound_startup()
241 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE; in rockchip_sound_startup()
267 .name = "rk3399-gru-sound",
286 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "spdif-hifi")),
291 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "da7219-hifi")),
294 SND_SOC_DAILINK_DEFS(dmic,
296 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "dmic-hifi")),
306 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "rt5514-aif1")),
333 .name = "DMIC",
334 .stream_name = "DMIC PCM",
338 SND_SOC_DAILINK_REG(dmic),
382 {"DMic", NULL, "Int Mic"},
432 .compatible = "rockchip,rk3399-cdn-dp",
438 .compatible = "dmic-codec",
473 return -1; in rockchip_sound_codec_node_match()
486 card->dai_link = devm_kzalloc(dev, sizeof(rockchip_dais), in rockchip_sound_of_parse_dais()
488 if (!card->dai_link) in rockchip_sound_of_parse_dais()
489 return -ENOMEM; in rockchip_sound_of_parse_dais()
497 return -ENOMEM; in rockchip_sound_of_parse_dais()
498 card->dapm_routes = routes; in rockchip_sound_of_parse_dais()
500 np_cpu0 = of_parse_phandle(dev->of_node, "rockchip,cpu", 0); in rockchip_sound_of_parse_dais()
501 np_cpu1 = of_parse_phandle(dev->of_node, "rockchip,cpu", 1); in rockchip_sound_of_parse_dais()
503 card->num_dapm_routes = 0; in rockchip_sound_of_parse_dais()
504 card->num_links = 0; in rockchip_sound_of_parse_dais()
506 np_codec = of_parse_phandle(dev->of_node, in rockchip_sound_of_parse_dais()
533 return -EINVAL; in rockchip_sound_of_parse_dais()
536 dai = &card->dai_link[card->num_links++]; in rockchip_sound_of_parse_dais()
539 if (!dai->codecs->name) in rockchip_sound_of_parse_dais()
540 dai->codecs->of_node = np_codec; in rockchip_sound_of_parse_dais()
541 dai->platforms->of_node = np_cpu; in rockchip_sound_of_parse_dais()
542 dai->cpus->of_node = np_cpu; in rockchip_sound_of_parse_dais()
544 if (card->num_dapm_routes + rockchip_routes[index].num_routes > in rockchip_sound_of_parse_dais()
547 return -EINVAL; in rockchip_sound_of_parse_dais()
550 memcpy(routes + card->num_dapm_routes, in rockchip_sound_of_parse_dais()
553 card->num_dapm_routes += rockchip_routes[index].num_routes; in rockchip_sound_of_parse_dais()
564 ret = rockchip_sound_of_parse_dais(&pdev->dev, card); in rockchip_sound_probe()
566 dev_err(&pdev->dev, "Failed to parse dais: %d\n", ret); in rockchip_sound_probe()
570 /* Set DMIC wakeup delay */ in rockchip_sound_probe()
571 ret = device_property_read_u32(&pdev->dev, "dmic-wakeup-delay-ms", in rockchip_sound_probe()
575 dev_dbg(&pdev->dev, in rockchip_sound_probe()
576 "no optional property 'dmic-wakeup-delay-ms' found, default: no delay\n"); in rockchip_sound_probe()
579 card->dev = &pdev->dev; in rockchip_sound_probe()
580 return devm_snd_soc_register_card(&pdev->dev, card); in rockchip_sound_probe()
584 { .compatible = "rockchip,rk3399-gru-sound", },
601 MODULE_AUTHOR("Xing Zheng <zhengxing@rock-chips.com>");