Lines Matching +full:alc +full:- +full:enable
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" };
64 static const char *wm8974_alc[] = {"ALC", "Limiter" };
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);
103 SOC_ENUM("Playback De-emphasis", wm8974_enum[2]),
141 SOC_SINGLE("ALC Enable Switch", WM8974_ALC1, 8, 1, 0),
142 SOC_SINGLE("ALC Capture Max Gain", WM8974_ALC1, 3, 7, 0),
143 SOC_SINGLE("ALC Capture Min Gain", WM8974_ALC1, 0, 7, 0),
145 SOC_SINGLE("ALC Capture ZC Switch", WM8974_ALC2, 8, 1, 0),
146 SOC_SINGLE("ALC Capture Hold", WM8974_ALC2, 4, 7, 0),
147 SOC_SINGLE("ALC Capture Target", WM8974_ALC2, 0, 15, 0),
149 SOC_ENUM("ALC Capture Mode", wm8974_enum[13]),
150 SOC_SINGLE("ALC Capture Decay", WM8974_ALC3, 4, 15, 0),
151 SOC_SINGLE("ALC Capture Attack", WM8974_ALC3, 0, 15, 0),
153 SOC_SINGLE("ALC Capture Noise Gate Switch", WM8974_NGATE, 3, 1, 0),
154 SOC_SINGLE("ALC Capture Noise Gate Threshold", WM8974_NGATE, 0, 7, 0),
284 pll_div->pre_div = 1; in pll_factors()
287 pll_div->pre_div = 0; in pll_factors()
294 pll_div->n = Ndiv; in pll_factors()
309 pll_div->k = K; in pll_factors()
315 struct snd_soc_component *component = codec_dai->component; in wm8974_set_dai_pll()
352 struct snd_soc_component *component = codec_dai->component; in wm8974_set_dai_clkdiv()
369 return -EINVAL; in wm8974_set_dai_clkdiv()
409 struct snd_soc_component *component = dai->component; in wm8974_update_clocks()
416 if (!priv->mclk || !priv->fs) in wm8974_update_clocks()
419 fs256 = 256 * priv->fs; in wm8974_update_clocks()
421 f = wm8974_get_mclkdiv(priv->mclk, fs256, &mclkdiv); in wm8974_update_clocks()
423 if (f != priv->mclk) { in wm8974_update_clocks()
428 wm8974_set_dai_pll(dai, 0, 0, priv->mclk, fpll); in wm8974_update_clocks()
437 struct snd_soc_component *component = dai->component; in wm8974_set_dai_sysclk()
441 return -EINVAL; in wm8974_set_dai_sysclk()
443 priv->mclk = freq; in wm8974_set_dai_sysclk()
451 struct snd_soc_component *component = codec_dai->component; in wm8974_set_dai_fmt()
463 return -EINVAL; in wm8974_set_dai_fmt()
479 return -EINVAL; in wm8974_set_dai_fmt()
484 return -EINVAL; in wm8974_set_dai_fmt()
501 return -EINVAL; in wm8974_set_dai_fmt()
513 struct snd_soc_component *component = dai->component; in wm8974_pcm_hw_params()
519 priv->fs = params_rate(params); in wm8974_pcm_hw_params()
568 struct snd_soc_component *component = dai->component; in wm8974_mute()
595 regcache_sync(dev_get_regmap(component->dev, NULL)); in wm8974_set_bias_level()
632 .name = "wm8974-hifi",
665 dev_err(component->dev, "Failed to issue reset\n"); in wm8974_probe()
693 priv = devm_kzalloc(&i2c->dev, sizeof(*priv), GFP_KERNEL); in wm8974_i2c_probe()
695 return -ENOMEM; in wm8974_i2c_probe()
703 ret = devm_snd_soc_register_component(&i2c->dev, in wm8974_i2c_probe()