Lines Matching +full:mic +full:- +full:max +full:- +full:freq

1 // SPDX-License-Identifier: GPL-2.0+
257 * max : 0x3F (+15.0 dB)
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);
331 if (ucontrol->value.integer.value[0]) { in da7210_put_alc_sw()
334 dev_dbg(component->dev, in da7210_put_alc_sw()
336 return -EINVAL; in da7210_put_alc_sw()
355 if (ucontrol->value.integer.value[0]) { in da7210_put_noise_sup_sw()
385 return -EINVAL; in da7210_put_noise_sup_sw()
402 SOC_DOUBLE_R_TLV("Mic Capture Volume",
452 SOC_DOUBLE_R("Mic Capture Switch", DA7210_MIC_L, DA7210_MIC_R, 3, 1, 0),
469 SOC_SINGLE("ALC Capture Max Volume", DA7210_ALC_MAX, 0, 0x3F, 0),
488 SOC_DAPM_SINGLE("Mic Left Switch", DA7210_INMIX_L, 0, 1, 0),
489 SOC_DAPM_SINGLE("Mic Right Switch", DA7210_INMIX_L, 1, 1, 0),
497 SOC_DAPM_SINGLE("Mic Right Switch", DA7210_INMIX_R, 0, 1, 0),
498 SOC_DAPM_SINGLE("Mic Left Switch", DA7210_INMIX_R, 1, 1, 0),
541 SND_SOC_DAPM_PGA("Mic Left", DA7210_STARTUP3, 0, 1, NULL, 0),
542 SND_SOC_DAPM_PGA("Mic Right", DA7210_STARTUP3, 1, 1, NULL, 0),
551 SND_SOC_DAPM_SUPPLY("Mic Bias", DA7210_MIC_L, 6, 0, NULL, 0),
606 {"Mic Left", NULL, "MICL"},
607 {"Mic Right", NULL, "MICR"},
612 {"In Mixer Left", "Mic Left Switch", "Mic Left"},
613 {"In Mixer Left", "Mic Right Switch", "Mic Right"},
618 {"In Mixer Right", "Mic Right Switch", "Mic Right"},
619 {"In Mixer Right", "Mic Left Switch", "Mic Left"},
758 struct snd_soc_component *component = dai->component; 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()
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()
943 int clk_id, unsigned int freq, int dir) in da7210_set_dai_sysclk() argument
945 struct snd_soc_component *component = codec_dai->component; in da7210_set_dai_sysclk()
950 switch (freq) { 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()
962 freq); 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()
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()
1081 /* Enable Left & Right MIC PGA and Mic Bias */ in da7210_probe()
1118 * e.g. Mic Left can be enabled using bit 7 of MIC_L(0x7) reg in da7210_probe()
1121 * e.g. Mic left can be put to STANDBY using bit 0 of STARTUP3(0x5) in da7210_probe()
1126 * up/down in a controlled, pop-free manner. Also, as per application 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()
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()