diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-12-18 08:53:26 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-12-24 10:39:11 -0500 |
commit | bd7fe24bc43bc75255cebb7aed5ed675579531d3 (patch) | |
tree | 04dc9e1242fffcc849cd1205630c9fd350ff7ee4 /sound/soc/codecs/wm5110.c | |
parent | 50571263722452a57a67edee23b892b2607dc374 (diff) |
ASoC: wm5110: Add noise gate control
The references used for the noise gates and parameters for their triggering
are configurable, expose that to users.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm5110.c')
-rw-r--r-- | sound/soc/codecs/wm5110.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index 9cdac35914f8..8f7081e1417a 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c | |||
@@ -41,6 +41,21 @@ static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0); | |||
41 | static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0); | 41 | static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0); |
42 | static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0); | 42 | static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0); |
43 | static DECLARE_TLV_DB_SCALE(noise_tlv, 0, 600, 0); | 43 | static DECLARE_TLV_DB_SCALE(noise_tlv, 0, 600, 0); |
44 | static DECLARE_TLV_DB_SCALE(ng_tlv, -10200, 600, 0); | ||
45 | |||
46 | #define WM5110_NG_SRC(name, base) \ | ||
47 | SOC_SINGLE(name " NG HPOUT1L Switch", base, 0, 1, 0), \ | ||
48 | SOC_SINGLE(name " NG HPOUT1R Switch", base, 1, 1, 0), \ | ||
49 | SOC_SINGLE(name " NG HPOUT2L Switch", base, 2, 1, 0), \ | ||
50 | SOC_SINGLE(name " NG HPOUT2R Switch", base, 3, 1, 0), \ | ||
51 | SOC_SINGLE(name " NG HPOUT3L Switch", base, 4, 1, 0), \ | ||
52 | SOC_SINGLE(name " NG HPOUT3R Switch", base, 5, 1, 0), \ | ||
53 | SOC_SINGLE(name " NG SPKOUTL Switch", base, 6, 1, 0), \ | ||
54 | SOC_SINGLE(name " NG SPKOUTR Switch", base, 7, 1, 0), \ | ||
55 | SOC_SINGLE(name " NG SPKDAT1L Switch", base, 8, 1, 0), \ | ||
56 | SOC_SINGLE(name " NG SPKDAT1R Switch", base, 9, 1, 0), \ | ||
57 | SOC_SINGLE(name " NG SPKDAT2L Switch", base, 10, 1, 0), \ | ||
58 | SOC_SINGLE(name " NG SPKDAT2R Switch", base, 11, 1, 0) | ||
44 | 59 | ||
45 | static const struct snd_kcontrol_new wm5110_snd_controls[] = { | 60 | static const struct snd_kcontrol_new wm5110_snd_controls[] = { |
46 | SOC_SINGLE("IN1 High Performance Switch", ARIZONA_IN1L_CONTROL, | 61 | SOC_SINGLE("IN1 High Performance Switch", ARIZONA_IN1L_CONTROL, |
@@ -278,6 +293,25 @@ SOC_DOUBLE("SPKDAT2 Switch", ARIZONA_PDM_SPK2_CTRL_1, ARIZONA_SPK2L_MUTE_SHIFT, | |||
278 | SOC_ENUM("Output Ramp Up", arizona_out_vi_ramp), | 293 | SOC_ENUM("Output Ramp Up", arizona_out_vi_ramp), |
279 | SOC_ENUM("Output Ramp Down", arizona_out_vd_ramp), | 294 | SOC_ENUM("Output Ramp Down", arizona_out_vd_ramp), |
280 | 295 | ||
296 | SOC_SINGLE("Noise Gate Switch", ARIZONA_NOISE_GATE_CONTROL, | ||
297 | ARIZONA_NGATE_ENA_SHIFT, 1, 0), | ||
298 | SOC_SINGLE_TLV("Noise Gate Threshold Volume", ARIZONA_NOISE_GATE_CONTROL, | ||
299 | ARIZONA_NGATE_THR_SHIFT, 7, 1, ng_tlv), | ||
300 | SOC_ENUM("Noise Gate Hold", arizona_ng_hold), | ||
301 | |||
302 | WM5110_NG_SRC("HPOUT1L", ARIZONA_NOISE_GATE_SELECT_1L), | ||
303 | WM5110_NG_SRC("HPOUT1R", ARIZONA_NOISE_GATE_SELECT_1R), | ||
304 | WM5110_NG_SRC("HPOUT2L", ARIZONA_NOISE_GATE_SELECT_2L), | ||
305 | WM5110_NG_SRC("HPOUT2R", ARIZONA_NOISE_GATE_SELECT_2R), | ||
306 | WM5110_NG_SRC("HPOUT3L", ARIZONA_NOISE_GATE_SELECT_3L), | ||
307 | WM5110_NG_SRC("HPOUT3R", ARIZONA_NOISE_GATE_SELECT_3R), | ||
308 | WM5110_NG_SRC("SPKOUTL", ARIZONA_NOISE_GATE_SELECT_4L), | ||
309 | WM5110_NG_SRC("SPKOUTR", ARIZONA_NOISE_GATE_SELECT_4R), | ||
310 | WM5110_NG_SRC("SPKDAT1L", ARIZONA_NOISE_GATE_SELECT_5L), | ||
311 | WM5110_NG_SRC("SPKDAT1R", ARIZONA_NOISE_GATE_SELECT_5R), | ||
312 | WM5110_NG_SRC("SPKDAT2L", ARIZONA_NOISE_GATE_SELECT_6L), | ||
313 | WM5110_NG_SRC("SPKDAT2R", ARIZONA_NOISE_GATE_SELECT_6R), | ||
314 | |||
281 | ARIZONA_MIXER_CONTROLS("AIF1TX1", ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE), | 315 | ARIZONA_MIXER_CONTROLS("AIF1TX1", ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE), |
282 | ARIZONA_MIXER_CONTROLS("AIF1TX2", ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE), | 316 | ARIZONA_MIXER_CONTROLS("AIF1TX2", ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE), |
283 | ARIZONA_MIXER_CONTROLS("AIF1TX3", ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE), | 317 | ARIZONA_MIXER_CONTROLS("AIF1TX3", ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE), |