aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2014-01-08 12:42:19 -0500
committerMark Brown <broonie@linaro.org>2014-01-08 13:17:37 -0500
commit12db5edd6986a8358b92eb3fa6f8d2ee4fe1173b (patch)
tree4bb14b7b173fedf878612a8833e26e61b699e991 /sound
parentd8a64d6ade6a27dec2b8b37e4d9630c40a373bba (diff)
ASoC: wm_adsp: Start DSP booting earlier in the DAPM process
Move the start of booting the DSP to earlier in the DAPM process, and move the final starting of the DSP to later in the DAPM process. This allows us to overlap some of the processing with other components of the system being brought up. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/arizona.h17
-rw-r--r--sound/soc/codecs/wm_adsp.c24
-rw-r--r--sound/soc/codecs/wm_adsp.h10
3 files changed, 38 insertions, 13 deletions
diff --git a/sound/soc/codecs/arizona.h b/sound/soc/codecs/arizona.h
index 9e81b6392692..256548a5230e 100644
--- a/sound/soc/codecs/arizona.h
+++ b/sound/soc/codecs/arizona.h
@@ -166,20 +166,21 @@ extern int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS];
166 ARIZONA_MIXER_INPUT_ROUTES(name " Input 4") 166 ARIZONA_MIXER_INPUT_ROUTES(name " Input 4")
167 167
168#define ARIZONA_DSP_ROUTES(name) \ 168#define ARIZONA_DSP_ROUTES(name) \
169 { name, NULL, name " Aux 1" }, \ 169 { name, NULL, name " Preloader"}, \
170 { name, NULL, name " Aux 2" }, \ 170 { name " Preloader", NULL, name " Aux 1" }, \
171 { name, NULL, name " Aux 3" }, \ 171 { name " Preloader", NULL, name " Aux 2" }, \
172 { name, NULL, name " Aux 4" }, \ 172 { name " Preloader", NULL, name " Aux 3" }, \
173 { name, NULL, name " Aux 5" }, \ 173 { name " Preloader", NULL, name " Aux 4" }, \
174 { name, NULL, name " Aux 6" }, \ 174 { name " Preloader", NULL, name " Aux 5" }, \
175 { name " Preloader", NULL, name " Aux 6" }, \
175 ARIZONA_MIXER_INPUT_ROUTES(name " Aux 1"), \ 176 ARIZONA_MIXER_INPUT_ROUTES(name " Aux 1"), \
176 ARIZONA_MIXER_INPUT_ROUTES(name " Aux 2"), \ 177 ARIZONA_MIXER_INPUT_ROUTES(name " Aux 2"), \
177 ARIZONA_MIXER_INPUT_ROUTES(name " Aux 3"), \ 178 ARIZONA_MIXER_INPUT_ROUTES(name " Aux 3"), \
178 ARIZONA_MIXER_INPUT_ROUTES(name " Aux 4"), \ 179 ARIZONA_MIXER_INPUT_ROUTES(name " Aux 4"), \
179 ARIZONA_MIXER_INPUT_ROUTES(name " Aux 5"), \ 180 ARIZONA_MIXER_INPUT_ROUTES(name " Aux 5"), \
180 ARIZONA_MIXER_INPUT_ROUTES(name " Aux 6"), \ 181 ARIZONA_MIXER_INPUT_ROUTES(name " Aux 6"), \
181 ARIZONA_MIXER_ROUTES(name, name "L"), \ 182 ARIZONA_MIXER_ROUTES(name " Preloader", name "L"), \
182 ARIZONA_MIXER_ROUTES(name, name "R") 183 ARIZONA_MIXER_ROUTES(name " Preloader", name "R")
183 184
184#define ARIZONA_RATE_ENUM_SIZE 4 185#define ARIZONA_RATE_ENUM_SIZE 4
185extern const char *arizona_rate_text[ARIZONA_RATE_ENUM_SIZE]; 186extern const char *arizona_rate_text[ARIZONA_RATE_ENUM_SIZE];
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 2087ae2eb323..a061183add67 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -1591,6 +1591,27 @@ err:
1591 ADSP2_SYS_ENA | ADSP2_CORE_ENA | ADSP2_START, 0); 1591 ADSP2_SYS_ENA | ADSP2_CORE_ENA | ADSP2_START, 0);
1592} 1592}
1593 1593
1594int wm_adsp2_early_event(struct snd_soc_dapm_widget *w,
1595 struct snd_kcontrol *kcontrol, int event)
1596{
1597 struct snd_soc_codec *codec = w->codec;
1598 struct wm_adsp *dsps = snd_soc_codec_get_drvdata(codec);
1599 struct wm_adsp *dsp = &dsps[w->shift];
1600
1601 dsp->card = codec->card;
1602
1603 switch (event) {
1604 case SND_SOC_DAPM_PRE_PMU:
1605 queue_work(system_unbound_wq, &dsp->boot_work);
1606 break;
1607 default:
1608 break;
1609 };
1610
1611 return 0;
1612}
1613EXPORT_SYMBOL_GPL(wm_adsp2_early_event);
1614
1594int wm_adsp2_event(struct snd_soc_dapm_widget *w, 1615int wm_adsp2_event(struct snd_soc_dapm_widget *w,
1595 struct snd_kcontrol *kcontrol, int event) 1616 struct snd_kcontrol *kcontrol, int event)
1596{ 1617{
@@ -1601,11 +1622,8 @@ int wm_adsp2_event(struct snd_soc_dapm_widget *w,
1601 struct wm_coeff_ctl *ctl; 1622 struct wm_coeff_ctl *ctl;
1602 int ret; 1623 int ret;
1603 1624
1604 dsp->card = codec->card;
1605
1606 switch (event) { 1625 switch (event) {
1607 case SND_SOC_DAPM_POST_PMU: 1626 case SND_SOC_DAPM_POST_PMU:
1608 queue_work(system_unbound_wq, &dsp->boot_work);
1609 flush_work(&dsp->boot_work); 1627 flush_work(&dsp->boot_work);
1610 1628
1611 if (!dsp->running) 1629 if (!dsp->running)
diff --git a/sound/soc/codecs/wm_adsp.h b/sound/soc/codecs/wm_adsp.h
index b172c1df9159..a4f6b64deb61 100644
--- a/sound/soc/codecs/wm_adsp.h
+++ b/sound/soc/codecs/wm_adsp.h
@@ -68,8 +68,12 @@ struct wm_adsp {
68 wm_adsp1_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD) 68 wm_adsp1_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD)
69 69
70#define WM_ADSP2(wname, num) \ 70#define WM_ADSP2(wname, num) \
71 SND_SOC_DAPM_PGA_E(wname, SND_SOC_NOPM, num, 0, NULL, 0, \ 71{ .id = snd_soc_dapm_dai_link, .name = wname " Preloader", \
72 wm_adsp2_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD) 72 .reg = SND_SOC_NOPM, .shift = num, .event = wm_adsp2_early_event, \
73 .event_flags = SND_SOC_DAPM_PRE_PMU }, \
74{ .id = snd_soc_dapm_out_drv, .name = wname, \
75 .reg = SND_SOC_NOPM, .shift = num, .event = wm_adsp2_event, \
76 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD }
73 77
74extern const struct snd_kcontrol_new wm_adsp1_fw_controls[]; 78extern const struct snd_kcontrol_new wm_adsp1_fw_controls[];
75extern const struct snd_kcontrol_new wm_adsp2_fw_controls[]; 79extern const struct snd_kcontrol_new wm_adsp2_fw_controls[];
@@ -78,6 +82,8 @@ int wm_adsp1_init(struct wm_adsp *adsp);
78int wm_adsp2_init(struct wm_adsp *adsp, bool dvfs); 82int wm_adsp2_init(struct wm_adsp *adsp, bool dvfs);
79int wm_adsp1_event(struct snd_soc_dapm_widget *w, 83int wm_adsp1_event(struct snd_soc_dapm_widget *w,
80 struct snd_kcontrol *kcontrol, int event); 84 struct snd_kcontrol *kcontrol, int event);
85int wm_adsp2_early_event(struct snd_soc_dapm_widget *w,
86 struct snd_kcontrol *kcontrol, int event);
81int wm_adsp2_event(struct snd_soc_dapm_widget *w, 87int wm_adsp2_event(struct snd_soc_dapm_widget *w,
82 struct snd_kcontrol *kcontrol, int event); 88 struct snd_kcontrol *kcontrol, int event);
83 89