Lines Matching +full:dmic +full:- +full:sample +full:- +full:rate
1 // SPDX-License-Identifier: MIT
5 //Copyright 2017-2021 Advanced Micro Devices, Inc.
11 #include <sound/soc-dapm.h>
24 #include "../codecs/da7219-aad.h"
42 struct snd_soc_card *card = rtd->card; in cz_da7219_init()
44 struct snd_soc_component *component = codec_dai->component; in cz_da7219_init()
46 dev_info(rtd->dev, "codec dai name = %s\n", codec_dai->name); in cz_da7219_init()
51 dev_err(rtd->dev, "can't set codec sysclk: %d\n", ret); in cz_da7219_init()
58 dev_err(rtd->dev, "can't set codec pll: %d\n", ret); in cz_da7219_init()
62 da7219_dai_wclk = devm_clk_get(component->dev, "da7219-dai-wclk"); in cz_da7219_init()
66 da7219_dai_bclk = devm_clk_get(component->dev, "da7219-dai-bclk"); in cz_da7219_init()
76 dev_err(card->dev, "HP jack creation failed %d\n", ret); in cz_da7219_init()
96 * Set wclk to 48000 because the rate constraint of this driver is in da7219_clk_enable()
97 * 48000. ADAU7002 spec: "The ADAU7002 requires a BCLK rate that is in da7219_clk_enable()
98 * minimum of 64x the LRCLK sample rate." DA7219 is the only clk in da7219_clk_enable()
105 dev_err(rtd->dev, "can't enable master clock %d\n", ret); in da7219_clk_enable()
120 struct snd_soc_card *card = rtd->card; in cz_rt5682_init()
122 struct snd_soc_component *component = codec_dai->component; in cz_rt5682_init()
124 dev_info(codec_dai->dev, "codec dai name = %s\n", codec_dai->name); in cz_rt5682_init()
130 dev_err(codec_dai->dev, in cz_rt5682_init()
138 dev_err(codec_dai->dev, "can't set rt5682 PLL: %d\n", ret); in cz_rt5682_init()
142 rt5682_dai_wclk = devm_clk_get(component->dev, "rt5682-dai-wclk"); in cz_rt5682_init()
146 rt5682_dai_bclk = devm_clk_get(component->dev, "rt5682-dai-bclk"); in cz_rt5682_init()
156 dev_err(card->dev, "HP jack creation failed %d\n", ret); in cz_rt5682_init()
167 dev_err(rtd->dev, "Headset Jack call-back failed: %d\n", ret); in cz_rt5682_init()
179 * Set wclk to 48000 because the rate constraint of this driver is in rt5682_clk_enable()
180 * 48000. ADAU7002 spec: "The ADAU7002 requires a BCLK rate that is in rt5682_clk_enable()
181 * minimum of 64x the LRCLK sample rate." RT5682 is the only clk in rt5682_clk_enable()
186 dev_err(rtd->dev, "Error setting wclk rate: %d\n", ret); in rt5682_clk_enable()
191 dev_err(rtd->dev, "Error setting bclk rate: %d\n", ret); in rt5682_clk_enable()
196 dev_err(rtd->dev, "can't enable wclk %d\n", ret); in rt5682_clk_enable()
229 struct snd_pcm_runtime *runtime = substream->runtime; in cz_da7219_play_startup()
231 struct snd_soc_card *card = rtd->card; in cz_da7219_play_startup()
238 runtime->hw.channels_max = DUAL_CHANNEL; in cz_da7219_play_startup()
244 machine->play_i2s_instance = I2S_SP_INSTANCE; in cz_da7219_play_startup()
250 struct snd_pcm_runtime *runtime = substream->runtime; in cz_da7219_cap_startup()
252 struct snd_soc_card *card = rtd->card; in cz_da7219_cap_startup()
259 runtime->hw.channels_max = DUAL_CHANNEL; in cz_da7219_cap_startup()
265 machine->cap_i2s_instance = I2S_SP_INSTANCE; in cz_da7219_cap_startup()
266 machine->capture_channel = CAP_CHANNEL1; in cz_da7219_cap_startup()
272 struct snd_pcm_runtime *runtime = substream->runtime; in cz_max_startup()
274 struct snd_soc_card *card = rtd->card; in cz_max_startup()
281 runtime->hw.channels_max = DUAL_CHANNEL; in cz_max_startup()
287 machine->play_i2s_instance = I2S_BT_INSTANCE; in cz_max_startup()
293 struct snd_pcm_runtime *runtime = substream->runtime; in cz_dmic0_startup()
295 struct snd_soc_card *card = rtd->card; in cz_dmic0_startup()
302 runtime->hw.channels_max = DUAL_CHANNEL; in cz_dmic0_startup()
308 machine->cap_i2s_instance = I2S_BT_INSTANCE; in cz_dmic0_startup()
314 struct snd_pcm_runtime *runtime = substream->runtime; in cz_dmic1_startup()
316 struct snd_soc_card *card = rtd->card; in cz_dmic1_startup()
323 runtime->hw.channels_max = DUAL_CHANNEL; in cz_dmic1_startup()
329 machine->cap_i2s_instance = I2S_SP_INSTANCE; in cz_dmic1_startup()
330 machine->capture_channel = CAP_CHANNEL0; in cz_dmic1_startup()
341 struct snd_pcm_runtime *runtime = substream->runtime; in cz_rt5682_play_startup()
343 struct snd_soc_card *card = rtd->card; in cz_rt5682_play_startup()
350 runtime->hw.channels_max = DUAL_CHANNEL; in cz_rt5682_play_startup()
356 machine->play_i2s_instance = I2S_SP_INSTANCE; in cz_rt5682_play_startup()
362 struct snd_pcm_runtime *runtime = substream->runtime; in cz_rt5682_cap_startup()
364 struct snd_soc_card *card = rtd->card; in cz_rt5682_cap_startup()
371 runtime->hw.channels_max = DUAL_CHANNEL; in cz_rt5682_cap_startup()
377 machine->cap_i2s_instance = I2S_SP_INSTANCE; in cz_rt5682_cap_startup()
378 machine->capture_channel = CAP_CHANNEL1; in cz_rt5682_cap_startup()
384 struct snd_pcm_runtime *runtime = substream->runtime; in cz_rt5682_max_startup()
386 struct snd_soc_card *card = rtd->card; in cz_rt5682_max_startup()
393 runtime->hw.channels_max = DUAL_CHANNEL; in cz_rt5682_max_startup()
399 machine->play_i2s_instance = I2S_BT_INSTANCE; in cz_rt5682_max_startup()
405 struct snd_pcm_runtime *runtime = substream->runtime; in cz_rt5682_dmic0_startup()
407 struct snd_soc_card *card = rtd->card; in cz_rt5682_dmic0_startup()
414 runtime->hw.channels_max = DUAL_CHANNEL; in cz_rt5682_dmic0_startup()
420 machine->cap_i2s_instance = I2S_BT_INSTANCE; in cz_rt5682_dmic0_startup()
426 struct snd_pcm_runtime *runtime = substream->runtime; in cz_rt5682_dmic1_startup()
428 struct snd_soc_card *card = rtd->card; in cz_rt5682_dmic1_startup()
435 runtime->hw.channels_max = DUAL_CHANNEL; in cz_rt5682_dmic1_startup()
441 machine->cap_i2s_instance = I2S_SP_INSTANCE; in cz_rt5682_dmic1_startup()
442 machine->capture_channel = CAP_CHANNEL0; in cz_rt5682_dmic1_startup()
502 DAILINK_COMP_ARRAY(COMP_CPU("designware-i2s.1.auto")));
504 DAILINK_COMP_ARRAY(COMP_CPU("designware-i2s.2.auto")));
506 DAILINK_COMP_ARRAY(COMP_CPU("designware-i2s.3.auto")));
509 DAILINK_COMP_ARRAY(COMP_CODEC("i2c-DLGS7219:00", "da7219-hifi")));
511 DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC5682:00", "rt5682-aif1")));
515 DAILINK_COMP_ARRAY(COMP_CODEC("ADAU7002:00", "adau7002-hifi")));
522 .name = "amd-da7219-play",
533 .name = "amd-da7219-cap",
543 .name = "amd-max98357-play",
553 /* C panel DMIC */
564 /* A/B panel DMIC */
578 .name = "amd-rt5682-play",
589 .name = "amd-rt5682-cap",
599 .name = "amd-max98357-play",
609 /* C panel DMIC */
620 /* A/B panel DMIC */
691 match = acpi_match_device(dev->driver->acpi_match_table, dev); in acp_soc_is_rltk_max()
694 return (void *)match->driver_data; in acp_soc_is_rltk_max()
698 REGULATOR_SUPPLY("VDD", "i2c-DLGS7219:00"),
699 REGULATOR_SUPPLY("VDDMIC", "i2c-DLGS7219:00"),
700 REGULATOR_SUPPLY("VDDIO", "i2c-DLGS7219:00"),
720 .name = "reg-fixed-1.8V",
734 struct device *dev = &pdev->dev; in cz_probe()
738 return -ENODEV; in cz_probe()
739 if (!strcmp(card->name, "acpd7219m98357")) { in cz_probe()
740 acp_da7219_cfg.dev = &pdev->dev; in cz_probe()
741 rdev = devm_regulator_register(&pdev->dev, &acp_da7219_desc, in cz_probe()
744 dev_err(&pdev->dev, "Failed to register regulator: %d\n", in cz_probe()
746 return -EINVAL; in cz_probe()
750 machine = devm_kzalloc(&pdev->dev, sizeof(struct acp_platform_info), in cz_probe()
753 return -ENOMEM; in cz_probe()
754 card->dev = &pdev->dev; in cz_probe()
757 ret = devm_snd_soc_register_card(&pdev->dev, card); in cz_probe()
759 return dev_err_probe(&pdev->dev, ret, in cz_probe()
761 card->name); in cz_probe()
763 acp_bt_uart_enable = !device_property_read_bool(&pdev->dev, in cz_probe()
764 "bt-pad-enable"); in cz_probe()
779 .name = "cz-da7219-max98357a",