aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8994.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-08-15 21:08:48 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-08-16 11:48:47 -0400
commit1ddc07d0f13a753f8e345e0538562e1899d2bc26 (patch)
tree30e9a0799f19f189a8be03ae619d350c47edc685 /sound/soc/codecs/wm8994.c
parent70ce6aee664a3e61ca5b4278d61db6da0996cade (diff)
ASoC: Add WM8958 noise gate support
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8994.c')
-rw-r--r--sound/soc/codecs/wm8994.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 0f36eeeb5fae..a0d6274ec280 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -282,6 +282,7 @@ static const DECLARE_TLV_DB_SCALE(digital_tlv, -7200, 75, 1);
282static const DECLARE_TLV_DB_SCALE(st_tlv, -3600, 300, 0); 282static const DECLARE_TLV_DB_SCALE(st_tlv, -3600, 300, 0);
283static const DECLARE_TLV_DB_SCALE(wm8994_3d_tlv, -1600, 183, 0); 283static const DECLARE_TLV_DB_SCALE(wm8994_3d_tlv, -1600, 183, 0);
284static const DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0); 284static const DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
285static const DECLARE_TLV_DB_SCALE(ng_tlv, -10200, 600, 0);
285 286
286#define WM8994_DRC_SWITCH(xname, reg, shift) \ 287#define WM8994_DRC_SWITCH(xname, reg, shift) \
287{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 288{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
@@ -661,8 +662,45 @@ SOC_SINGLE_TLV("AIF2 EQ5 Volume", WM8994_AIF2_EQ_GAINS_2, 6, 31, 0,
661 eq_tlv), 662 eq_tlv),
662}; 663};
663 664
665static const char *wm8958_ng_text[] = {
666 "30ms", "125ms", "250ms", "500ms",
667};
668
669static const struct soc_enum wm8958_aif1dac1_ng_hold =
670 SOC_ENUM_SINGLE(WM8958_AIF1_DAC1_NOISE_GATE,
671 WM8958_AIF1DAC1_NG_THR_SHIFT, 4, wm8958_ng_text);
672
673static const struct soc_enum wm8958_aif1dac2_ng_hold =
674 SOC_ENUM_SINGLE(WM8958_AIF1_DAC2_NOISE_GATE,
675 WM8958_AIF1DAC2_NG_THR_SHIFT, 4, wm8958_ng_text);
676
677static const struct soc_enum wm8958_aif2dac_ng_hold =
678 SOC_ENUM_SINGLE(WM8958_AIF2_DAC_NOISE_GATE,
679 WM8958_AIF2DAC_NG_THR_SHIFT, 4, wm8958_ng_text);
680
664static const struct snd_kcontrol_new wm8958_snd_controls[] = { 681static const struct snd_kcontrol_new wm8958_snd_controls[] = {
665SOC_SINGLE_TLV("AIF3 Boost Volume", WM8958_AIF3_CONTROL_2, 10, 3, 0, aif_tlv), 682SOC_SINGLE_TLV("AIF3 Boost Volume", WM8958_AIF3_CONTROL_2, 10, 3, 0, aif_tlv),
683
684SOC_SINGLE("AIF1DAC1 Noise Gate Switch", WM8958_AIF1_DAC1_NOISE_GATE,
685 WM8958_AIF1DAC1_NG_ENA_SHIFT, 1, 0),
686SOC_ENUM("AIF1DAC1 Noise Gate Hold Time", wm8958_aif1dac1_ng_hold),
687SOC_SINGLE_TLV("AIF1DAC1 Noise Gate Threshold Volume",
688 WM8958_AIF1_DAC1_NOISE_GATE, WM8958_AIF1DAC1_NG_THR_SHIFT,
689 7, 1, ng_tlv),
690
691SOC_SINGLE("AIF1DAC2 Noise Gate Switch", WM8958_AIF1_DAC2_NOISE_GATE,
692 WM8958_AIF1DAC2_NG_ENA_SHIFT, 1, 0),
693SOC_ENUM("AIF1DAC2 Noise Gate Hold Time", wm8958_aif1dac2_ng_hold),
694SOC_SINGLE_TLV("AIF1DAC2 Noise Gate Threshold Volume",
695 WM8958_AIF1_DAC2_NOISE_GATE, WM8958_AIF1DAC2_NG_THR_SHIFT,
696 7, 1, ng_tlv),
697
698SOC_SINGLE("AIF2DAC Noise Gate Switch", WM8958_AIF2_DAC_NOISE_GATE,
699 WM8958_AIF2DAC_NG_ENA_SHIFT, 1, 0),
700SOC_ENUM("AIF2DAC Noise Gate Hold Time", wm8958_aif2dac_ng_hold),
701SOC_SINGLE_TLV("AIF2DAC Noise Gate Threshold Volume",
702 WM8958_AIF2_DAC_NOISE_GATE, WM8958_AIF2DAC_NG_THR_SHIFT,
703 7, 1, ng_tlv),
666}; 704};
667 705
668static int clk_sys_event(struct snd_soc_dapm_widget *w, 706static int clk_sys_event(struct snd_soc_dapm_widget *w,