aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm5110.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-18 08:53:26 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-24 10:39:11 -0500
commitbd7fe24bc43bc75255cebb7aed5ed675579531d3 (patch)
tree04dc9e1242fffcc849cd1205630c9fd350ff7ee4 /sound/soc/codecs/wm5110.c
parent50571263722452a57a67edee23b892b2607dc374 (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.c34
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);
41static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0); 41static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
42static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0); 42static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0);
43static DECLARE_TLV_DB_SCALE(noise_tlv, 0, 600, 0); 43static DECLARE_TLV_DB_SCALE(noise_tlv, 0, 600, 0);
44static 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
45static const struct snd_kcontrol_new wm5110_snd_controls[] = { 60static const struct snd_kcontrol_new wm5110_snd_controls[] = {
46SOC_SINGLE("IN1 High Performance Switch", ARIZONA_IN1L_CONTROL, 61SOC_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,
278SOC_ENUM("Output Ramp Up", arizona_out_vi_ramp), 293SOC_ENUM("Output Ramp Up", arizona_out_vi_ramp),
279SOC_ENUM("Output Ramp Down", arizona_out_vd_ramp), 294SOC_ENUM("Output Ramp Down", arizona_out_vd_ramp),
280 295
296SOC_SINGLE("Noise Gate Switch", ARIZONA_NOISE_GATE_CONTROL,
297 ARIZONA_NGATE_ENA_SHIFT, 1, 0),
298SOC_SINGLE_TLV("Noise Gate Threshold Volume", ARIZONA_NOISE_GATE_CONTROL,
299 ARIZONA_NGATE_THR_SHIFT, 7, 1, ng_tlv),
300SOC_ENUM("Noise Gate Hold", arizona_ng_hold),
301
302WM5110_NG_SRC("HPOUT1L", ARIZONA_NOISE_GATE_SELECT_1L),
303WM5110_NG_SRC("HPOUT1R", ARIZONA_NOISE_GATE_SELECT_1R),
304WM5110_NG_SRC("HPOUT2L", ARIZONA_NOISE_GATE_SELECT_2L),
305WM5110_NG_SRC("HPOUT2R", ARIZONA_NOISE_GATE_SELECT_2R),
306WM5110_NG_SRC("HPOUT3L", ARIZONA_NOISE_GATE_SELECT_3L),
307WM5110_NG_SRC("HPOUT3R", ARIZONA_NOISE_GATE_SELECT_3R),
308WM5110_NG_SRC("SPKOUTL", ARIZONA_NOISE_GATE_SELECT_4L),
309WM5110_NG_SRC("SPKOUTR", ARIZONA_NOISE_GATE_SELECT_4R),
310WM5110_NG_SRC("SPKDAT1L", ARIZONA_NOISE_GATE_SELECT_5L),
311WM5110_NG_SRC("SPKDAT1R", ARIZONA_NOISE_GATE_SELECT_5R),
312WM5110_NG_SRC("SPKDAT2L", ARIZONA_NOISE_GATE_SELECT_6L),
313WM5110_NG_SRC("SPKDAT2R", ARIZONA_NOISE_GATE_SELECT_6R),
314
281ARIZONA_MIXER_CONTROLS("AIF1TX1", ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE), 315ARIZONA_MIXER_CONTROLS("AIF1TX1", ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE),
282ARIZONA_MIXER_CONTROLS("AIF1TX2", ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE), 316ARIZONA_MIXER_CONTROLS("AIF1TX2", ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE),
283ARIZONA_MIXER_CONTROLS("AIF1TX3", ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE), 317ARIZONA_MIXER_CONTROLS("AIF1TX3", ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE),