Lines Matching +full:mic +full:- +full:bias +full:- +full:source
2 * es8316.c -- es8316 ALSA SoC audio driver
5 * Authors: David Yang <yangxiaohua@everest-semi.com>,
22 #include <sound/soc-dapm.h>
44 static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(dac_vol_tlv, -9600, 50, 1);
45 static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(adc_vol_tlv, -9600, 50, 1);
46 static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(alc_max_gain_tlv, -650, 150, 0);
47 static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(alc_min_gain_tlv, -1200, 150, 0);
48 static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(alc_target_tlv, -1650, 150, 0);
50 0, 4, TLV_DB_SCALE_ITEM(-1200, 150, 0),
51 8, 11, TLV_DB_SCALE_ITEM(-450, 150, 0),
55 0, 0, TLV_DB_SCALE_ITEM(-350, 0, 0),
69 0, 0, TLV_DB_SCALE_ITEM(-4800, 0, 0),
70 1, 3, TLV_DB_SCALE_ITEM(-2400, 1200, 0),
102 SOC_SINGLE("Mic Boost Switch", ES8316_ADC_D2SEPGA, 0, 1, 0),
129 "lin1-rin1",
130 "lin2-rin2",
131 "lin1-rin1 with 20db Boost",
132 "lin2-rin2 with 20db Boost"
159 "lin1-rin1",
160 "lin2-rin2",
161 "lin-rin with Boost",
162 "lin-rin with Boost and PGA"
189 /* DAC data source mux */
206 SND_SOC_DAPM_SUPPLY("Bias", ES8316_SYS_PDN, 3, 1, NULL, 0),
208 SND_SOC_DAPM_SUPPLY("Mic Bias", ES8316_SYS_PDN, 5, 1, NULL, 0),
219 SND_SOC_DAPM_SUPPLY("ADC bias", ES8316_SYS_PDN, 2, 1, NULL, 0),
224 SND_SOC_DAPM_MUX("Digital Mic Mux", SND_SOC_NOPM, 0, 0,
233 SND_SOC_DAPM_MUX("DAC Source Mux", SND_SOC_NOPM, 0, 0,
286 {"MIC1", NULL, "Mic Bias"},
287 {"MIC2", NULL, "Mic Bias"},
288 {"MIC1", NULL, "Bias"},
289 {"MIC2", NULL, "Bias"},
293 {"Differential Mux", "lin1-rin1", "MIC1"},
294 {"Differential Mux", "lin2-rin2", "MIC2"},
299 {"Mono ADC", NULL, "ADC bias"},
307 {"Digital Mic Mux", "dmic disable", "Mono ADC"},
309 {"I2S OUT", NULL, "Digital Mic Mux"},
312 {"DAC Source Mux", "LDATA TO LDAC, RDATA TO RDAC", "I2S IN"},
320 {"Left DAC", NULL, "DAC Source Mux"},
321 {"Right DAC", NULL, "DAC Source Mux"},
323 {"Left Headphone Mux", "lin-rin with Boost and PGA", "Line input PGA"},
324 {"Right Headphone Mux", "lin-rin with Boost and PGA", "Line input PGA"},
353 {"Headphone Out", NULL, "Bias"},
362 struct snd_soc_component *component = codec_dai->component; in es8316_set_dai_sysclk()
367 es8316->sysclk = freq; in es8316_set_dai_sysclk()
379 es8316->allowed_rates[count++] = freq / ratio; in es8316_set_dai_sysclk()
382 es8316->sysclk_constraints.list = es8316->allowed_rates; in es8316_set_dai_sysclk()
383 es8316->sysclk_constraints.count = count; in es8316_set_dai_sysclk()
391 struct snd_soc_component *component = codec_dai->component; in es8316_set_dai_fmt()
398 dev_err(component->dev, "Codec driver only supports slave mode\n"); in es8316_set_dai_fmt()
399 return -EINVAL; in es8316_set_dai_fmt()
403 dev_err(component->dev, "Codec driver only supports I2S format\n"); in es8316_set_dai_fmt()
404 return -EINVAL; in es8316_set_dai_fmt()
422 return -EINVAL; in es8316_set_dai_fmt()
442 struct snd_soc_component *component = dai->component; in es8316_pcm_startup()
445 if (es8316->sysclk == 0) { in es8316_pcm_startup()
446 dev_err(component->dev, "No sysclk provided\n"); in es8316_pcm_startup()
447 return -EINVAL; in es8316_pcm_startup()
453 snd_pcm_hw_constraint_list(substream->runtime, 0, in es8316_pcm_startup()
455 &es8316->sysclk_constraints); in es8316_pcm_startup()
464 struct snd_soc_component *component = dai->component; in es8316_pcm_hw_params()
468 if (!es8316->sysclk) { in es8316_pcm_hw_params()
469 dev_err(component->dev, "No MCLK configured\n"); in es8316_pcm_hw_params()
470 return -EINVAL; in es8316_pcm_hw_params()
487 return -EINVAL; in es8316_pcm_hw_params()
499 snd_soc_component_update_bits(dai->component, ES8316_DAC_SET1, 0x20, in es8316_mute()
551 * but here is a vendor-provided value that improves volume in es8316_probe()
585 es8316 = devm_kzalloc(&i2c_client->dev, sizeof(struct es8316_priv), in es8316_i2c_probe()
588 return -ENOMEM; in es8316_i2c_probe()
596 return devm_snd_soc_register_component(&i2c_client->dev, in es8316_i2c_probe()
631 MODULE_AUTHOR("David Yang <yangxiaohua@everest-semi.com>");