Lines Matching +full:current +full:- +full:limiter
1 // SPDX-License-Identifier: GPL-2.0-only
3 * wm8940.c -- WM8940 ALSA Soc Audio driver
14 * No means to obtain current gain if alc enabled.
155 static const char *wm8940_companding[] = { "Off", "NC", "u-law", "A-law" };
161 static const char *wm8940_alc_mode_text[] = {"ALC", "Limiter"};
173 static DECLARE_TLV_DB_SCALE(wm8940_spk_vol_tlv, -5700, 100, 1);
174 static DECLARE_TLV_DB_SCALE(wm8940_att_tlv, -1000, 1000, 0);
175 static DECLARE_TLV_DB_SCALE(wm8940_pga_vol_tlv, -1200, 75, 0);
176 static DECLARE_TLV_DB_SCALE(wm8940_alc_min_tlv, -1200, 600, 0);
178 static DECLARE_TLV_DB_SCALE(wm8940_alc_tar_tlv, -2250, 50, 0);
180 static DECLARE_TLV_DB_SCALE(wm8940_lim_thresh_tlv, -600, 100, 0);
181 static DECLARE_TLV_DB_SCALE(wm8940_adc_tlv, -12750, 50, 1);
207 SOC_SINGLE("DAC Playback Limiter Switch", WM8940_DACLIM1, 8, 1, 0),
208 SOC_SINGLE("DAC Playback Limiter Attack", WM8940_DACLIM1, 0, 9, 0),
209 SOC_SINGLE("DAC Playback Limiter Decay", WM8940_DACLIM1, 4, 11, 0),
210 SOC_SINGLE_TLV("DAC Playback Limiter Threshold", WM8940_DACLIM2,
212 SOC_SINGLE_TLV("DAC Playback Limiter Boost", WM8940_DACLIM2,
258 static DECLARE_TLV_DB_SCALE(wm8940_boost_vol_tlv, -1500, 300, 1);
341 struct snd_soc_component *component = codec_dai->component;
352 return -EINVAL;
397 struct snd_soc_component *component = dai->component;
405 priv->fs = params_rate(params);
411 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE
466 struct snd_soc_component *component = dai->component;
503 ret = regcache_sync(wm8940->regmap);
505 dev_err(component->dev, "Failed to sync cache: %d\n", ret);
586 struct snd_soc_component *component = codec_dai->component;
627 struct snd_soc_component *component = codec_dai->component;
682 struct snd_soc_component *codec = dai->component;
689 if (!priv->mclk || !priv->fs)
692 fs256 = 256 * priv->fs;
694 f = wm8940_get_mclkdiv(priv->mclk, fs256, &mclkdiv);
695 if (f != priv->mclk) {
705 wm8940_set_dai_pll(dai, 0, 0, priv->mclk, fpll);
714 struct snd_soc_component *codec = dai->component;
718 return -EINVAL;
720 priv->mclk = freq;
744 .name = "wm8940-hifi",
766 struct wm8940_setup_data *pdata = component->dev->platform_data;
771 * Check chip ID for wm8940 - value of 0x00 offset
777 dev_err(component->dev, "Wrong wm8940 chip ID: 0x%x\n", reg);
778 return -ENODEV;
783 dev_err(component->dev, "Failed to issue reset\n");
795 ret = snd_soc_component_write(component, WM8940_OUTPUTCTL, reg | pdata->vroi);
836 wm8940 = devm_kzalloc(&i2c->dev, sizeof(struct wm8940_priv),
839 return -ENOMEM;
841 wm8940->regmap = devm_regmap_init_i2c(i2c, &wm8940_regmap);
842 if (IS_ERR(wm8940->regmap))
843 return PTR_ERR(wm8940->regmap);
847 ret = devm_snd_soc_register_component(&i2c->dev,