aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-03-01 09:48:16 -0500
committerMark Brown <broonie@linaro.org>2014-03-02 21:01:48 -0500
commit1bdd301f791e047ed36c18656890c0001f8ce5a3 (patch)
treeb6777eb7fc46069c9e7cd578e133b1a7837579e1
parent98308c825ba856796bf52b3c6d6955e62f1fc45c (diff)
ASoC: pxa: e800_wm9712: Convert to table based DAPM setup
Use table based setup to register the DAPM widgets and routes. This on one hand makes the code a bit cleaner and on the other hand the board level DAPM elements get registered in the card's DAPM context rather than in the CODEC's DAPM context. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--sound/soc/pxa/e800_wm9712.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/sound/soc/pxa/e800_wm9712.c b/sound/soc/pxa/e800_wm9712.c
index 3137f800b43f..24c2078ce70b 100644
--- a/sound/soc/pxa/e800_wm9712.c
+++ b/sound/soc/pxa/e800_wm9712.c
@@ -71,19 +71,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
71 {"MIC2", NULL, "Mic (Internal2)"}, 71 {"MIC2", NULL, "Mic (Internal2)"},
72}; 72};
73 73
74static int e800_ac97_init(struct snd_soc_pcm_runtime *rtd)
75{
76 struct snd_soc_codec *codec = rtd->codec;
77 struct snd_soc_dapm_context *dapm = &codec->dapm;
78
79 snd_soc_dapm_new_controls(dapm, e800_dapm_widgets,
80 ARRAY_SIZE(e800_dapm_widgets));
81
82 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
83
84 return 0;
85}
86
87static struct snd_soc_dai_link e800_dai[] = { 74static struct snd_soc_dai_link e800_dai[] = {
88 { 75 {
89 .name = "AC97", 76 .name = "AC97",
@@ -92,7 +79,6 @@ static struct snd_soc_dai_link e800_dai[] = {
92 .codec_dai_name = "wm9712-hifi", 79 .codec_dai_name = "wm9712-hifi",
93 .platform_name = "pxa-pcm-audio", 80 .platform_name = "pxa-pcm-audio",
94 .codec_name = "wm9712-codec", 81 .codec_name = "wm9712-codec",
95 .init = e800_ac97_init,
96 }, 82 },
97 { 83 {
98 .name = "AC97 Aux", 84 .name = "AC97 Aux",
@@ -109,6 +95,11 @@ static struct snd_soc_card e800 = {
109 .owner = THIS_MODULE, 95 .owner = THIS_MODULE,
110 .dai_link = e800_dai, 96 .dai_link = e800_dai,
111 .num_links = ARRAY_SIZE(e800_dai), 97 .num_links = ARRAY_SIZE(e800_dai),
98
99 .dapm_widgets = e800_dapm_widgets,
100 .num_dapm_widgets = ARRAY_SIZE(e800_dapm_widgets),
101 .dapm_routes = audio_map,
102 .num_dapm_routes = ARRAY_SIZE(audio_map),
112}; 103};
113 104
114static struct gpio e800_audio_gpios[] = { 105static struct gpio e800_audio_gpios[] = {