Lines Matching +full:- +full:mclk +full:- +full:always +full:- +full:on +full:- +full:rate +full:- +full:hz

1 // SPDX-License-Identifier: GPL-2.0+
11 // Tested on SuperH Ecovec24 board with S16/S24 LE in 48KHz using I2S
223 { 12000000, 2822400, 0xE8, 0x6C, 0x2, 1}, /* MCLK=12Mhz */
224 { 13000000, 2822400, 0xDF, 0x28, 0xC, 1}, /* MCLK=13Mhz */
225 { 13500000, 2822400, 0xDB, 0x0A, 0xD, 1}, /* MCLK=13.5Mhz */
226 { 14400000, 2822400, 0xD4, 0x5A, 0x2, 1}, /* MCLK=14.4Mhz */
227 { 19200000, 2822400, 0xBB, 0x43, 0x9, 1}, /* MCLK=19.2Mhz */
228 { 19680000, 2822400, 0xB9, 0x6D, 0xA, 1}, /* MCLK=19.68Mhz */
229 { 19800000, 2822400, 0xB8, 0xFB, 0xB, 1}, /* MCLK=19.8Mhz */
231 { 12000000, 3072000, 0xF3, 0x12, 0x7, 1}, /* MCLK=12Mhz */
232 { 13000000, 3072000, 0xE8, 0xFD, 0x5, 1}, /* MCLK=13Mhz */
233 { 13500000, 3072000, 0xE4, 0x82, 0x3, 1}, /* MCLK=13.5Mhz */
234 { 14400000, 3072000, 0xDD, 0x3A, 0x0, 1}, /* MCLK=14.4Mhz */
235 { 19200000, 3072000, 0xC1, 0xEB, 0x8, 1}, /* MCLK=19.2Mhz */
236 { 19680000, 3072000, 0xBF, 0xEC, 0x0, 1}, /* MCLK=19.68Mhz */
237 { 19800000, 3072000, 0xBF, 0x70, 0x0, 1}, /* MCLK=19.8Mhz */
239 { 12000000, 2822400, 0xED, 0xBF, 0x5, 0}, /* MCLK=12Mhz */
240 { 13000000, 2822400, 0xE4, 0x13, 0x0, 0}, /* MCLK=13Mhz */
241 { 13500000, 2822400, 0xDF, 0xC6, 0x8, 0}, /* MCLK=13.5Mhz */
242 { 14400000, 2822400, 0xD8, 0xCA, 0x1, 0}, /* MCLK=14.4Mhz */
243 { 19200000, 2822400, 0xBE, 0x97, 0x9, 0}, /* MCLK=19.2Mhz */
244 { 19680000, 2822400, 0xBC, 0xAC, 0xD, 0}, /* MCLK=19.68Mhz */
245 { 19800000, 2822400, 0xBC, 0x35, 0xE, 0}, /* MCLK=19.8Mhz */
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);
309 "2.5Hz", "25Hz", "50Hz", "100Hz", "150Hz", "200Hz", "300Hz", "400Hz"
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()
456 SOC_SINGLE("Digital Soft Mute Rate", DA7210_SOFTMUTE, 0, 0x7, 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),
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()
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()
975 * @pll_id: da7210 has only one pll, so pll_id is always zero
977 * @fref: MCLK frequency, should be < 20MHz
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()
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()