Skip to content

Commit

Permalink
ASoC: TLV320AIC3X: Fix volume ranges
Browse files Browse the repository at this point in the history
This is a minor fix but helps to define dB ranges for volume controls.

Only DAC digital volume has full register value range from 0 to 127 but
ADC PGA gain and output stage volume controls don't.

For ADC PGA, maximum value is 119 and then it saturates to the same
gain value of 59.5 dB. For output stages, value 117 corresponds to -78.3 dB
and is muted for values 118 and above.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Jarkko Nikula authored and Mark Brown committed Feb 9, 2009
1 parent 44dd2b9 commit b93f74f
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions sound/soc/codecs/tlv320aic3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,51 +255,51 @@ static const struct snd_kcontrol_new aic3x_snd_controls[] = {
SOC_DOUBLE_R("PCM Playback Volume", LDAC_VOL, RDAC_VOL, 0, 0x7f, 1),

SOC_DOUBLE_R("Line DAC Playback Volume", DACL1_2_LLOPM_VOL,
DACR1_2_RLOPM_VOL, 0, 0x7f, 1),
DACR1_2_RLOPM_VOL, 0, 118, 1),
SOC_SINGLE("LineL Playback Switch", LLOPM_CTRL, 3, 0x01, 0),
SOC_SINGLE("LineR Playback Switch", RLOPM_CTRL, 3, 0x01, 0),
SOC_DOUBLE_R("LineL DAC Playback Volume", DACL1_2_LLOPM_VOL,
DACR1_2_LLOPM_VOL, 0, 0x7f, 1),
DACR1_2_LLOPM_VOL, 0, 118, 1),
SOC_SINGLE("LineL Left PGA Bypass Playback Volume", PGAL_2_LLOPM_VOL,
0, 0x7f, 1),
0, 118, 1),
SOC_SINGLE("LineR Right PGA Bypass Playback Volume", PGAR_2_RLOPM_VOL,
0, 0x7f, 1),
0, 118, 1),
SOC_DOUBLE_R("LineL Line2 Bypass Playback Volume", LINE2L_2_LLOPM_VOL,
LINE2R_2_LLOPM_VOL, 0, 0x7f, 1),
LINE2R_2_LLOPM_VOL, 0, 118, 1),
SOC_DOUBLE_R("LineR Line2 Bypass Playback Volume", LINE2L_2_RLOPM_VOL,
LINE2R_2_RLOPM_VOL, 0, 0x7f, 1),
LINE2R_2_RLOPM_VOL, 0, 118, 1),

SOC_DOUBLE_R("Mono DAC Playback Volume", DACL1_2_MONOLOPM_VOL,
DACR1_2_MONOLOPM_VOL, 0, 0x7f, 1),
DACR1_2_MONOLOPM_VOL, 0, 118, 1),
SOC_SINGLE("Mono DAC Playback Switch", MONOLOPM_CTRL, 3, 0x01, 0),
SOC_DOUBLE_R("Mono PGA Bypass Playback Volume", PGAL_2_MONOLOPM_VOL,
PGAR_2_MONOLOPM_VOL, 0, 0x7f, 1),
PGAR_2_MONOLOPM_VOL, 0, 118, 1),
SOC_DOUBLE_R("Mono Line2 Bypass Playback Volume", LINE2L_2_MONOLOPM_VOL,
LINE2R_2_MONOLOPM_VOL, 0, 0x7f, 1),
LINE2R_2_MONOLOPM_VOL, 0, 118, 1),

SOC_DOUBLE_R("HP DAC Playback Volume", DACL1_2_HPLOUT_VOL,
DACR1_2_HPROUT_VOL, 0, 0x7f, 1),
DACR1_2_HPROUT_VOL, 0, 118, 1),
SOC_DOUBLE_R("HP DAC Playback Switch", HPLOUT_CTRL, HPROUT_CTRL, 3,
0x01, 0),
SOC_DOUBLE_R("HP Right PGA Bypass Playback Volume", PGAR_2_HPLOUT_VOL,
PGAR_2_HPROUT_VOL, 0, 0x7f, 1),
PGAR_2_HPROUT_VOL, 0, 118, 1),
SOC_SINGLE("HPL PGA Bypass Playback Volume", PGAL_2_HPLOUT_VOL,
0, 0x7f, 1),
0, 118, 1),
SOC_SINGLE("HPR PGA Bypass Playback Volume", PGAL_2_HPROUT_VOL,
0, 0x7f, 1),
0, 118, 1),
SOC_DOUBLE_R("HP Line2 Bypass Playback Volume", LINE2L_2_HPLOUT_VOL,
LINE2R_2_HPROUT_VOL, 0, 0x7f, 1),
LINE2R_2_HPROUT_VOL, 0, 118, 1),

SOC_DOUBLE_R("HPCOM DAC Playback Volume", DACL1_2_HPLCOM_VOL,
DACR1_2_HPRCOM_VOL, 0, 0x7f, 1),
DACR1_2_HPRCOM_VOL, 0, 118, 1),
SOC_DOUBLE_R("HPCOM DAC Playback Switch", HPLCOM_CTRL, HPRCOM_CTRL, 3,
0x01, 0),
SOC_SINGLE("HPLCOM PGA Bypass Playback Volume", PGAL_2_HPLCOM_VOL,
0, 0x7f, 1),
0, 118, 1),
SOC_SINGLE("HPRCOM PGA Bypass Playback Volume", PGAL_2_HPRCOM_VOL,
0, 0x7f, 1),
0, 118, 1),
SOC_DOUBLE_R("HPCOM Line2 Bypass Playback Volume", LINE2L_2_HPLCOM_VOL,
LINE2R_2_HPRCOM_VOL, 0, 0x7f, 1),
LINE2R_2_HPRCOM_VOL, 0, 118, 1),

/*
* Note: enable Automatic input Gain Controller with care. It can
Expand All @@ -308,7 +308,7 @@ static const struct snd_kcontrol_new aic3x_snd_controls[] = {
SOC_DOUBLE_R("AGC Switch", LAGC_CTRL_A, RAGC_CTRL_A, 7, 0x01, 0),

/* Input */
SOC_DOUBLE_R("PGA Capture Volume", LADC_VOL, RADC_VOL, 0, 0x7f, 0),
SOC_DOUBLE_R("PGA Capture Volume", LADC_VOL, RADC_VOL, 0, 119, 0),
SOC_DOUBLE_R("PGA Capture Switch", LADC_VOL, RADC_VOL, 7, 0x01, 1),

SOC_ENUM("ADC HPF Cut-off", aic3x_enum[ADC_HPF_ENUM]),
Expand Down

0 comments on commit b93f74f

Please sign in to comment.