Lines Matching +full:digital +full:- +full:input +full:- +full:threshold +full:- +full:mode +full:- +full:fixed

1 // SPDX-License-Identifier: GPL-2.0-only
3 * wm8974.c -- WM8974 ALSA Soc Audio driver
5 * Copyright 2006-2009 Wolfson Microelectronics PLC.
55 static const char *wm8974_companding[] = {"Off", "NC", "u-law", "A-law" };
91 static const DECLARE_TLV_DB_SCALE(digital_tlv, -12750, 50, 1);
92 static const DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
93 static const DECLARE_TLV_DB_SCALE(inpga_tlv, -1200, 75, 0);
94 static const DECLARE_TLV_DB_SCALE(spk_tlv, -5700, 100, 0);
98 SOC_SINGLE("Digital Loopback Switch", WM8974_COMP, 0, 1, 0),
103 SOC_ENUM("Playback De-emphasis", wm8974_enum[2]),
138 SOC_SINGLE("DAC Playback Limiter Threshold", WM8974_DACLIM2, 4, 7, 0),
149 SOC_ENUM("ALC Capture Mode", wm8974_enum[13]),
154 SOC_SINGLE("ALC Capture Noise Gate Threshold", WM8974_NGATE, 0, 7, 0),
163 SOC_ENUM("Aux Mode", wm8974_auxmode),
192 /* Input PGA */
208 SND_SOC_DAPM_PGA("Aux Input", WM8974_POWER1, 6, 0, NULL, 0),
213 SND_SOC_DAPM_MIXER("Input PGA", WM8974_POWER2, 2, 0, wm8974_inpga,
231 {"Mono Mixer", "Aux Playback Switch", "Aux Input"},
236 {"Speaker Mixer", "Aux Playback Switch", "Aux Input"},
249 {"Boost Mixer", NULL, "Aux Input"},
250 {"Boost Mixer", "PGA Switch", "Input PGA"},
253 /* Input PGA */
254 {"Input PGA", "Aux Switch", "Aux Input"},
255 {"Input PGA", "MicN Switch", "MICN"},
256 {"Input PGA", "MicP Switch", "MICP"},
259 {"Aux Input", NULL, "AUX"},
278 /* There is a fixed divide by 4 in the output path */
284 pll_div->pre_div = 1;
287 pll_div->pre_div = 0;
294 pll_div->n = Ndiv;
309 pll_div->k = K;
315 struct snd_soc_component *component = codec_dai->component;
352 struct snd_soc_component *component = codec_dai->component;
369 return -EINVAL;
409 struct snd_soc_component *component = dai->component;
416 if (!priv->mclk || !priv->fs)
419 fs256 = 256 * priv->fs;
421 f = wm8974_get_mclkdiv(priv->mclk, fs256, &mclkdiv);
422 if (f != priv->mclk) {
432 wm8974_set_dai_pll(dai, 0, 0, priv->mclk, fpll);
441 struct snd_soc_component *component = dai->component;
445 return -EINVAL;
447 priv->mclk = freq;
455 struct snd_soc_component *component = codec_dai->component;
467 return -EINVAL;
483 return -EINVAL;
488 return -EINVAL;
505 return -EINVAL;
517 struct snd_soc_component *component = dai->component;
523 priv->fs = params_rate(params);
572 struct snd_soc_component *component = dai->component;
600 regcache_sync(dev_get_regmap(component->dev, NULL));
637 .name = "wm8974-hifi",
670 dev_err(component->dev, "Failed to issue reset\n");
698 priv = devm_kzalloc(&i2c->dev, sizeof(*priv), GFP_KERNEL);
700 return -ENOMEM;
708 ret = devm_snd_soc_register_component(&i2c->dev,