diff options
author | Jiri Prchal <jiri.prchal@aksignal.cz> | 2012-07-10 08:35:11 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-07-10 09:41:48 -0400 |
commit | bb1daa803c733462248421dd9beed84fecf1745e (patch) | |
tree | f1a8dce62c2dde445675e1db6abc1d1661c39329 /sound/soc/codecs/tlv320aic3x.c | |
parent | 774441915de8402103ffe5bf68656f160fefc86f (diff) |
ASoC: tlv320aic3x: add AGC settings
This patch adds AGC target level and times settings for TLV320AIC3x.
Enums uses small arrays of two channels left and right since it uses different registers.
Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
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 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index 7933b8c720af..0d2f8c44999d 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
@@ -231,6 +231,25 @@ static const struct soc_enum aic3x_enum[] = { | |||
231 | SOC_ENUM_DOUBLE(AIC3X_CODEC_DFILT_CTRL, 6, 4, 4, aic3x_adc_hpf), | 231 | SOC_ENUM_DOUBLE(AIC3X_CODEC_DFILT_CTRL, 6, 4, 4, aic3x_adc_hpf), |
232 | }; | 232 | }; |
233 | 233 | ||
234 | static const char *aic3x_agc_level[] = | ||
235 | { "-5.5dB", "-8dB", "-10dB", "-12dB", "-14dB", "-17dB", "-20dB", "-24dB" }; | ||
236 | static const struct soc_enum aic3x_agc_level_enum[] = { | ||
237 | SOC_ENUM_SINGLE(LAGC_CTRL_A, 4, 8, aic3x_agc_level), | ||
238 | SOC_ENUM_SINGLE(RAGC_CTRL_A, 4, 8, aic3x_agc_level), | ||
239 | }; | ||
240 | |||
241 | static const char *aic3x_agc_attack[] = { "8ms", "11ms", "16ms", "20ms" }; | ||
242 | static const struct soc_enum aic3x_agc_attack_enum[] = { | ||
243 | SOC_ENUM_SINGLE(LAGC_CTRL_A, 2, 4, aic3x_agc_attack), | ||
244 | SOC_ENUM_SINGLE(RAGC_CTRL_A, 2, 4, aic3x_agc_attack), | ||
245 | }; | ||
246 | |||
247 | static const char *aic3x_agc_decay[] = { "100ms", "200ms", "400ms", "500ms" }; | ||
248 | static const struct soc_enum aic3x_agc_decay_enum[] = { | ||
249 | SOC_ENUM_SINGLE(LAGC_CTRL_A, 0, 4, aic3x_agc_decay), | ||
250 | SOC_ENUM_SINGLE(RAGC_CTRL_A, 0, 4, aic3x_agc_decay), | ||
251 | }; | ||
252 | |||
234 | /* | 253 | /* |
235 | * DAC digital volumes. From -63.5 to 0 dB in 0.5 dB steps | 254 | * DAC digital volumes. From -63.5 to 0 dB in 0.5 dB steps |
236 | */ | 255 | */ |
@@ -355,6 +374,12 @@ static const struct snd_kcontrol_new aic3x_snd_controls[] = { | |||
355 | * adjust PGA to max value when ADC is on and will never go back. | 374 | * adjust PGA to max value when ADC is on and will never go back. |
356 | */ | 375 | */ |
357 | SOC_DOUBLE_R("AGC Switch", LAGC_CTRL_A, RAGC_CTRL_A, 7, 0x01, 0), | 376 | SOC_DOUBLE_R("AGC Switch", LAGC_CTRL_A, RAGC_CTRL_A, 7, 0x01, 0), |
377 | SOC_ENUM("Left AGC Target level", aic3x_agc_level_enum[0]), | ||
378 | SOC_ENUM("Right AGC Target level", aic3x_agc_level_enum[1]), | ||
379 | SOC_ENUM("Left AGC Attack time", aic3x_agc_attack_enum[0]), | ||
380 | SOC_ENUM("Right AGC Attack time", aic3x_agc_attack_enum[1]), | ||
381 | SOC_ENUM("Left AGC Decay time", aic3x_agc_decay_enum[0]), | ||
382 | SOC_ENUM("Right AGC Decay time", aic3x_agc_decay_enum[1]), | ||
358 | 383 | ||
359 | /* De-emphasis */ | 384 | /* De-emphasis */ |
360 | SOC_DOUBLE("De-emphasis Switch", AIC3X_CODEC_DFILT_CTRL, 2, 0, 0x01, 0), | 385 | SOC_DOUBLE("De-emphasis Switch", AIC3X_CODEC_DFILT_CTRL, 2, 0, 0x01, 0), |