Lines Matching +full:out +full:- +full:mono
1 // SPDX-License-Identifier: GPL-2.0-only
3 * wm8974.c -- WM8974 ALSA Soc Audio driver
5 * Copyright 2006-2009 Wolfson Microelectronics PLC.
57 static const char *wm8974_companding[] = {"Off", "NC", "u-law", "A-law" };
93 static const DECLARE_TLV_DB_SCALE(digital_tlv, -12750, 50, 1);
94 static const DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
95 static const DECLARE_TLV_DB_SCALE(inpga_tlv, -1200, 75, 0);
96 static const DECLARE_TLV_DB_SCALE(spk_tlv, -5700, 100, 0);
105 SOC_ENUM("Playback De-emphasis", wm8974_enum[2]),
168 SOC_SINGLE("Mono Playback Switch", WM8974_MONOMIX, 6, 1, 1),
182 /* Mono Output Mixer */
205 SND_SOC_DAPM_MIXER("Mono Mixer", WM8974_POWER3, 3, 0,
211 SND_SOC_DAPM_PGA("SpkN Out", WM8974_POWER3, 5, 0, NULL, 0),
212 SND_SOC_DAPM_PGA("SpkP Out", WM8974_POWER3, 6, 0, NULL, 0),
213 SND_SOC_DAPM_PGA("Mono Out", WM8974_POWER3, 7, 0, NULL, 0),
231 /* Mono output mixer */
232 {"Mono Mixer", "PCM Playback Switch", "DAC"},
233 {"Mono Mixer", "Aux Playback Switch", "Aux Input"},
234 {"Mono Mixer", "Line Bypass Switch", "Boost Mixer"},
242 {"Mono Out", NULL, "Mono Mixer"},
243 {"MONOOUT", NULL, "Mono Out"},
244 {"SpkN Out", NULL, "Speaker Mixer"},
245 {"SpkP Out", NULL, "Speaker Mixer"},
246 {"SPKOUTN", NULL, "SpkN Out"},
247 {"SPKOUTP", NULL, "SpkP Out"},
286 pll_div->pre_div = 1; in pll_factors()
289 pll_div->pre_div = 0; in pll_factors()
296 pll_div->n = Ndiv; in pll_factors()
311 pll_div->k = K; in pll_factors()
317 struct snd_soc_component *component = codec_dai->component; in wm8974_set_dai_pll()
354 struct snd_soc_component *component = codec_dai->component; in wm8974_set_dai_clkdiv()
371 return -EINVAL; in wm8974_set_dai_clkdiv()
411 struct snd_soc_component *component = dai->component; in wm8974_update_clocks()
418 if (!priv->mclk || !priv->fs) in wm8974_update_clocks()
421 fs256 = 256 * priv->fs; in wm8974_update_clocks()
423 f = wm8974_get_mclkdiv(priv->mclk, fs256, &mclkdiv); in wm8974_update_clocks()
425 if (f != priv->mclk) { in wm8974_update_clocks()
430 wm8974_set_dai_pll(dai, 0, 0, priv->mclk, fpll); in wm8974_update_clocks()
439 struct snd_soc_component *component = dai->component; in wm8974_set_dai_sysclk()
443 return -EINVAL; in wm8974_set_dai_sysclk()
445 priv->mclk = freq; in wm8974_set_dai_sysclk()
453 struct snd_soc_component *component = codec_dai->component; in wm8974_set_dai_fmt()
465 return -EINVAL; in wm8974_set_dai_fmt()
481 return -EINVAL; in wm8974_set_dai_fmt()
486 return -EINVAL; in wm8974_set_dai_fmt()
503 return -EINVAL; in wm8974_set_dai_fmt()
515 struct snd_soc_component *component = dai->component; in wm8974_pcm_hw_params()
521 priv->fs = params_rate(params); in wm8974_pcm_hw_params()
570 struct snd_soc_component *component = dai->component; in wm8974_mute()
597 regcache_sync(dev_get_regmap(component->dev, NULL)); in wm8974_set_bias_level()
621 struct snd_soc_component *component = dai->component; in wm8974_startup()
625 clk_prepare_enable(priv->mclk_in); in wm8974_startup()
626 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { in wm8974_startup()
637 struct snd_soc_component *component = dai->component; in wm8974_shutdown()
641 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { in wm8974_shutdown()
645 clk_disable_unprepare(priv->mclk_in); in wm8974_shutdown()
666 .name = "wm8974-hifi",
699 dev_err(component->dev, "Failed to issue reset\n"); in wm8974_probe()
729 priv = devm_kzalloc(&i2c->dev, sizeof(*priv), GFP_KERNEL); in wm8974_i2c_probe()
731 return -ENOMEM; in wm8974_i2c_probe()
739 priv->mclk_in = devm_clk_get(&i2c->dev, "mclk"); in wm8974_i2c_probe()
740 if (IS_ERR(priv->mclk_in)) in wm8974_i2c_probe()
741 return PTR_ERR(priv->mclk_in); in wm8974_i2c_probe()
743 ret = devm_snd_soc_register_component(&i2c->dev, in wm8974_i2c_probe()