diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2016-05-13 11:45:16 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-05-30 11:14:59 -0400 |
commit | 97126ce8ce8d6f023b8ce3b71c3df882a2951605 (patch) | |
tree | c2bc4c7601c8f008d604c2812013edca98e1e876 | |
parent | 9fc772eca1d94b84dfc235e7643603cbe9d6e8a3 (diff) |
ASoC: arizona: Add voice trigger output widget
In some situations the voice control firmware will by used
to only provide a trigger notification event. In this case a
compressed stream will not be opened by user-space, as such we
need to provide a virtual output to power on the DSP in this
use-case. This patch adds a virtual output 'DSP Voice Trigger'
that can be used for this, and a switch that lets it be connected
to the core when required.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/arizona.c | 8 | ||||
-rw-r--r-- | sound/soc/codecs/arizona.h | 2 | ||||
-rw-r--r-- | sound/soc/codecs/cs47l24.c | 9 | ||||
-rw-r--r-- | sound/soc/codecs/wm5110.c | 9 |
4 files changed, 28 insertions, 0 deletions
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index 664a8c044ffb..a6e3881c718e 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c | |||
@@ -810,6 +810,14 @@ const struct soc_enum arizona_output_anc_src[] = { | |||
810 | }; | 810 | }; |
811 | EXPORT_SYMBOL_GPL(arizona_output_anc_src); | 811 | EXPORT_SYMBOL_GPL(arizona_output_anc_src); |
812 | 812 | ||
813 | const struct snd_kcontrol_new arizona_voice_trigger_switch[] = { | ||
814 | SOC_DAPM_SINGLE("Switch", SND_SOC_NOPM, 0, 1, 0), | ||
815 | SOC_DAPM_SINGLE("Switch", SND_SOC_NOPM, 1, 1, 0), | ||
816 | SOC_DAPM_SINGLE("Switch", SND_SOC_NOPM, 2, 1, 0), | ||
817 | SOC_DAPM_SINGLE("Switch", SND_SOC_NOPM, 3, 1, 0), | ||
818 | }; | ||
819 | EXPORT_SYMBOL_GPL(arizona_voice_trigger_switch); | ||
820 | |||
813 | static void arizona_in_set_vu(struct snd_soc_codec *codec, int ena) | 821 | static void arizona_in_set_vu(struct snd_soc_codec *codec, int ena) |
814 | { | 822 | { |
815 | struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec); | 823 | struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec); |
diff --git a/sound/soc/codecs/arizona.h b/sound/soc/codecs/arizona.h index ce0531b8c632..02d836cb5fb1 100644 --- a/sound/soc/codecs/arizona.h +++ b/sound/soc/codecs/arizona.h | |||
@@ -248,6 +248,8 @@ extern const struct soc_enum arizona_anc_input_src[]; | |||
248 | extern const struct soc_enum arizona_anc_ng_enum; | 248 | extern const struct soc_enum arizona_anc_ng_enum; |
249 | extern const struct soc_enum arizona_output_anc_src[]; | 249 | extern const struct soc_enum arizona_output_anc_src[]; |
250 | 250 | ||
251 | extern const struct snd_kcontrol_new arizona_voice_trigger_switch[]; | ||
252 | |||
251 | extern int arizona_in_ev(struct snd_soc_dapm_widget *w, | 253 | extern int arizona_in_ev(struct snd_soc_dapm_widget *w, |
252 | struct snd_kcontrol *kcontrol, | 254 | struct snd_kcontrol *kcontrol, |
253 | int event); | 255 | int event); |
diff --git a/sound/soc/codecs/cs47l24.c b/sound/soc/codecs/cs47l24.c index 23a14be1e6a6..af681f8792bb 100644 --- a/sound/soc/codecs/cs47l24.c +++ b/sound/soc/codecs/cs47l24.c | |||
@@ -359,6 +359,11 @@ SND_SOC_DAPM_INPUT("IN2R"), | |||
359 | SND_SOC_DAPM_OUTPUT("DRC1 Signal Activity"), | 359 | SND_SOC_DAPM_OUTPUT("DRC1 Signal Activity"), |
360 | SND_SOC_DAPM_OUTPUT("DRC2 Signal Activity"), | 360 | SND_SOC_DAPM_OUTPUT("DRC2 Signal Activity"), |
361 | 361 | ||
362 | SND_SOC_DAPM_OUTPUT("DSP Voice Trigger"), | ||
363 | |||
364 | SND_SOC_DAPM_SWITCH("DSP3 Voice Trigger", SND_SOC_NOPM, 2, 0, | ||
365 | &arizona_voice_trigger_switch[2]), | ||
366 | |||
362 | SND_SOC_DAPM_PGA_E("IN1L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1L_ENA_SHIFT, | 367 | SND_SOC_DAPM_PGA_E("IN1L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1L_ENA_SHIFT, |
363 | 0, NULL, 0, arizona_in_ev, | 368 | 0, NULL, 0, arizona_in_ev, |
364 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | | 369 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
@@ -905,6 +910,10 @@ static const struct snd_soc_dapm_route cs47l24_dapm_routes[] = { | |||
905 | { "DRC1 Signal Activity", NULL, "DRC1R" }, | 910 | { "DRC1 Signal Activity", NULL, "DRC1R" }, |
906 | { "DRC2 Signal Activity", NULL, "DRC2L" }, | 911 | { "DRC2 Signal Activity", NULL, "DRC2L" }, |
907 | { "DRC2 Signal Activity", NULL, "DRC2R" }, | 912 | { "DRC2 Signal Activity", NULL, "DRC2R" }, |
913 | |||
914 | { "DSP Voice Trigger", NULL, "SYSCLK" }, | ||
915 | { "DSP Voice Trigger", NULL, "DSP3 Voice Trigger" }, | ||
916 | { "DSP3 Voice Trigger", "Switch", "DSP3" }, | ||
908 | }; | 917 | }; |
909 | 918 | ||
910 | static int cs47l24_set_fll(struct snd_soc_codec *codec, int fll_id, int source, | 919 | static int cs47l24_set_fll(struct snd_soc_codec *codec, int fll_id, int source, |
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index c2a9edcc120b..1638b09455be 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c | |||
@@ -1104,6 +1104,11 @@ SND_SOC_DAPM_INPUT("IN4R"), | |||
1104 | SND_SOC_DAPM_OUTPUT("DRC1 Signal Activity"), | 1104 | SND_SOC_DAPM_OUTPUT("DRC1 Signal Activity"), |
1105 | SND_SOC_DAPM_OUTPUT("DRC2 Signal Activity"), | 1105 | SND_SOC_DAPM_OUTPUT("DRC2 Signal Activity"), |
1106 | 1106 | ||
1107 | SND_SOC_DAPM_OUTPUT("DSP Voice Trigger"), | ||
1108 | |||
1109 | SND_SOC_DAPM_SWITCH("DSP3 Voice Trigger", SND_SOC_NOPM, 2, 0, | ||
1110 | &arizona_voice_trigger_switch[2]), | ||
1111 | |||
1107 | SND_SOC_DAPM_PGA_E("IN1L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1L_ENA_SHIFT, | 1112 | SND_SOC_DAPM_PGA_E("IN1L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1L_ENA_SHIFT, |
1108 | 0, NULL, 0, wm5110_in_ev, | 1113 | 0, NULL, 0, wm5110_in_ev, |
1109 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | | 1114 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
@@ -2003,6 +2008,10 @@ static const struct snd_soc_dapm_route wm5110_dapm_routes[] = { | |||
2003 | { "DRC1 Signal Activity", NULL, "DRC1R" }, | 2008 | { "DRC1 Signal Activity", NULL, "DRC1R" }, |
2004 | { "DRC2 Signal Activity", NULL, "DRC2L" }, | 2009 | { "DRC2 Signal Activity", NULL, "DRC2L" }, |
2005 | { "DRC2 Signal Activity", NULL, "DRC2R" }, | 2010 | { "DRC2 Signal Activity", NULL, "DRC2R" }, |
2011 | |||
2012 | { "DSP Voice Trigger", NULL, "SYSCLK" }, | ||
2013 | { "DSP Voice Trigger", NULL, "DSP3 Voice Trigger" }, | ||
2014 | { "DSP3 Voice Trigger", "Switch", "DSP3" }, | ||
2006 | }; | 2015 | }; |
2007 | 2016 | ||
2008 | static int wm5110_set_fll(struct snd_soc_codec *codec, int fll_id, int source, | 2017 | static int wm5110_set_fll(struct snd_soc_codec *codec, int fll_id, int source, |