Lines Matching +full:audio +full:- +full:gain +full:- +full:db
1 // SPDX-License-Identifier: GPL-2.0
3 * ak4619.c -- Asahi Kasei ALSA SoC Audio driver
30 #define AU_IFF1 0x01 /* Audio I/F Format */
31 #define AU_IFF2 0x02 /* Audio I/F Format (Extended) */
33 #define MIC_AMP1 0x04 /* MIC AMP Gain 1 */
34 #define MIC_AMP2 0x05 /* MIC AMP Gain 2 */
47 #define DAC_DEMP 0x13 /* DAC De-Emphasis Setting */
86 /* MIC AMP Gain */
126 /* DAC De-Emphasis Setting */
163 * max : 0x00 : +12.0 dB
164 * ( 0.5 dB step )
165 * min : 0xFE : -115.0 dB
168 static const DECLARE_TLV_DB_SCALE(dac_tlv, -11550, 50, 1);
173 * max : 0x0B : +27.0 dB
174 * ( 3 dB step )
175 * min: 0x00 : -6.0 dB
177 static const DECLARE_TLV_DB_SCALE(mic_tlv, -600, 300, 0);
182 * max : 0x00 : +24.0 dB
183 * ( 0.5 dB step )
184 * min : 0xFE : -103.0 dB
187 static const DECLARE_TLV_DB_SCALE(adc_tlv, -10350, 50, 1);
199 "Sharp Roll-Off Filter",
200 "Slow Roll-Off Filter",
201 "Short Delay Sharp Roll-Off Filter",
202 "Short Delay Slow Roll-Off Filter",
209 /* DAC De-Emphasis Filter select */
219 "Sharp Roll-Off Filter",
220 "Slow Roll-Off Filter",
221 "Short Delay Sharp Roll-Off Filter",
222 "Short Delay Slow Roll-Off Filter"
237 if (!ak4619->deemph_en) in ak4619_set_deemph()
240 switch (ak4619->playback_rate) { in ak4619_set_deemph()
262 int deemph_en = ucontrol->value.integer.value[0]; in ak4619_put_deemph()
270 return -EINVAL; in ak4619_put_deemph()
273 if (ak4619->deemph_en != deemph_en) in ak4619_put_deemph()
276 ak4619->deemph_en = deemph_en; in ak4619_put_deemph()
288 ucontrol->value.integer.value[0] = ak4619->deemph_en; in ak4619_get_deemph()
325 SOC_ENUM("DAC 1 De-Emphasis Filter", ak4619_dac_1_de_emp),
326 SOC_ENUM("DAC 2 De-Emphasis Filter", ak4619_dac_2_de_emp),
331 SOC_SINGLE_BOOL_EXT("Playback De-Emphasis Switch", 0, ak4619_get_deemph, ak4619_put_deemph),
340 "Differential", "Single-Ended1", "Single-Ended2", "Pseudo Differential"
454 {"Analog Input 1 Left MUX", "Single-Ended1", "MIC1L"},
455 {"Analog Input 1 Left MUX", "Single-Ended2", "MIC1L"},
459 {"Analog Input 1 Right MUX", "Single-Ended1", "MIC1R"},
460 {"Analog Input 1 Right MUX", "Single-Ended2", "MIC1R"},
464 {"Analog Input 2 Left MUX", "Single-Ended1", "MIC2L"},
465 {"Analog Input 2 Left MUX", "Single-Ended2", "MIC2L"},
469 {"Analog Input 2 Right MUX", "Single-Ended1", "MIC2R"},
470 {"Analog Input 2 Right MUX", "Single-Ended2", "MIC2R"},
536 struct snd_soc_component *component = dai->component; in ak4619_dai_hw_params()
541 bool is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in ak4619_dai_hw_params()
560 return -EINVAL; in ak4619_dai_hw_params()
563 return -EINVAL; in ak4619_dai_hw_params()
568 fs = ak4619->sysclk / rate; in ak4619_dai_hw_params()
570 return -EINVAL; in ak4619_dai_hw_params()
593 return -EINVAL; in ak4619_dai_hw_params()
602 return -EINVAL; in ak4619_dai_hw_params()
609 return -EINVAL; in ak4619_dai_hw_params()
612 return -EINVAL; in ak4619_dai_hw_params()
620 ak4619->playback_rate = rate; in ak4619_dai_hw_params()
629 struct snd_soc_component *component = dai->component; in ak4619_dai_set_fmt()
643 return -EINVAL; in ak4619_dai_set_fmt()
663 return -EINVAL; in ak4619_dai_set_fmt()
671 return -EINVAL; in ak4619_dai_set_fmt()
687 struct snd_soc_component *component = codec_dai->component; in ak4619_dai_set_sysclk()
690 ak4619->sysclk = freq; in ak4619_dai_set_sysclk()
697 struct snd_soc_component *component = dai->component; in ak4619_dai_mute()
708 struct snd_pcm_hw_constraint_list *constraint = &ak4619->constraint; in ak4619_hw_constraints()
730 * [8kHz - 48kHz] : 256fs, 384fs or 512fs in ak4619_hw_constraints()
731 * [64kHz - 96kHz] : 256fs in ak4619_hw_constraints()
736 fs = ak4619->sysclk / ak4619_sr[i]; in ak4619_hw_constraints()
746 case (ARRAY_SIZE(ak4619_sr) - 1): in ak4619_hw_constraints()
747 case (ARRAY_SIZE(ak4619_sr) - 2): in ak4619_hw_constraints()
759 constraint->list = ak4619_sr; in ak4619_hw_constraints()
760 constraint->mask = ak4619_rate_mask; in ak4619_hw_constraints()
761 constraint->count = ARRAY_SIZE(ak4619_sr); in ak4619_hw_constraints()
772 struct snd_soc_component *component = dai->component; in ak4619_dai_startup()
775 ak4619_hw_constraints(ak4619, substream->runtime); in ak4619_dai_startup()
828 { .compatible = "asahi-kasei,ak4619", .data = &ak4619_regmap_cfg },
851 .name = "ak4619-hifi",
872 struct device *dev = &i2c->dev; in ak4619_i2c_probe()
878 return -ENOMEM; in ak4619_i2c_probe()
882 ak4619->regmap = devm_regmap_init_i2c(i2c, &ak4619_regmap_cfg); in ak4619_i2c_probe()
883 if (IS_ERR(ak4619->regmap)) { in ak4619_i2c_probe()
884 ret = PTR_ERR(ak4619->regmap); in ak4619_i2c_probe()
902 .name = "ak4619-codec",