Lines Matching +full:alc +full:- +full:enable
1 // SPDX-License-Identifier: GPL-2.0+
196 /* Minimum INPGA and AUX1 volume to enable noise suppression */
259 * min : 0x11 (-54.0 dB)
261 * reserved : 0x00 - 0x0F
267 /* -54 dB to +15 dB */
268 0x11, 0x3f, TLV_DB_SCALE_ITEM(-5400, 150, 0)
273 /* -54dB to 15dB */
274 0x11, 0x3f, TLV_DB_SCALE_ITEM(-5400, 150, 0)
278 0x0, 0x2, TLV_DB_SCALE_ITEM(-1800, 0, 1),
279 /* -18dB to 6dB */
280 0x3, 0x7, TLV_DB_SCALE_ITEM(-1800, 600, 0)
285 /* -48dB to 21dB */
286 0x11, 0x3f, TLV_DB_SCALE_ITEM(-4800, 150, 0)
289 static const DECLARE_TLV_DB_SCALE(eq_gain_tlv, -1050, 150, 0);
290 static const DECLARE_TLV_DB_SCALE(adc_eq_master_gain_tlv, -1800, 600, 1);
291 static const DECLARE_TLV_DB_SCALE(dac_gain_tlv, -7725, 75, 0);
292 static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, -600, 600, 0);
293 static const DECLARE_TLV_DB_SCALE(aux2_vol_tlv, -600, 600, 0);
294 static const DECLARE_TLV_DB_SCALE(inpga_gain_tlv, -450, 150, 0);
325 /* ALC can be enabled only if noise suppression is disabled */
331 if (ucontrol->value.integer.value[0]) { in da7210_put_alc_sw()
334 dev_dbg(component->dev, in da7210_put_alc_sw()
335 "Disable noise suppression to enable ALC\n"); in da7210_put_alc_sw()
336 return -EINVAL; in da7210_put_alc_sw()
339 /* If all conditions are met or we are actually disabling ALC */ in da7210_put_alc_sw()
344 * ALC disabled
355 if (ucontrol->value.integer.value[0]) { in da7210_put_noise_sup_sw()
356 /* Check if ALC is enabled */ in da7210_put_noise_sup_sw()
385 return -EINVAL; in da7210_put_noise_sup_sw()
466 /* ALC controls */
467 SOC_SINGLE_EXT("ALC Enable Switch", DA7210_ADC, 0, 1, 0,
469 SOC_SINGLE("ALC Capture Max Volume", DA7210_ALC_MAX, 0, 0x3F, 0),
470 SOC_SINGLE("ALC Capture Min Volume", DA7210_ALC_MIN, 0, 0x3F, 0),
471 SOC_SINGLE("ALC Capture Noise Volume", DA7210_ALC_NOIS, 0, 0x3F, 0),
472 SOC_SINGLE("ALC Capture Attack Rate", DA7210_ALC_ATT, 0, 0xFF, 0),
473 SOC_SINGLE("ALC Capture Release Rate", DA7210_ALC_REL, 0, 0xFF, 0),
474 SOC_SINGLE("ALC Capture Release Delay", DA7210_ALC_DEL, 0, 0xFF, 0),
476 SOC_SINGLE_EXT("Noise Suppression Enable Switch", DA7210_CONTROL, 3, 1,
585 SND_SOC_DAPM_PGA("OUTPGA Left Enable", DA7210_OUTMIX_L, 7, 0, NULL, 0),
586 SND_SOC_DAPM_PGA("OUTPGA Right Enable", DA7210_OUTMIX_R, 7, 0, NULL, 0),
648 {"OUTPGA Left Enable", NULL, "Out Mixer Left"},
649 {"OUTPGA Right Enable", NULL, "Out Mixer Right"},
651 {"Out1 Left", NULL, "OUTPGA Left Enable"},
654 {"Out1 Right", NULL, "OUTPGA Right Enable"},
657 {"Headphone Left", NULL, "OUTPGA Left Enable"},
660 {"Headphone Right", NULL, "OUTPGA Right Enable"},
758 struct snd_soc_component *component = dai->component; in da7210_hw_params()
767 /* Enable DAI */ in da7210_hw_params()
786 return -EINVAL; in da7210_hw_params()
833 return -EINVAL; in da7210_hw_params()
841 if (da7210->mclk_rate && (da7210->mclk_rate != sysclk)) { in da7210_hw_params()
845 if (!da7210->master) { in da7210_hw_params()
846 /* PLL slave mode, also enable SRM */ in da7210_hw_params()
854 /* PLL bypass mode, enable PLL bypass and Auto Detection */ in da7210_hw_params()
860 /* Enable active mode */ in da7210_hw_params()
872 struct snd_soc_component *component = codec_dai->component; in da7210_set_dai_fmt()
882 return -EINVAL; in da7210_set_dai_fmt()
886 da7210->master = 1; in da7210_set_dai_fmt()
890 da7210->master = 0; in da7210_set_dai_fmt()
894 return -EINVAL; in da7210_set_dai_fmt()
912 return -EINVAL; in da7210_set_dai_fmt()
929 struct snd_soc_component *component = dai->component; in da7210_mute()
945 struct snd_soc_component *component = codec_dai->component; in da7210_set_dai_sysclk()
958 da7210->mclk_rate = freq; in da7210_set_dai_sysclk()
961 dev_err(codec_dai->dev, "Unsupported MCLK value %d\n", in da7210_set_dai_sysclk()
963 return -EINVAL; in da7210_set_dai_sysclk()
967 dev_err(codec_dai->dev, "Unknown clock source %d\n", clk_id); in da7210_set_dai_sysclk()
968 return -EINVAL; in da7210_set_dai_sysclk()
988 struct snd_soc_component *component = codec_dai->component; in da7210_set_dai_pll()
994 if (!da7210->master) in da7210_set_dai_pll()
1001 (da7210->master == da7210_pll_div[cnt].mode) && in da7210_set_dai_pll()
1021 /* Enable PLL */ in da7210_set_dai_pll()
1024 /* Enable active mode */ in da7210_set_dai_pll()
1029 dev_err(codec_dai->dev, "Unsupported PLL input frequency %d\n", fref); in da7210_set_dai_pll()
1030 return -EINVAL; in da7210_set_dai_pll()
1044 .name = "da7210-hifi",
1069 dev_info(component->dev, "DA7210 Audio Codec %s\n", DA7210_VERSION); in da7210_probe()
1071 da7210->mclk_rate = 0; /* This will be set from set_sysclk() */ in da7210_probe()
1072 da7210->master = 0; /* This will be set from set_fmt() */ in da7210_probe()
1074 /* Enable internal regulator & bias current */ in da7210_probe()
1081 /* Enable Left & Right MIC PGA and Mic Bias */ in da7210_probe()
1085 /* Enable Left and Right input PGA */ in da7210_probe()
1089 /* Enable Left and Right ADC */ in da7210_probe()
1096 /* Enable Left and Right DAC */ in da7210_probe()
1101 /* Enable Left and Right out PGA */ in da7210_probe()
1105 /* Enable Left and Right HeadPhone PGA */ in da7210_probe()
1110 /* Enable ramp mode for DAC gain update */ in da7210_probe()
1114 * For DA7210 codec, there are two ways to enable/disable analog IOs in da7210_probe()
1116 * (1) Using "Enable Bit" of register associated with that IO in da7210_probe()
1124 * way to enable/disable individual blocks. This is because STANDBY in da7210_probe()
1126 * up/down in a controlled, pop-free manner. Also, as per application in da7210_probe()
1128 * particular IO (or ADC/DAC) is already enabled using enable/disable in da7210_probe()
1134 * - "Enable bit" of an IO or ADC/DAC is used to enable it in probe() in da7210_probe()
1135 * - "STANDBY bit" is controlled by DAPM in da7210_probe()
1138 /* Enable Line out amplifiers */ in da7210_probe()
1144 /* Enable Aux1 */ in da7210_probe()
1147 /* Enable Aux2 */ in da7210_probe()
1150 /* Set PLL Master clock range 10-20 MHz, enable PLL bypass */ in da7210_probe()
1160 dev_info(component->dev, "DA7210 Audio Codec %s\n", DA7210_VERSION); in da7210_probe()
1184 /* Set PLL Master clock range 10-20 MHz */
1192 /* to re-lock */
1213 da7210 = devm_kzalloc(&i2c->dev, sizeof(struct da7210_priv), in da7210_i2c_probe()
1216 return -ENOMEM; in da7210_i2c_probe()
1220 da7210->regmap = devm_regmap_init_i2c(i2c, &da7210_regmap_config_i2c); in da7210_i2c_probe()
1221 if (IS_ERR(da7210->regmap)) { in da7210_i2c_probe()
1222 ret = PTR_ERR(da7210->regmap); in da7210_i2c_probe()
1223 dev_err(&i2c->dev, "regmap_init() failed: %d\n", ret); in da7210_i2c_probe()
1227 ret = regmap_register_patch(da7210->regmap, da7210_regmap_i2c_patch, in da7210_i2c_probe()
1230 dev_warn(&i2c->dev, "Failed to apply regmap patch: %d\n", ret); in da7210_i2c_probe()
1232 ret = devm_snd_soc_register_component(&i2c->dev, in da7210_i2c_probe()
1235 dev_err(&i2c->dev, "Failed to register component: %d\n", ret); in da7210_i2c_probe()
1265 /* Set PLL Master clock range 10-20 MHz */
1275 /* to re-lock */
1300 da7210 = devm_kzalloc(&spi->dev, sizeof(struct da7210_priv), in da7210_spi_probe()
1303 return -ENOMEM; in da7210_spi_probe()
1306 da7210->regmap = devm_regmap_init_spi(spi, &da7210_regmap_config_spi); in da7210_spi_probe()
1307 if (IS_ERR(da7210->regmap)) { in da7210_spi_probe()
1308 ret = PTR_ERR(da7210->regmap); in da7210_spi_probe()
1309 dev_err(&spi->dev, "Failed to register regmap: %d\n", ret); in da7210_spi_probe()
1313 ret = regmap_register_patch(da7210->regmap, da7210_regmap_spi_patch, in da7210_spi_probe()
1316 dev_warn(&spi->dev, "Failed to apply regmap patch: %d\n", ret); in da7210_spi_probe()
1318 ret = devm_snd_soc_register_component(&spi->dev, in da7210_spi_probe()