Lines Matching +full:codec +full:- +full:mclk1
1 // SPDX-License-Identifier: GPL-2.0+
18 #include <sound/soc-dapm.h>
24 * The MCLK1 clock source is XCLKOUT with its mux set to the external fixed rate
54 struct snd_soc_card *card = rtd->card; in midas_start_fll1()
61 rate = priv->fll1_rate; in midas_start_fll1()
69 if (rate != priv->fll1_rate && priv->fll1_rate) { in midas_start_fll1()
74 dev_err(card->dev, "Unable to switch to MCLK2: %d\n", ret); in midas_start_fll1()
82 dev_err(card->dev, "Failed to set FLL1 rate: %d\n", ret); in midas_start_fll1()
85 priv->fll1_rate = rate; in midas_start_fll1()
88 priv->fll1_rate, SND_SOC_CLOCK_IN); in midas_start_fll1()
90 dev_err(card->dev, "Failed to set SYSCLK source: %d\n", ret); in midas_start_fll1()
97 dev_err(card->dev, "Failed to set OPCLK source: %d\n", ret); in midas_start_fll1()
106 struct snd_soc_card *card = rtd->card; in midas_stop_fll1()
114 dev_err(card->dev, "Unable to switch to MCLK2: %d\n", ret); in midas_stop_fll1()
120 dev_err(card->dev, "Unable to stop FLL1: %d\n", ret); in midas_stop_fll1()
124 priv->fll1_rate = 0; in midas_stop_fll1()
132 struct snd_soc_pcm_runtime *rtd = substream->private_data; in midas_aif1_hw_params()
155 struct snd_soc_component *codec = snd_soc_dapm_to_component(w->dapm); in midas_ext_spkmode() local
160 ret = snd_soc_component_update_bits(codec, WM8994_SPKOUT_MIXERS, in midas_ext_spkmode()
165 ret = snd_soc_component_update_bits(codec, WM8994_SPKOUT_MIXERS, in midas_ext_spkmode()
177 struct snd_soc_card *card = w->dapm->card; in midas_mic_bias()
182 return regulator_enable(priv->reg_mic_bias); in midas_mic_bias()
184 return regulator_disable(priv->reg_mic_bias); in midas_mic_bias()
193 struct snd_soc_card *card = w->dapm->card; in midas_submic_bias()
198 return regulator_enable(priv->reg_submic_bias); in midas_submic_bias()
200 return regulator_disable(priv->reg_submic_bias); in midas_submic_bias()
209 struct snd_soc_card *card = w->dapm->card; in midas_fm_set()
212 if (!priv->gpio_fm_sel) in midas_fm_set()
217 gpiod_set_value_cansleep(priv->gpio_fm_sel, 1); in midas_fm_set()
220 gpiod_set_value_cansleep(priv->gpio_fm_sel, 0); in midas_fm_set()
230 struct snd_soc_card *card = w->dapm->card; in midas_line_set()
233 if (!priv->gpio_lineout_sel) in midas_line_set()
238 gpiod_set_value_cansleep(priv->gpio_lineout_sel, 1); in midas_line_set()
241 gpiod_set_value_cansleep(priv->gpio_lineout_sel, 0); in midas_line_set()
286 &card->dai_link[0]); in midas_set_bias_level()
289 if (dapm->dev != aif1_dai->dev) in midas_set_bias_level()
307 &card->dai_link[0]); in midas_late_probe()
316 dev_err(aif1_dai->dev, "Failed to switch to MCLK2: %d\n", ret); in midas_late_probe()
324 &priv->headset_jack, in midas_late_probe()
330 wm8958_mic_detect(aif1_dai->component, &priv->headset_jack, in midas_late_probe()
377 .name = "midas-audio",
382 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "wm8994-aif1")),
387 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "wm8994-aif2")),
392 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "wm8994-aif3")),
434 struct device_node *cpu = NULL, *codec = NULL; in midas_probe() local
436 struct device *dev = &pdev->dev; in midas_probe()
443 return -ENOMEM; in midas_probe()
446 card->dev = dev; in midas_probe()
448 priv->reg_mic_bias = devm_regulator_get(dev, "mic-bias"); in midas_probe()
449 if (IS_ERR(priv->reg_mic_bias)) { in midas_probe()
451 return PTR_ERR(priv->reg_mic_bias); in midas_probe()
454 priv->reg_submic_bias = devm_regulator_get(dev, "submic-bias"); in midas_probe()
455 if (IS_ERR(priv->reg_submic_bias)) { in midas_probe()
457 return PTR_ERR(priv->reg_submic_bias); in midas_probe()
460 priv->gpio_fm_sel = devm_gpiod_get_optional(dev, "fm-sel", GPIOD_OUT_HIGH); in midas_probe()
461 if (IS_ERR(priv->gpio_fm_sel)) { in midas_probe()
463 return PTR_ERR(priv->gpio_fm_sel); in midas_probe()
466 priv->gpio_lineout_sel = devm_gpiod_get_optional(dev, "lineout-sel", in midas_probe()
468 if (IS_ERR(priv->gpio_lineout_sel)) { in midas_probe()
470 return PTR_ERR(priv->gpio_lineout_sel); in midas_probe()
479 ret = snd_soc_of_parse_audio_routing(card, "audio-routing"); in midas_probe()
482 ret = snd_soc_of_parse_audio_routing(card, "samsung,audio-routing"); in midas_probe()
489 cpu = of_get_child_by_name(dev->of_node, "cpu"); in midas_probe()
491 return -EINVAL; in midas_probe()
493 codec = of_get_child_by_name(dev->of_node, "codec"); in midas_probe()
494 if (!codec) { in midas_probe()
496 return -EINVAL; in midas_probe()
499 cpu_dai_node = of_parse_phandle(cpu, "sound-dai", 0); in midas_probe()
502 dev_err(dev, "parsing cpu/sound-dai failed\n"); in midas_probe()
503 of_node_put(codec); in midas_probe()
504 return -EINVAL; in midas_probe()
507 codec_dai_node = of_parse_phandle(codec, "sound-dai", 0); in midas_probe()
508 of_node_put(codec); in midas_probe()
510 dev_err(dev, "audio-codec property invalid/missing\n"); in midas_probe()
511 ret = -EINVAL; in midas_probe()
516 dai_link->codecs->of_node = codec_dai_node; in midas_probe()
517 dai_link->cpus->of_node = cpu_dai_node; in midas_probe()
518 dai_link->platforms->of_node = cpu_dai_node; in midas_probe()
544 { .compatible = "samsung,midas-audio" },
551 .name = "midas-audio",