aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2011-10-10 08:34:10 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-10-10 11:18:11 -0400
commit8966c2dd51909e6e3dcea099df9c501904085818 (patch)
tree2fbbd36e5b430006dee08b83eac8cb12e1fdd7f0 /sound
parentd2266025ea26b6f3f8f93da6fad129541c82bd7c (diff)
ASoC: n810: Let the core to register DAPM widgets/routes and controls
Pass the DAPM widgets/routes and static controls via the snd_soc_card struct to core. In this way the machine driver does not need to handle the DAPM widgets/routes. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Jarkko Nikula <jarkko.nikula@bitmer.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/omap/n810.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index 4fa881bc00e5..7e3c20c965c6 100644
--- a/sound/soc/omap/n810.c
+++ b/sound/soc/omap/n810.c
@@ -257,7 +257,6 @@ static int n810_aic33_init(struct snd_soc_pcm_runtime *rtd)
257{ 257{
258 struct snd_soc_codec *codec = rtd->codec; 258 struct snd_soc_codec *codec = rtd->codec;
259 struct snd_soc_dapm_context *dapm = &codec->dapm; 259 struct snd_soc_dapm_context *dapm = &codec->dapm;
260 int err;
261 260
262 /* Not connected */ 261 /* Not connected */
263 snd_soc_dapm_nc_pin(dapm, "MONO_LOUT"); 262 snd_soc_dapm_nc_pin(dapm, "MONO_LOUT");
@@ -269,18 +268,7 @@ static int n810_aic33_init(struct snd_soc_pcm_runtime *rtd)
269 snd_soc_dapm_nc_pin(dapm, "LINE2L"); 268 snd_soc_dapm_nc_pin(dapm, "LINE2L");
270 snd_soc_dapm_nc_pin(dapm, "LINE2R"); 269 snd_soc_dapm_nc_pin(dapm, "LINE2R");
271 270
272 /* Add N810 specific controls */ 271 return 0;
273 err = snd_soc_add_controls(codec, aic33_n810_controls,
274 ARRAY_SIZE(aic33_n810_controls));
275 if (err < 0)
276 return err;
277
278 /* Add N810 specific widgets */
279 snd_soc_dapm_new_controls(dapm, aic33_dapm_widgets,
280 ARRAY_SIZE(aic33_dapm_widgets));
281
282 /* Set up N810 specific audio path audio_map */
283 return snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
284} 272}
285 273
286/* Digital audio interface glue - connects codec <--> CPU */ 274/* Digital audio interface glue - connects codec <--> CPU */
@@ -302,6 +290,13 @@ static struct snd_soc_card snd_soc_n810 = {
302 .name = "N810", 290 .name = "N810",
303 .dai_link = &n810_dai, 291 .dai_link = &n810_dai,
304 .num_links = 1, 292 .num_links = 1,
293
294 .controls = aic33_n810_controls,
295 .num_controls = ARRAY_SIZE(aic33_n810_controls),
296 .dapm_widgets = aic33_dapm_widgets,
297 .num_dapm_widgets = ARRAY_SIZE(aic33_dapm_widgets),
298 .dapm_routes = audio_map,
299 .num_dapm_routes = ARRAY_SIZE(audio_map),
305}; 300};
306 301
307static struct platform_device *n810_snd_device; 302static struct platform_device *n810_snd_device;