[alsa-devel] [PATCH v2] ASoC: tlv320aic3x: Add support for tlv320aic3104

Peter Ujfalusi peter.ujfalusi at ti.com
Wed Feb 4 11:02:12 CET 2015


On 02/04/2015 11:33 AM, Benoît Thébaudeau wrote:
> What I meant was to do the following instead:
> 
> /*
>  * ADC PGA mix input volumes. From -12 to 0 dB in 1.5 dB steps. Disconnected
>  * below -12 dB
>  */
> static const DECLARE_TLV_DB_SCALE(mix_tlv, -1350, 150, 1);
> 
> /* Left PGA Mixer for tlv320aic3104 */
> static const struct snd_kcontrol_new aic3104_left_pga_mixer_controls[] = {
>     SOC_DAPM_SINGLE_MUT_TLV("Line1L Volume",
>                 LINE1L_2_LADC_CTRL, 3, 7, 15, 1, mix_tlv),

You mean SOC_DAPM_SINGLE_TLV() ? There is no _MUT_ variant AFAIK.
According to the datasheets of aic3106, aic3104:
0b0000 - 0b1000 is valid (0 - -12 dB)
0b1001 - 0b1110 is reserved, do not write these sequences to the register
0b1111 is disconnected.

And for fun the aic3007's reg20 for example:
0b0000 - 0dB
0b0001 - 0b0011 - reserved
0b0100 - -6dB
0b0101 - 0b0111 - reserved
0b1000 - -12dB
0b1001 - 0b1110 - reserved
0b1111 - disconnected

Note that the driver never had control for these gains and the aic3104 support
is following this behavior, but if we do it for aic3104 we should do it for
all other support codecs as well as a followup patch or series. IMHO.

>     SOC_DAPM_SINGLE_MUT_TLV("Line1R Volume",
>                 LINE1R_2_LADC_CTRL, 3, 7, 15, 1, mix_tlv),
>     SOC_DAPM_SINGLE_MUT_TLV("Mic2L Volume",
>                 MIC3LR_2_LADC_CTRL, 4, 7, 15, 1, mix_tlv),
>     SOC_DAPM_SINGLE_MUT_TLV("Mic2R Volume",
>                 MIC3LR_2_LADC_CTRL, 0, 7, 15, 1, mix_tlv),
> };
> 
> /* Right PGA Mixer for tlv320aic3104 */
> static const struct snd_kcontrol_new aic3104_right_pga_mixer_controls[] = {
>     SOC_DAPM_SINGLE_MUT_TLV("Line1R Volume",
>                 LINE1R_2_RADC_CTRL, 3, 7, 15, 1, mix_tlv),
>     SOC_DAPM_SINGLE_MUT_TLV("Line1L Volume",
>                 LINE1L_2_RADC_CTRL, 3, 7, 15, 1, mix_tlv),
>     SOC_DAPM_SINGLE_MUT_TLV("Mic2L Volume",
>                 MIC3LR_2_RADC_CTRL, 4, 7, 15, 1, mix_tlv),
>     SOC_DAPM_SINGLE_MUT_TLV("Mic2R Volume",
>                 MIC3LR_2_RADC_CTRL, 0, 7, 15, 1, mix_tlv),
> };
> 
> Then, use the following instead of the "Switch" for the tlv320aic3104 interconn:
>     {"Left PGA Mixer", "Line1L Volume", "Left Line1L Mux"},
>     {"Left PGA Mixer", "Line1R Volume", "Left Line1R Mux"},
>     {"Left PGA Mixer", "Mic2L Volume", "MIC2L"},
>     {"Left PGA Mixer", "Mic2R Volume", "MIC2R"},
> 
>     {"Right PGA Mixer", "Line1L Volume", "Right Line1L Mux"},
>     {"Right PGA Mixer", "Line1R Volume", "Right Line1R Mux"},
>     {"Right PGA Mixer", "Mic2L Volume", "MIC2L"},
>     {"Right PGA Mixer", "Mic2R Volume", "MIC2R"},
> 
> Best regards,
> Benoît
> 


-- 
Péter


More information about the Alsa-devel mailing list