aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/omap-abe-twl6040.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-04-24 05:36:25 -0400
committerLiam Girdwood <lrg@ti.com>2012-05-22 12:33:19 -0400
commitc2f98956e3635a897737cc08a60539752aa00dd7 (patch)
tree2e248923afddf6c2ac8f8534a53fb2f6ad41c112 /sound/soc/omap/omap-abe-twl6040.c
parent2ec1be372139328b1aa3203eb1fd61d613b2d7fb (diff)
ASoC: omap-abe-twl6040: Keep only one snd_soc_dai_link structure
There is no need to have two snd_soc_dai_link structure for the two setup the machine driver supports. We can just tell core to register only the first link if the DMIC link is not in use on the device. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/omap/omap-abe-twl6040.c')
-rw-r--r--sound/soc/omap/omap-abe-twl6040.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
index 93bb8eee22b3..31ab6fee8943 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -235,7 +235,7 @@ static int omap_abe_dmic_init(struct snd_soc_pcm_runtime *rtd)
235} 235}
236 236
237/* Digital audio interface glue - connects codec <--> CPU */ 237/* Digital audio interface glue - connects codec <--> CPU */
238static struct snd_soc_dai_link twl6040_dmic_dai[] = { 238static struct snd_soc_dai_link abe_twl6040_dai_links[] = {
239 { 239 {
240 .name = "TWL6040", 240 .name = "TWL6040",
241 .stream_name = "TWL6040", 241 .stream_name = "TWL6040",
@@ -258,19 +258,6 @@ static struct snd_soc_dai_link twl6040_dmic_dai[] = {
258 }, 258 },
259}; 259};
260 260
261static struct snd_soc_dai_link twl6040_only_dai[] = {
262 {
263 .name = "TWL6040",
264 .stream_name = "TWL6040",
265 .cpu_dai_name = "omap-mcpdm",
266 .codec_dai_name = "twl6040-legacy",
267 .platform_name = "omap-pcm-audio",
268 .codec_name = "twl6040-codec",
269 .init = omap_abe_twl6040_init,
270 .ops = &omap_abe_ops,
271 },
272};
273
274/* Audio machine driver */ 261/* Audio machine driver */
275static struct snd_soc_card omap_abe_card = { 262static struct snd_soc_card omap_abe_card = {
276 .owner = THIS_MODULE, 263 .owner = THIS_MODULE,
@@ -285,6 +272,7 @@ static __devinit int omap_abe_probe(struct platform_device *pdev)
285{ 272{
286 struct omap_abe_twl6040_data *pdata = dev_get_platdata(&pdev->dev); 273 struct omap_abe_twl6040_data *pdata = dev_get_platdata(&pdev->dev);
287 struct snd_soc_card *card = &omap_abe_card; 274 struct snd_soc_card *card = &omap_abe_card;
275 int num_links = 0;
288 int ret; 276 int ret;
289 277
290 card->dev = &pdev->dev; 278 card->dev = &pdev->dev;
@@ -306,13 +294,13 @@ static __devinit int omap_abe_probe(struct platform_device *pdev)
306 return -ENODEV; 294 return -ENODEV;
307 } 295 }
308 296
309 if (pdata->has_dmic) { 297 if (pdata->has_dmic)
310 card->dai_link = twl6040_dmic_dai; 298 num_links = 2;
311 card->num_links = ARRAY_SIZE(twl6040_dmic_dai); 299 else
312 } else { 300 num_links = 1;
313 card->dai_link = twl6040_only_dai; 301
314 card->num_links = ARRAY_SIZE(twl6040_only_dai); 302 card->dai_link = abe_twl6040_dai_links;
315 } 303 card->num_links = num_links;
316 304
317 ret = snd_soc_register_card(card); 305 ret = snd_soc_register_card(card);
318 if (ret) 306 if (ret)