diff options
author | Richard Fitzgerald <rf@opensource.wolfsonmicro.com> | 2015-06-11 10:32:30 (GMT) |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-06-11 10:39:39 (GMT) |
commit | f5e2ce92bd96df99de1ef33fad05e3b3b2d34e54 (patch) | |
tree | f6875032600a2adee9ed607be4f9bf9922994f74 /sound/soc/codecs/wm5110.c | |
parent | 69a6582eeb17dc083b2510f1ca2eaa54ff679b49 (diff) | |
download | linux-f5e2ce92bd96df99de1ef33fad05e3b3b2d34e54.tar.xz |
ASoC: wm_adsp: Add codec_probe and codec_remove stubs
Currently the only init function in wm_adsp is called by the
codec driver early in its probe before the codec has been
registered with SOC.
This patch adds stubs for the codec_probe and codec_remove stages
and calls them from WM5102 and WM5110 codec drivers. This allows us
to hang anything that needs setup during the codec probe stage off
these functions without further modification of the codec drivers.
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/wm5110.c')
-rw-r--r-- | sound/soc/codecs/wm5110.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index d65364e..6e15d9c 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c @@ -1599,7 +1599,7 @@ static struct snd_soc_dai_driver wm5110_dai[] = { static int wm5110_codec_probe(struct snd_soc_codec *codec) { struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec); - int ret; + int i, ret; priv->core.arizona->dapm = &codec->dapm; @@ -1607,6 +1607,12 @@ static int wm5110_codec_probe(struct snd_soc_codec *codec) arizona_init_gpio(codec); arizona_init_mono(codec); + for (i = 0; i < WM5110_NUM_ADSP; ++i) { + ret = wm_adsp2_codec_probe(&priv->core.adsp[i], codec); + if (ret) + return ret; + } + ret = snd_soc_add_codec_controls(codec, wm_adsp2_fw_controls, 8); if (ret != 0) return ret; @@ -1621,6 +1627,10 @@ static int wm5110_codec_probe(struct snd_soc_codec *codec) static int wm5110_codec_remove(struct snd_soc_codec *codec) { struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec); + int i; + + for (i = 0; i < WM5110_NUM_ADSP; ++i) + wm_adsp2_codec_remove(&priv->core.adsp[i], codec); priv->core.arizona->dapm = NULL; |