Lines Matching +full:boost +full:- +full:bypass
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]),
141 SOC_SINGLE("DAC Playback Limiter Boost", WM8974_DACLIM2, 0, 15, 0),
167 SOC_SINGLE("Capture Boost(+20dB)", WM8974_ADCBOOST, 8, 1, 0),
177 SOC_DAPM_SINGLE("Line Bypass Switch", WM8974_SPKMIX, 1, 1, 0),
184 SOC_DAPM_SINGLE("Line Bypass Switch", WM8974_MONOMIX, 1, 1, 0),
189 /* Boost mixer */
217 SND_SOC_DAPM_MIXER("Boost Mixer", WM8974_POWER2, 4, 0,
234 {"Mono Mixer", "Line Bypass Switch", "Boost Mixer"},
239 {"Speaker Mixer", "Line Bypass Switch", "Boost Mixer"},
249 /* Boost Mixer */
250 {"ADC", NULL, "Boost Mixer"},
251 {"Boost Mixer", "Aux Switch", "Aux Input"},
252 {"Boost Mixer", NULL, "Input PGA"},
253 {"Boost Mixer", NULL, "MICP"},
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()