Lines Matching +full:dmic +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0-only
26 #define DRV_NAME "rk3399-gru-sound"
79 dev_err(rtd->card->dev, "%s() error setting sysclk to %u: %d\n", in rockchip_sound_max98357a_hw_params()
101 dev_err(rtd->card->dev, "Can't set cpu clock out %d\n", ret); in rockchip_sound_rt5514_hw_params()
108 dev_err(rtd->card->dev, "%s() error setting sysclk to %u: %d\n", in rockchip_sound_rt5514_hw_params()
113 /* Wait for DMIC stable */ in rockchip_sound_rt5514_hw_params()
127 /* in bypass mode, the mclk has to be one of the frequencies below */ in rockchip_sound_da7219_hw_params()
145 return -EINVAL; in rockchip_sound_da7219_hw_params()
151 dev_err(codec_dai->dev, "Can't set cpu clock out %d\n", ret); in rockchip_sound_da7219_hw_params()
158 dev_err(codec_dai->dev, "Can't set codec clock in %d\n", ret); in rockchip_sound_da7219_hw_params()
164 dev_err(codec_dai->dev, "Can't set pll sysclk mclk %d\n", ret); in rockchip_sound_da7219_hw_params()
175 struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; in rockchip_sound_cdndp_init()
176 struct snd_soc_card *card = rtd->card; in rockchip_sound_cdndp_init()
183 dev_err(card->dev, "Can't create DP Jack %d\n", ret); in rockchip_sound_cdndp_init()
192 struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; in rockchip_sound_da7219_init()
200 dev_err(codec_dai->dev, "Init can't set codec clock in %d\n", ret); in rockchip_sound_da7219_init()
206 dev_err(codec_dai->dev, "Init can't set pll sysclk mclk %d\n", ret); in rockchip_sound_da7219_init()
211 ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack", in rockchip_sound_da7219_init()
220 dev_err(rtd->card->dev, "New Headset Jack failed! (%d)\n", ret); in rockchip_sound_da7219_init()
249 dev_err(rtd->card->dev, "%s() error setting sysclk to %u: %d\n", in rockchip_sound_dmic_hw_params()
254 /* Wait for DMIC stable */ in rockchip_sound_dmic_hw_params()
262 struct snd_pcm_runtime *runtime = substream->runtime; in rockchip_sound_startup()
264 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE; in rockchip_sound_startup()
290 .name = "rk3399-gru-sound",
309 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "spdif-hifi")),
314 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "da7219-hifi")),
317 SND_SOC_DAILINK_DEFS(dmic,
319 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "dmic-hifi")),
329 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "rt5514-aif1")),
357 .name = "DMIC",
358 .stream_name = "DMIC PCM",
362 SND_SOC_DAILINK_REG(dmic),
406 {"DMic", NULL, "Int Mic"},
456 .compatible = "rockchip,rk3399-cdn-dp",
462 .compatible = "dmic-codec",
497 return -1; in rockchip_sound_codec_node_match()
510 card->dai_link = devm_kzalloc(dev, sizeof(rockchip_dais), in rockchip_sound_of_parse_dais()
512 if (!card->dai_link) in rockchip_sound_of_parse_dais()
513 return -ENOMEM; in rockchip_sound_of_parse_dais()
521 return -ENOMEM; in rockchip_sound_of_parse_dais()
522 card->dapm_routes = routes; in rockchip_sound_of_parse_dais()
524 np_cpu0 = of_parse_phandle(dev->of_node, "rockchip,cpu", 0); in rockchip_sound_of_parse_dais()
525 np_cpu1 = of_parse_phandle(dev->of_node, "rockchip,cpu", 1); in rockchip_sound_of_parse_dais()
527 card->num_dapm_routes = 0; in rockchip_sound_of_parse_dais()
528 card->num_links = 0; in rockchip_sound_of_parse_dais()
530 np_codec = of_parse_phandle(dev->of_node, in rockchip_sound_of_parse_dais()
557 return -EINVAL; in rockchip_sound_of_parse_dais()
560 dai = &card->dai_link[card->num_links++]; in rockchip_sound_of_parse_dais()
563 if (!dai->codecs->name) in rockchip_sound_of_parse_dais()
564 dai->codecs->of_node = np_codec; in rockchip_sound_of_parse_dais()
565 dai->platforms->of_node = np_cpu; in rockchip_sound_of_parse_dais()
566 dai->cpus->of_node = np_cpu; in rockchip_sound_of_parse_dais()
568 if (card->num_dapm_routes + rockchip_routes[index].num_routes > in rockchip_sound_of_parse_dais()
571 return -EINVAL; in rockchip_sound_of_parse_dais()
574 memcpy(routes + card->num_dapm_routes, in rockchip_sound_of_parse_dais()
577 card->num_dapm_routes += rockchip_routes[index].num_routes; in rockchip_sound_of_parse_dais()
588 ret = rockchip_sound_of_parse_dais(&pdev->dev, card); in rockchip_sound_probe()
590 dev_err(&pdev->dev, "Failed to parse dais: %d\n", ret); in rockchip_sound_probe()
594 /* Set DMIC wakeup delay */ in rockchip_sound_probe()
595 ret = device_property_read_u32(&pdev->dev, "dmic-wakeup-delay-ms", in rockchip_sound_probe()
599 dev_dbg(&pdev->dev, in rockchip_sound_probe()
600 "no optional property 'dmic-wakeup-delay-ms' found, default: no delay\n"); in rockchip_sound_probe()
603 card->dev = &pdev->dev; in rockchip_sound_probe()
604 return devm_snd_soc_register_card(&pdev->dev, card); in rockchip_sound_probe()
608 { .compatible = "rockchip,rk3399-gru-sound", },
625 MODULE_AUTHOR("Xing Zheng <zhengxing@rock-chips.com>");