Lines Matching +full:adc +full:- +full:sample +full:- +full:hold +full:- +full:time
1 // SPDX-License-Identifier: GPL-2.0-or-later
59 /* Input - Gain, Select and Filter Registers */
72 /* Output - Gain, Select and Filter Registers */
289 0x0, 0x10, TLV_DB_SCALE_ITEM(-5400, 0, 0),
290 /* -54dB to 15dB */
291 0x11, 0x3f, TLV_DB_SCALE_ITEM(-5400, 150, 0)
296 /* -78dB to 12dB */
297 0x08, 0x7f, TLV_DB_SCALE_ITEM(-7800, 75, 0)
306 static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, -600, 600, 0);
307 static const DECLARE_TLV_DB_SCALE(mixin_gain_tlv, -450, 150, 0);
308 static const DECLARE_TLV_DB_SCALE(eq_gain_tlv, -1050, 150, 0);
309 static const DECLARE_TLV_DB_SCALE(hp_vol_tlv, -5700, 100, 0);
310 static const DECLARE_TLV_DB_SCALE(lineout_vol_tlv, -4800, 100, 0);
311 static const DECLARE_TLV_DB_SCALE(alc_threshold_tlv, -9450, 150, 0);
314 /* ADC and DAC high pass filter cutoff value */
325 /* ADC and DAC voice mode (8kHz) high pass cutoff value */
345 /* DAC noise gate setup time value */
383 "ADC output left", "ADC output right", "AIF input left",
440 /* ALC Hold Time select */
484 if (ucontrol->value.integer.value[0]) { in da9055_put_alc_sw()
500 /* Save current values from ADC control registers */ in da9055_put_alc_sw()
504 /* Enable ADC Left and Right */ in da9055_put_alc_sw()
519 offset_l = -avg_left_data; in da9055_put_alc_sw()
520 offset_r = -avg_right_data; in da9055_put_alc_sw()
532 /* Restore original values of ADC control registers */ in da9055_put_alc_sw()
556 SOC_DOUBLE_R_TLV("ADC Volume",
583 SOC_SINGLE("ADC HPF Switch", DA9055_ADC_FILTERS1, 7, 1, 0),
584 SOC_ENUM("ADC HPF Cutoff", da9055_adc_hpf_cutoff),
585 SOC_SINGLE("ADC Voice Mode Switch", DA9055_ADC_FILTERS1, 3, 1, 0),
586 SOC_ENUM("ADC Voice Cutoff", da9055_adc_vf_cutoff),
600 SOC_DOUBLE_R("ADC Switch", DA9055_ADC_L_CTRL,
622 SOC_DOUBLE_R("ADC Gain Ramping Switch", DA9055_ADC_L_CTRL,
637 SOC_ENUM("DAC NG Setup Time", da9055_dac_ng_setup_time),
677 SOC_ENUM("ALC Hold Time", da9055_hold_time),
799 SND_SOC_DAPM_ADC("ADC Left", "Capture", DA9055_ADC_L_CTRL, 7, 0),
800 SND_SOC_DAPM_ADC("ADC Right", "Capture", DA9055_ADC_R_CTRL, 7, 0),
877 {"ADC Left", NULL, "MIXIN Left"},
880 {"ADC Right", NULL, "MIXIN Right"},
882 {"ADC Left", NULL, "AIF"},
883 {"ADC Right", NULL, "AIF"},
889 {"DAC Left Source", "ADC output left", "ADC Left"},
890 {"DAC Left Source", "ADC output right", "ADC Right"},
894 {"DAC Right Source", "ADC output left", "ADC Left"},
895 {"DAC Right Source", "ADC output right", "ADC Right"},
1051 struct snd_soc_component *component = dai->component; in da9055_hw_params()
1070 return -EINVAL; in da9055_hw_params()
1119 return -EINVAL; in da9055_hw_params()
1122 if (da9055->mclk_rate) { in da9055_hw_params()
1127 * Non-PLL Mode in da9055_hw_params()
1129 * 12.288MHz and uses sample rate value to divide this MCLK in da9055_hw_params()
1131 * need to write constant sample rate i.e. 48KHz. in da9055_hw_params()
1136 if (da9055->mclk_rate && (da9055->mclk_rate != sysclk)) { in da9055_hw_params()
1138 if (!da9055->master) { in da9055_hw_params()
1159 struct snd_soc_component *component = codec_dai->component; in da9055_set_dai_fmt()
1175 return -EINVAL; in da9055_set_dai_fmt()
1180 (da9055->master != mode)) in da9055_set_dai_fmt()
1181 return -EINVAL; in da9055_set_dai_fmt()
1183 da9055->master = mode; in da9055_set_dai_fmt()
1200 return -EINVAL; in da9055_set_dai_fmt()
1216 struct snd_soc_component *component = dai->component; in da9055_mute()
1239 struct snd_soc_component *component = codec_dai->component; in da9055_set_dai_sysclk()
1254 da9055->mclk_rate = freq; in da9055_set_dai_sysclk()
1257 dev_err(codec_dai->dev, "Unsupported MCLK value %d\n", in da9055_set_dai_sysclk()
1259 return -EINVAL; in da9055_set_dai_sysclk()
1263 dev_err(codec_dai->dev, "Unknown clock source %d\n", clk_id); in da9055_set_dai_sysclk()
1264 return -EINVAL; in da9055_set_dai_sysclk()
1282 struct snd_soc_component *component = codec_dai->component; in da9055_set_dai_pll()
1291 if (!da9055->master && (fout != 2822400)) in da9055_set_dai_pll()
1298 (da9055->master == da9055_pll_div[cnt].mode) && in da9055_set_dai_pll()
1317 dev_err(codec_dai->dev, "Error in setting up PLL\n"); in da9055_set_dai_pll()
1318 return -EINVAL; in da9055_set_dai_pll()
1332 .name = "da9055-hifi",
1426 if (da9055->pdata) { in da9055_probe()
1428 if (da9055->pdata->micbias_source) { in da9055_probe()
1437 switch (da9055->pdata->micbias) { in da9055_probe()
1444 (da9055->pdata->micbias) << 4); in da9055_probe()
1478 struct da9055_platform_data *pdata = dev_get_platdata(&i2c->dev); in da9055_i2c_probe()
1481 da9055 = devm_kzalloc(&i2c->dev, sizeof(struct da9055_priv), in da9055_i2c_probe()
1484 return -ENOMEM; in da9055_i2c_probe()
1487 da9055->pdata = pdata; in da9055_i2c_probe()
1491 da9055->regmap = devm_regmap_init_i2c(i2c, &da9055_regmap_config); in da9055_i2c_probe()
1492 if (IS_ERR(da9055->regmap)) { in da9055_i2c_probe()
1493 ret = PTR_ERR(da9055->regmap); in da9055_i2c_probe()
1494 dev_err(&i2c->dev, "regmap_init() failed: %d\n", ret); in da9055_i2c_probe()
1498 ret = devm_snd_soc_register_component(&i2c->dev, in da9055_i2c_probe()
1501 dev_err(&i2c->dev, "Failed to register da9055 component: %d\n", in da9055_i2c_probe()
1515 { "da9055-codec", 0 },
1522 { .compatible = "dlg,da9055-codec", },
1531 .name = "da9055-codec",