diff options
author | Jarkko Nikula <jarkko.nikula@nokia.com> | 2009-02-09 07:27:06 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-02-09 13:27:59 -0500 |
commit | b93f74f604c53b546fced33d11aee722560de249 (patch) | |
tree | e107aeb39da3897de42b77c090afd5642ec323e4 /sound/soc/codecs/tlv320aic3x.c | |
parent | 44dd2b9168350b82a671ce71666b99208ab2d973 (diff) |
ASoC: TLV320AIC3X: Fix volume ranges
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>
Diffstat (limited to 'sound/soc/codecs/tlv320aic3x.c')
-rw-r--r-- | sound/soc/codecs/tlv320aic3x.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index ac73e692a99b..cdb6dec14e1c 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
@@ -255,51 +255,51 @@ static const struct snd_kcontrol_new aic3x_snd_controls[] = { | |||
255 | SOC_DOUBLE_R("PCM Playback Volume", LDAC_VOL, RDAC_VOL, 0, 0x7f, 1), | 255 | SOC_DOUBLE_R("PCM Playback Volume", LDAC_VOL, RDAC_VOL, 0, 0x7f, 1), |
256 | 256 | ||
257 | SOC_DOUBLE_R("Line DAC Playback Volume", DACL1_2_LLOPM_VOL, | 257 | SOC_DOUBLE_R("Line DAC Playback Volume", DACL1_2_LLOPM_VOL, |
258 | DACR1_2_RLOPM_VOL, 0, 0x7f, 1), | 258 | DACR1_2_RLOPM_VOL, 0, 118, 1), |
259 | SOC_SINGLE("LineL Playback Switch", LLOPM_CTRL, 3, 0x01, 0), | 259 | SOC_SINGLE("LineL Playback Switch", LLOPM_CTRL, 3, 0x01, 0), |
260 | SOC_SINGLE("LineR Playback Switch", RLOPM_CTRL, 3, 0x01, 0), | 260 | SOC_SINGLE("LineR Playback Switch", RLOPM_CTRL, 3, 0x01, 0), |
261 | SOC_DOUBLE_R("LineL DAC Playback Volume", DACL1_2_LLOPM_VOL, | 261 | SOC_DOUBLE_R("LineL DAC Playback Volume", DACL1_2_LLOPM_VOL, |
262 | DACR1_2_LLOPM_VOL, 0, 0x7f, 1), | 262 | DACR1_2_LLOPM_VOL, 0, 118, 1), |
263 | SOC_SINGLE("LineL Left PGA Bypass Playback Volume", PGAL_2_LLOPM_VOL, | 263 | SOC_SINGLE("LineL Left PGA Bypass Playback Volume", PGAL_2_LLOPM_VOL, |
264 | 0, 0x7f, 1), | 264 | 0, 118, 1), |
265 | SOC_SINGLE("LineR Right PGA Bypass Playback Volume", PGAR_2_RLOPM_VOL, | 265 | SOC_SINGLE("LineR Right PGA Bypass Playback Volume", PGAR_2_RLOPM_VOL, |
266 | 0, 0x7f, 1), | 266 | 0, 118, 1), |
267 | SOC_DOUBLE_R("LineL Line2 Bypass Playback Volume", LINE2L_2_LLOPM_VOL, | 267 | SOC_DOUBLE_R("LineL Line2 Bypass Playback Volume", LINE2L_2_LLOPM_VOL, |
268 | LINE2R_2_LLOPM_VOL, 0, 0x7f, 1), | 268 | LINE2R_2_LLOPM_VOL, 0, 118, 1), |
269 | SOC_DOUBLE_R("LineR Line2 Bypass Playback Volume", LINE2L_2_RLOPM_VOL, | 269 | SOC_DOUBLE_R("LineR Line2 Bypass Playback Volume", LINE2L_2_RLOPM_VOL, |
270 | LINE2R_2_RLOPM_VOL, 0, 0x7f, 1), | 270 | LINE2R_2_RLOPM_VOL, 0, 118, 1), |
271 | 271 | ||
272 | SOC_DOUBLE_R("Mono DAC Playback Volume", DACL1_2_MONOLOPM_VOL, | 272 | SOC_DOUBLE_R("Mono DAC Playback Volume", DACL1_2_MONOLOPM_VOL, |
273 | DACR1_2_MONOLOPM_VOL, 0, 0x7f, 1), | 273 | DACR1_2_MONOLOPM_VOL, 0, 118, 1), |
274 | SOC_SINGLE("Mono DAC Playback Switch", MONOLOPM_CTRL, 3, 0x01, 0), | 274 | SOC_SINGLE("Mono DAC Playback Switch", MONOLOPM_CTRL, 3, 0x01, 0), |
275 | SOC_DOUBLE_R("Mono PGA Bypass Playback Volume", PGAL_2_MONOLOPM_VOL, | 275 | SOC_DOUBLE_R("Mono PGA Bypass Playback Volume", PGAL_2_MONOLOPM_VOL, |
276 | PGAR_2_MONOLOPM_VOL, 0, 0x7f, 1), | 276 | PGAR_2_MONOLOPM_VOL, 0, 118, 1), |
277 | SOC_DOUBLE_R("Mono Line2 Bypass Playback Volume", LINE2L_2_MONOLOPM_VOL, | 277 | SOC_DOUBLE_R("Mono Line2 Bypass Playback Volume", LINE2L_2_MONOLOPM_VOL, |
278 | LINE2R_2_MONOLOPM_VOL, 0, 0x7f, 1), | 278 | LINE2R_2_MONOLOPM_VOL, 0, 118, 1), |
279 | 279 | ||
280 | SOC_DOUBLE_R("HP DAC Playback Volume", DACL1_2_HPLOUT_VOL, | 280 | SOC_DOUBLE_R("HP DAC Playback Volume", DACL1_2_HPLOUT_VOL, |
281 | DACR1_2_HPROUT_VOL, 0, 0x7f, 1), | 281 | DACR1_2_HPROUT_VOL, 0, 118, 1), |
282 | SOC_DOUBLE_R("HP DAC Playback Switch", HPLOUT_CTRL, HPROUT_CTRL, 3, | 282 | SOC_DOUBLE_R("HP DAC Playback Switch", HPLOUT_CTRL, HPROUT_CTRL, 3, |
283 | 0x01, 0), | 283 | 0x01, 0), |
284 | SOC_DOUBLE_R("HP Right PGA Bypass Playback Volume", PGAR_2_HPLOUT_VOL, | 284 | SOC_DOUBLE_R("HP Right PGA Bypass Playback Volume", PGAR_2_HPLOUT_VOL, |
285 | PGAR_2_HPROUT_VOL, 0, 0x7f, 1), | 285 | PGAR_2_HPROUT_VOL, 0, 118, 1), |
286 | SOC_SINGLE("HPL PGA Bypass Playback Volume", PGAL_2_HPLOUT_VOL, | 286 | SOC_SINGLE("HPL PGA Bypass Playback Volume", PGAL_2_HPLOUT_VOL, |
287 | 0, 0x7f, 1), | 287 | 0, 118, 1), |
288 | SOC_SINGLE("HPR PGA Bypass Playback Volume", PGAL_2_HPROUT_VOL, | 288 | SOC_SINGLE("HPR PGA Bypass Playback Volume", PGAL_2_HPROUT_VOL, |
289 | 0, 0x7f, 1), | 289 | 0, 118, 1), |
290 | SOC_DOUBLE_R("HP Line2 Bypass Playback Volume", LINE2L_2_HPLOUT_VOL, | 290 | SOC_DOUBLE_R("HP Line2 Bypass Playback Volume", LINE2L_2_HPLOUT_VOL, |
291 | LINE2R_2_HPROUT_VOL, 0, 0x7f, 1), | 291 | LINE2R_2_HPROUT_VOL, 0, 118, 1), |
292 | 292 | ||
293 | SOC_DOUBLE_R("HPCOM DAC Playback Volume", DACL1_2_HPLCOM_VOL, | 293 | SOC_DOUBLE_R("HPCOM DAC Playback Volume", DACL1_2_HPLCOM_VOL, |
294 | DACR1_2_HPRCOM_VOL, 0, 0x7f, 1), | 294 | DACR1_2_HPRCOM_VOL, 0, 118, 1), |
295 | SOC_DOUBLE_R("HPCOM DAC Playback Switch", HPLCOM_CTRL, HPRCOM_CTRL, 3, | 295 | SOC_DOUBLE_R("HPCOM DAC Playback Switch", HPLCOM_CTRL, HPRCOM_CTRL, 3, |
296 | 0x01, 0), | 296 | 0x01, 0), |
297 | SOC_SINGLE("HPLCOM PGA Bypass Playback Volume", PGAL_2_HPLCOM_VOL, | 297 | SOC_SINGLE("HPLCOM PGA Bypass Playback Volume", PGAL_2_HPLCOM_VOL, |
298 | 0, 0x7f, 1), | 298 | 0, 118, 1), |
299 | SOC_SINGLE("HPRCOM PGA Bypass Playback Volume", PGAL_2_HPRCOM_VOL, | 299 | SOC_SINGLE("HPRCOM PGA Bypass Playback Volume", PGAL_2_HPRCOM_VOL, |
300 | 0, 0x7f, 1), | 300 | 0, 118, 1), |
301 | SOC_DOUBLE_R("HPCOM Line2 Bypass Playback Volume", LINE2L_2_HPLCOM_VOL, | 301 | SOC_DOUBLE_R("HPCOM Line2 Bypass Playback Volume", LINE2L_2_HPLCOM_VOL, |
302 | LINE2R_2_HPRCOM_VOL, 0, 0x7f, 1), | 302 | LINE2R_2_HPRCOM_VOL, 0, 118, 1), |
303 | 303 | ||
304 | /* | 304 | /* |
305 | * Note: enable Automatic input Gain Controller with care. It can | 305 | * Note: enable Automatic input Gain Controller with care. It can |
@@ -308,7 +308,7 @@ static const struct snd_kcontrol_new aic3x_snd_controls[] = { | |||
308 | SOC_DOUBLE_R("AGC Switch", LAGC_CTRL_A, RAGC_CTRL_A, 7, 0x01, 0), | 308 | SOC_DOUBLE_R("AGC Switch", LAGC_CTRL_A, RAGC_CTRL_A, 7, 0x01, 0), |
309 | 309 | ||
310 | /* Input */ | 310 | /* Input */ |
311 | SOC_DOUBLE_R("PGA Capture Volume", LADC_VOL, RADC_VOL, 0, 0x7f, 0), | 311 | SOC_DOUBLE_R("PGA Capture Volume", LADC_VOL, RADC_VOL, 0, 119, 0), |
312 | SOC_DOUBLE_R("PGA Capture Switch", LADC_VOL, RADC_VOL, 7, 0x01, 1), | 312 | SOC_DOUBLE_R("PGA Capture Switch", LADC_VOL, RADC_VOL, 7, 0x01, 1), |
313 | 313 | ||
314 | SOC_ENUM("ADC HPF Cut-off", aic3x_enum[ADC_HPF_ENUM]), | 314 | SOC_ENUM("ADC HPF Cut-off", aic3x_enum[ADC_HPF_ENUM]), |