Lines Matching +full:dmic +full:- +full:init +full:- +full:delay +full:- +full:ms
1 // SPDX-License-Identifier: GPL-2.0-only
11 #include <linux/delay.h>
24 #define DRV_NAME "rk3399-gru-sound"
77 dev_err(rtd->card->dev, "%s() error setting sysclk to %u: %d\n", in rockchip_sound_max98357a_hw_params()
99 dev_err(rtd->card->dev, "Can't set cpu clock out %d\n", ret); in rockchip_sound_rt5514_hw_params()
106 dev_err(rtd->card->dev, "%s() error setting sysclk to %u: %d\n", in rockchip_sound_rt5514_hw_params()
111 /* Wait for DMIC stable */ in rockchip_sound_rt5514_hw_params()
143 return -EINVAL; in rockchip_sound_da7219_hw_params()
149 dev_err(codec_dai->dev, "Can't set cpu clock out %d\n", ret); in rockchip_sound_da7219_hw_params()
156 dev_err(codec_dai->dev, "Can't set codec clock in %d\n", ret); in rockchip_sound_da7219_hw_params()
162 dev_err(codec_dai->dev, "Can't set pll sysclk mclk %d\n", ret); in rockchip_sound_da7219_hw_params()
173 struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; in rockchip_sound_cdndp_init()
174 struct snd_soc_card *card = rtd->card; in rockchip_sound_cdndp_init()
181 dev_err(card->dev, "Can't create DP Jack %d\n", ret); in rockchip_sound_cdndp_init()
190 struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; in rockchip_sound_da7219_init()
198 dev_err(codec_dai->dev, "Init can't set codec clock in %d\n", ret); in rockchip_sound_da7219_init()
204 dev_err(codec_dai->dev, "Init can't set pll sysclk mclk %d\n", ret); in rockchip_sound_da7219_init()
209 ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack", in rockchip_sound_da7219_init()
218 dev_err(rtd->card->dev, "New Headset Jack failed! (%d)\n", ret); in rockchip_sound_da7219_init()
247 dev_err(rtd->card->dev, "%s() error setting sysclk to %u: %d\n", in rockchip_sound_dmic_hw_params()
252 /* Wait for DMIC stable */ in rockchip_sound_dmic_hw_params()
260 struct snd_pcm_runtime *runtime = substream->runtime; in rockchip_sound_startup()
262 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE; in rockchip_sound_startup()
288 .name = "rk3399-gru-sound",
307 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "spdif-hifi")),
312 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "da7219-hifi")),
315 SND_SOC_DAILINK_DEFS(dmic,
317 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "dmic-hifi")),
327 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "rt5514-aif1")),
339 .init = rockchip_sound_cdndp_init,
347 .init = rockchip_sound_da7219_init,
355 .name = "DMIC",
356 .stream_name = "DMIC PCM",
360 SND_SOC_DAILINK_REG(dmic),
404 {"DMic", NULL, "Int Mic"},
454 .compatible = "rockchip,rk3399-cdn-dp",
460 .compatible = "dmic-codec",
495 return -1; in rockchip_sound_codec_node_match()
508 card->dai_link = devm_kzalloc(dev, sizeof(rockchip_dais), in rockchip_sound_of_parse_dais()
510 if (!card->dai_link) in rockchip_sound_of_parse_dais()
511 return -ENOMEM; in rockchip_sound_of_parse_dais()
519 return -ENOMEM; in rockchip_sound_of_parse_dais()
520 card->dapm_routes = routes; in rockchip_sound_of_parse_dais()
522 np_cpu0 = of_parse_phandle(dev->of_node, "rockchip,cpu", 0); in rockchip_sound_of_parse_dais()
523 np_cpu1 = of_parse_phandle(dev->of_node, "rockchip,cpu", 1); in rockchip_sound_of_parse_dais()
525 card->num_dapm_routes = 0; in rockchip_sound_of_parse_dais()
526 card->num_links = 0; in rockchip_sound_of_parse_dais()
528 np_codec = of_parse_phandle(dev->of_node, in rockchip_sound_of_parse_dais()
555 return -EINVAL; in rockchip_sound_of_parse_dais()
558 dai = &card->dai_link[card->num_links++]; in rockchip_sound_of_parse_dais()
561 if (!dai->codecs->name) in rockchip_sound_of_parse_dais()
562 dai->codecs->of_node = np_codec; in rockchip_sound_of_parse_dais()
563 dai->platforms->of_node = np_cpu; in rockchip_sound_of_parse_dais()
564 dai->cpus->of_node = np_cpu; in rockchip_sound_of_parse_dais()
566 if (card->num_dapm_routes + rockchip_routes[index].num_routes > in rockchip_sound_of_parse_dais()
569 return -EINVAL; in rockchip_sound_of_parse_dais()
572 memcpy(routes + card->num_dapm_routes, in rockchip_sound_of_parse_dais()
575 card->num_dapm_routes += rockchip_routes[index].num_routes; in rockchip_sound_of_parse_dais()
586 ret = rockchip_sound_of_parse_dais(&pdev->dev, card); in rockchip_sound_probe()
588 dev_err(&pdev->dev, "Failed to parse dais: %d\n", ret); in rockchip_sound_probe()
592 /* Set DMIC wakeup delay */ in rockchip_sound_probe()
593 ret = device_property_read_u32(&pdev->dev, "dmic-wakeup-delay-ms", in rockchip_sound_probe()
597 dev_dbg(&pdev->dev, in rockchip_sound_probe()
598 "no optional property 'dmic-wakeup-delay-ms' found, default: no delay\n"); in rockchip_sound_probe()
601 card->dev = &pdev->dev; in rockchip_sound_probe()
602 return devm_snd_soc_register_card(&pdev->dev, card); in rockchip_sound_probe()
606 { .compatible = "rockchip,rk3399-gru-sound", },
623 MODULE_AUTHOR("Xing Zheng <zhengxing@rock-chips.com>");