ASoC: multi-component - ASoC Multi-Component Support
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / sound / soc / omap / overo.c
index c25f5276ad6f0135d1699548da4d3d6ad11b56f5..e95a607937de7a221998766dc0a2214e04b251f9 100644 (file)
 
 #include "omap-mcbsp.h"
 #include "omap-pcm.h"
-#include "../codecs/twl4030.h"
 
 static int overo_hw_params(struct snd_pcm_substream *substream,
        struct snd_pcm_hw_params *params)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
-       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+       struct snd_soc_dai *codec_dai = rtd->codec_dai;
+       struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
        int ret;
 
        /* Set codec DAI configuration */
@@ -82,25 +81,20 @@ static struct snd_soc_ops overo_ops = {
 static struct snd_soc_dai_link overo_dai = {
        .name = "TWL4030",
        .stream_name = "TWL4030",
-       .cpu_dai = &omap_mcbsp_dai[0],
-       .codec_dai = &twl4030_dai[TWL4030_DAI_HIFI],
+       .cpu_dai_name = "omap-mcbsp-dai.1",
+       .codec_dai_name = "twl4030-hifi",
+       .platform_name = "omap-pcm-audio",
+       .codec_name = "twl4030-codec",
        .ops = &overo_ops,
 };
 
 /* Audio machine driver */
 static struct snd_soc_card snd_soc_card_overo = {
        .name = "overo",
-       .platform = &omap_soc_platform,
        .dai_link = &overo_dai,
        .num_links = 1,
 };
 
-/* Audio subsystem */
-static struct snd_soc_device overo_snd_devdata = {
-       .card = &snd_soc_card_overo,
-       .codec_dev = &soc_codec_dev_twl4030,
-};
-
 static struct platform_device *overo_snd_device;
 
 static int __init overo_soc_init(void)
@@ -119,9 +113,7 @@ static int __init overo_soc_init(void)
                return -ENOMEM;
        }
 
-       platform_set_drvdata(overo_snd_device, &overo_snd_devdata);
-       overo_snd_devdata.dev = &overo_snd_device->dev;
-       *(unsigned int *)overo_dai.cpu_dai->private_data = 1; /* McBSP2 */
+       platform_set_drvdata(overo_snd_device, &snd_soc_card_overo);
 
        ret = platform_device_add(overo_snd_device);
        if (ret)