diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-24 11:27:08 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-25 06:18:51 -0500 |
commit | fcd02e261bb3b1ae14830d33da5401c6c4ee9bcc (patch) | |
tree | 275495e2f6fa407ed3630669e4b0f880cec441cf /sound/soc/codecs/wm8737.c | |
parent | 7a93941975a95dd3be319128552fea71867724d7 (diff) |
ASoC: Add WM8737 ALC support
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/codecs/wm8737.c')
-rw-r--r-- | sound/soc/codecs/wm8737.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8737.c b/sound/soc/codecs/wm8737.c index a325fe60d26c..2301338cb2c9 100644 --- a/sound/soc/codecs/wm8737.c +++ b/sound/soc/codecs/wm8737.c | |||
@@ -78,6 +78,8 @@ static const unsigned int micboost_tlv[] = { | |||
78 | static const DECLARE_TLV_DB_SCALE(pga_tlv, -9750, 50, 1); | 78 | static const DECLARE_TLV_DB_SCALE(pga_tlv, -9750, 50, 1); |
79 | static const DECLARE_TLV_DB_SCALE(adc_tlv, -600, 600, 0); | 79 | static const DECLARE_TLV_DB_SCALE(adc_tlv, -600, 600, 0); |
80 | static const DECLARE_TLV_DB_SCALE(ng_tlv, -7800, 600, 0); | 80 | static const DECLARE_TLV_DB_SCALE(ng_tlv, -7800, 600, 0); |
81 | static const DECLARE_TLV_DB_SCALE(alc_max_tlv, -1200, 600, 0); | ||
82 | static const DECLARE_TLV_DB_SCALE(alc_target_tlv, -1800, 100, 0); | ||
81 | 83 | ||
82 | static const char *micbias_enum_text[] = { | 84 | static const char *micbias_enum_text[] = { |
83 | "25%", | 85 | "25%", |
@@ -103,6 +105,38 @@ static const char *high_cutoff_text[] = { | |||
103 | static const struct soc_enum high_3d = | 105 | static const struct soc_enum high_3d = |
104 | SOC_ENUM_SINGLE(WM8737_3D_ENHANCE, 5, 2, high_cutoff_text); | 106 | SOC_ENUM_SINGLE(WM8737_3D_ENHANCE, 5, 2, high_cutoff_text); |
105 | 107 | ||
108 | static const char *alc_fn_text[] = { | ||
109 | "Disabled", "Right", "Left", "Stereo" | ||
110 | }; | ||
111 | |||
112 | static const struct soc_enum alc_fn = | ||
113 | SOC_ENUM_SINGLE(WM8737_ALC1, 7, 4, alc_fn_text); | ||
114 | |||
115 | static const char *alc_hold_text[] = { | ||
116 | "0", "2.67ms", "5.33ms", "10.66ms", "21.32ms", "42.64ms", "85.28ms", | ||
117 | "170.56ms", "341.12ms", "682.24ms", "1.364s", "2.728s", "5.458s", | ||
118 | "10.916s", "21.832s", "43.691s" | ||
119 | }; | ||
120 | |||
121 | static const struct soc_enum alc_hold = | ||
122 | SOC_ENUM_SINGLE(WM8737_ALC2, 0, 16, alc_hold_text); | ||
123 | |||
124 | static const char *alc_atk_text[] = { | ||
125 | "8.4ms", "16.8ms", "33.6ms", "67.2ms", "134.4ms", "268.8ms", "537.6ms", | ||
126 | "1.075s", "2.15s", "4.3s", "8.6s" | ||
127 | }; | ||
128 | |||
129 | static const struct soc_enum alc_atk = | ||
130 | SOC_ENUM_SINGLE(WM8737_ALC3, 0, 11, alc_atk_text); | ||
131 | |||
132 | static const char *alc_dcy_text[] = { | ||
133 | "33.6ms", "67.2ms", "134.4ms", "268.8ms", "537.6ms", "1.075s", "2.15s", | ||
134 | "4.3s", "8.6s", "17.2s", "34.41s" | ||
135 | }; | ||
136 | |||
137 | static const struct soc_enum alc_dcy = | ||
138 | SOC_ENUM_SINGLE(WM8737_ALC3, 4, 11, alc_dcy_text); | ||
139 | |||
106 | static const struct snd_kcontrol_new wm8737_snd_controls[] = { | 140 | static const struct snd_kcontrol_new wm8737_snd_controls[] = { |
107 | SOC_DOUBLE_R_TLV("Mic Boost Volume", WM8737_AUDIO_PATH_L, WM8737_AUDIO_PATH_R, | 141 | SOC_DOUBLE_R_TLV("Mic Boost Volume", WM8737_AUDIO_PATH_L, WM8737_AUDIO_PATH_R, |
108 | 6, 3, 0, micboost_tlv), | 142 | 6, 3, 0, micboost_tlv), |
@@ -132,6 +166,14 @@ SOC_SINGLE_TLV("3D ADC Volume", WM8737_3D_ENHANCE, 7, 1, 1, adc_tlv), | |||
132 | SOC_SINGLE("Noise Gate Switch", WM8737_NOISE_GATE, 0, 1, 0), | 166 | SOC_SINGLE("Noise Gate Switch", WM8737_NOISE_GATE, 0, 1, 0), |
133 | SOC_SINGLE_TLV("Noise Gate Threshold Volume", WM8737_NOISE_GATE, 2, 7, 0, | 167 | SOC_SINGLE_TLV("Noise Gate Threshold Volume", WM8737_NOISE_GATE, 2, 7, 0, |
134 | ng_tlv), | 168 | ng_tlv), |
169 | |||
170 | SOC_ENUM("ALC", alc_fn), | ||
171 | SOC_SINGLE_TLV("ALC Max Gain Volume", WM8737_ALC1, 4, 7, 0, alc_max_tlv), | ||
172 | SOC_SINGLE_TLV("ALC Target Volume", WM8737_ALC1, 0, 15, 0, alc_target_tlv), | ||
173 | SOC_ENUM("ALC Hold Time", alc_hold), | ||
174 | SOC_SINGLE("ALC ZC Switch", WM8737_ALC2, 4, 1, 0), | ||
175 | SOC_ENUM("ALC Attack Time", alc_atk), | ||
176 | SOC_ENUM("ALC Decay Time", alc_dcy), | ||
135 | }; | 177 | }; |
136 | 178 | ||
137 | static const char *linsel_text[] = { | 179 | static const char *linsel_text[] = { |