Lines Matching +full:d +full:- +full:link
1 // SPDX-License-Identifier: GPL-2.0-only
10 #include <sound/soc-acpi.h>
11 #include <sound/soc-dai.h>
12 #include <sound/soc-dapm.h>
18 #include "../common/soc-intel-quirks.h"
55 for_each_acpi_dev_match(adev, hid, NULL, -1) in get_num_codecs()
150 dev_err(codec_dai->dev, "fail to set pll, ret %d\n", in rt1011_hw_params()
158 dev_err(codec_dai->dev, "fail to set sysclk, ret %d\n", in rt1011_hw_params()
164 dev_err(codec_dai->dev, "invalid codec index %d\n", in rt1011_hw_params()
166 return -ENODEV; in rt1011_hw_params()
173 dev_err(codec_dai->dev, "fail to set tdm slot, ret %d\n", in rt1011_hw_params()
188 struct snd_soc_card *card = rtd->card; in rt1011_init()
195 ret = snd_soc_dapm_new_controls(&card->dapm, realtek_2spk_widgets, in rt1011_init()
198 dev_err(rtd->dev, "fail to add rt1011 widgets, ret %d\n", in rt1011_init()
206 dev_err(rtd->dev, "fail to add rt1011 kcontrols, ret %d\n", in rt1011_init()
211 ret = snd_soc_dapm_add_routes(&card->dapm, speaker_map_lr, in rt1011_init()
214 dev_err(rtd->dev, "fail to add rt1011 routes, ret %d\n", in rt1011_init()
228 ret = snd_soc_dapm_new_controls(&card->dapm, realtek_4spk_widgets, in rt1011_init()
231 dev_err(rtd->dev, "fail to add rt1011 widgets, ret %d\n", in rt1011_init()
239 dev_err(rtd->dev, "fail to add rt1011 controls, ret %d\n", in rt1011_init()
244 ret = snd_soc_dapm_add_routes(&card->dapm, rt1011_4spk_routes, in rt1011_init()
247 dev_err(rtd->dev, "fail to add rt1011 routes, ret %d\n", in rt1011_init()
253 dev_err(rtd->dev, "rt1011: invalid num_codecs %d\n", num_codecs); in rt1011_init()
254 return -EINVAL; in rt1011_init()
260 void sof_rt1011_dai_link(struct device *dev, struct snd_soc_dai_link *link) in sof_rt1011_dai_link() argument
264 link->codecs = rt1011_dai_link_components; in sof_rt1011_dai_link()
269 link->num_codecs = num_codecs; in sof_rt1011_dai_link()
272 dev_err(dev, "rt1011: invalid num_codecs %d\n", num_codecs); in sof_rt1011_dai_link()
276 link->init = rt1011_init; in sof_rt1011_dai_link()
277 link->ops = &rt1011_ops; in sof_rt1011_dai_link()
292 card->codec_conf = rt1011_4spk_codec_confs; in sof_rt1011_codec_conf()
294 card->codec_conf = rt1011_2spk_codec_confs; in sof_rt1011_codec_conf()
297 card->num_configs = num_codecs; in sof_rt1011_codec_conf()
300 card->codec_conf = rt1011_4spk_codec_confs; in sof_rt1011_codec_conf()
301 card->num_configs = ARRAY_SIZE(rt1011_4spk_codec_confs); in sof_rt1011_codec_conf()
304 dev_err(dev, "rt1011: invalid num_codecs %d\n", num_codecs); in sof_rt1011_codec_conf()
313 * rt1015p: auto-mode driver for ALC1015, ALC1015Q, and ALC1015Q-VB
346 struct snd_soc_card *card = rtd->card; in rt1015p_init()
349 ret = snd_soc_dapm_new_controls(&card->dapm, realtek_2spk_widgets, in rt1015p_init()
352 dev_err(rtd->dev, "fail to add rt1015p widgets, ret %d\n", ret); in rt1015p_init()
359 dev_err(rtd->dev, "fail to add rt1015p kcontrols, ret %d\n", ret); in rt1015p_init()
363 ret = snd_soc_dapm_add_routes(&card->dapm, rt1015p_dapm_routes, in rt1015p_init()
366 dev_err(rtd->dev, "Speaker map addition failed: %d\n", ret); in rt1015p_init()
370 void sof_rt1015p_dai_link(struct snd_soc_dai_link *link) in sof_rt1015p_dai_link() argument
372 link->codecs = rt1015p_dai_link_components; in sof_rt1015p_dai_link()
373 link->num_codecs = ARRAY_SIZE(rt1015p_dai_link_components); in sof_rt1015p_dai_link()
374 link->init = rt1015p_init; in sof_rt1015p_dai_link()
375 link->ops = &rt1015p_ops; in sof_rt1015p_dai_link()
400 struct snd_soc_dai_link *dai_link = rtd->dai_link; in rt1015_hw_params()
408 dev_err(rtd->dev, "fail to get bclk freq, ret %d\n", clk_freq); in rt1015_hw_params()
409 return -EINVAL; in rt1015_hw_params()
417 dev_err(codec_dai->dev, "fail to set pll, ret %d\n", in rt1015_hw_params()
426 dev_err(codec_dai->dev, "fail to set sysclk, ret %d\n", in rt1015_hw_params()
431 switch (dai_link->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK) { in rt1015_hw_params()
434 /* 4-slot TDM */ in rt1015_hw_params()
441 dev_err(codec_dai->dev, "fail to set tdm slot, ret %d\n", in rt1015_hw_params()
447 dev_dbg(codec_dai->dev, "codec is in I2S mode\n"); in rt1015_hw_params()
483 struct snd_soc_card *card = rtd->card; in speaker_codec_init_lr()
489 ret = snd_soc_dapm_new_controls(&card->dapm, realtek_2spk_widgets, in speaker_codec_init_lr()
492 dev_err(rtd->dev, "fail to add rt1015 widgets, ret %d\n", in speaker_codec_init_lr()
500 dev_err(rtd->dev, "fail to add rt1015 kcontrols, ret %d\n", in speaker_codec_init_lr()
505 ret = snd_soc_dapm_add_routes(&rtd->card->dapm, speaker_map_lr, in speaker_codec_init_lr()
508 dev_err(rtd->dev, "fail to add rt1015 routes, ret %d\n", in speaker_codec_init_lr()
514 dev_err(rtd->dev, "rt1015: invalid num_codecs %d\n", num_codecs); in speaker_codec_init_lr()
515 return -EINVAL; in speaker_codec_init_lr()
523 card->codec_conf = rt1015_amp_conf; in sof_rt1015_codec_conf()
524 card->num_configs = ARRAY_SIZE(rt1015_amp_conf); in sof_rt1015_codec_conf()
528 void sof_rt1015_dai_link(struct snd_soc_dai_link *link) in sof_rt1015_dai_link() argument
530 link->codecs = rt1015_components; in sof_rt1015_dai_link()
531 link->num_codecs = ARRAY_SIZE(rt1015_components); in sof_rt1015_dai_link()
532 link->init = speaker_codec_init_lr; in sof_rt1015_dai_link()
533 link->ops = &rt1015_ops; in sof_rt1015_dai_link()
563 struct snd_soc_card *card = rtd->card; in rt1308_init()
566 ret = snd_soc_dapm_new_controls(&card->dapm, rt1308_dapm_widgets, in rt1308_init()
569 dev_err(rtd->dev, "fail to add dapm controls, ret %d\n", ret); in rt1308_init()
576 dev_err(rtd->dev, "fail to add card controls, ret %d\n", ret); in rt1308_init()
580 ret = snd_soc_dapm_add_routes(&card->dapm, rt1308_dapm_routes, in rt1308_init()
584 dev_err(rtd->dev, "fail to add dapm routes, ret %d\n", ret); in rt1308_init()
593 struct snd_soc_card *card = rtd->card; in rt1308_hw_params()
607 dev_err(card->dev, "Failed to set RT1308 PLL: %d\n", ret); in rt1308_hw_params()
615 dev_err(card->dev, "Failed to set RT1308 SYSCLK: %d\n", ret); in rt1308_hw_params()
624 void sof_rt1308_dai_link(struct snd_soc_dai_link *link) in sof_rt1308_dai_link() argument
626 link->codecs = rt1308_components; in sof_rt1308_dai_link()
627 link->num_codecs = ARRAY_SIZE(rt1308_components); in sof_rt1308_dai_link()
628 link->init = rt1308_init; in sof_rt1308_dai_link()
629 link->ops = &rt1308_ops; in sof_rt1308_dai_link()
634 * 2-amp Configuration for RT1019
652 struct snd_soc_card *card = rtd->card; in rt1019p_init()
655 ret = snd_soc_dapm_new_controls(&card->dapm, realtek_2spk_widgets, in rt1019p_init()
658 dev_err(rtd->dev, "fail to add rt1019p widgets, ret %d\n", ret); in rt1019p_init()
665 dev_err(rtd->dev, "fail to add rt1019p kcontrols, ret %d\n", ret); in rt1019p_init()
669 ret = snd_soc_dapm_add_routes(&card->dapm, rt1019p_dapm_routes, in rt1019p_init()
672 dev_err(rtd->dev, "Speaker map addition failed: %d\n", ret); in rt1019p_init()
678 void sof_rt1019p_dai_link(struct snd_soc_dai_link *link) in sof_rt1019p_dai_link() argument
680 link->codecs = rt1019p_components; in sof_rt1019p_dai_link()
681 link->num_codecs = ARRAY_SIZE(rt1019p_components); in sof_rt1019p_dai_link()
682 link->init = rt1019p_init; in sof_rt1019p_dai_link()