Merge remote-tracking branch 'asoc/topic/component' into asoc-next
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 12 Apr 2013 12:56:56 +0000 (13:56 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 12 Apr 2013 12:56:56 +0000 (13:56 +0100)
59 files changed:
include/sound/soc-dai.h
include/sound/soc.h
sound/soc/atmel/atmel_ssc_dai.c
sound/soc/au1x/ac97c.c
sound/soc/au1x/i2sc.c
sound/soc/au1x/psc-ac97.c
sound/soc/au1x/psc-i2s.c
sound/soc/blackfin/bf5xx-ac97.c
sound/soc/blackfin/bf5xx-i2s.c
sound/soc/blackfin/bf5xx-tdm.c
sound/soc/blackfin/bf6xx-i2s.c
sound/soc/cirrus/ep93xx-ac97.c
sound/soc/cirrus/ep93xx-i2s.c
sound/soc/davinci/davinci-i2s.c
sound/soc/davinci/davinci-mcasp.c
sound/soc/davinci/davinci-vcif.c
sound/soc/dwc/designware_i2s.c
sound/soc/fsl/fsl_ssi.c
sound/soc/fsl/imx-ssi.c
sound/soc/fsl/mpc5200_psc_ac97.c
sound/soc/fsl/mpc5200_psc_i2s.c
sound/soc/jz4740/jz4740-i2s.c
sound/soc/kirkwood/kirkwood-i2s.c
sound/soc/mid-x86/sst_platform.c
sound/soc/mxs/mxs-saif.c
sound/soc/nuc900/nuc900-ac97.c
sound/soc/omap/omap-dmic.c
sound/soc/omap/omap-hdmi.c
sound/soc/omap/omap-mcbsp.c
sound/soc/omap/omap-mcpdm.c
sound/soc/pxa/mmp-sspa.c
sound/soc/pxa/pxa-ssp.c
sound/soc/pxa/pxa2xx-ac97.c
sound/soc/pxa/pxa2xx-i2s.c
sound/soc/s6000/s6000-i2s.c
sound/soc/samsung/ac97.c
sound/soc/samsung/goni_wm8994.c
sound/soc/samsung/i2s.c
sound/soc/samsung/pcm.c
sound/soc/samsung/s3c-i2s-v2.c
sound/soc/samsung/s3c-i2s-v2.h
sound/soc/samsung/s3c2412-i2s.c
sound/soc/samsung/s3c24xx-i2s.c
sound/soc/samsung/spdif.c
sound/soc/sh/fsi.c
sound/soc/sh/hac.c
sound/soc/sh/migor.c
sound/soc/sh/siu_dai.c
sound/soc/sh/ssi.c
sound/soc/soc-core.c
sound/soc/spear/spdif_in.c
sound/soc/spear/spdif_out.c
sound/soc/tegra/tegra20_ac97.c
sound/soc/tegra/tegra20_i2s.c
sound/soc/tegra/tegra20_spdif.c
sound/soc/tegra/tegra30_i2s.c
sound/soc/tegra/tegra_wm9712.c
sound/soc/txx9/txx9aclc-ac97.c
sound/soc/ux500/ux500_msp_dai.c

index 3d84808952b9146ad9e6b479ddb44eb228fa3f2f..ae9a227d35d3538c233b2b1cb777afcbcb4e639d 100644 (file)
@@ -95,14 +95,6 @@ struct snd_soc_dai_driver;
 struct snd_soc_dai;
 struct snd_ac97_bus_ops;
 
-/* Digital Audio Interface registration */
-int snd_soc_register_dai(struct device *dev,
-               struct snd_soc_dai_driver *dai_drv);
-void snd_soc_unregister_dai(struct device *dev);
-int snd_soc_register_dais(struct device *dev,
-               struct snd_soc_dai_driver *dai_drv, size_t count);
-void snd_soc_unregister_dais(struct device *dev, size_t count);
-
 /* Digital Audio Interface clocking API.*/
 int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
        unsigned int freq, int dir);
index a6a059ca387471083de2dc2e21e1584f6796925f..44c9cbdc9fa24b8ea54195d45447a30427273720 100644 (file)
@@ -324,6 +324,8 @@ struct snd_soc_dai_link;
 struct snd_soc_platform_driver;
 struct snd_soc_codec;
 struct snd_soc_codec_driver;
+struct snd_soc_component;
+struct snd_soc_component_driver;
 struct soc_enum;
 struct snd_soc_jack;
 struct snd_soc_jack_zone;
@@ -377,6 +379,10 @@ int snd_soc_register_codec(struct device *dev,
                const struct snd_soc_codec_driver *codec_drv,
                struct snd_soc_dai_driver *dai_drv, int num_dai);
 void snd_soc_unregister_codec(struct device *dev);
+int snd_soc_register_component(struct device *dev,
+                        const struct snd_soc_component_driver *cmpnt_drv,
+                        struct snd_soc_dai_driver *dai_drv, int num_dai);
+void snd_soc_unregister_component(struct device *dev);
 int snd_soc_codec_volatile_register(struct snd_soc_codec *codec,
                                    unsigned int reg);
 int snd_soc_codec_readable_register(struct snd_soc_codec *codec,
@@ -841,6 +847,20 @@ struct snd_soc_platform {
 #endif
 };
 
+struct snd_soc_component_driver {
+       const char *name;
+};
+
+struct snd_soc_component {
+       const char *name;
+       int id;
+       int num_dai;
+       struct device *dev;
+       struct list_head list;
+
+       const struct snd_soc_component_driver *driver;
+};
+
 struct snd_soc_dai_link {
        /* config - must be set by machine driver */
        const char *name;                       /* Codec name */
index 94da62345a276bd2e8e482b73dd7ee4ee027088a..f3fdfa07fcb9fafa76d913b64be070b54d31486e 100644 (file)
@@ -750,13 +750,18 @@ static struct snd_soc_dai_driver atmel_ssc_dai = {
                .ops = &atmel_ssc_dai_ops,
 };
 
+static const struct snd_soc_component_driver atmel_ssc_component = {
+       .name           = "atmel-ssc",
+};
+
 static int asoc_ssc_init(struct device *dev)
 {
        struct platform_device *pdev = to_platform_device(dev);
        struct ssc_device *ssc = platform_get_drvdata(pdev);
        int ret;
 
-       ret = snd_soc_register_dai(dev, &atmel_ssc_dai);
+       ret = snd_soc_register_component(dev, &atmel_ssc_component,
+                                        &atmel_ssc_dai, 1);
        if (ret) {
                dev_err(dev, "Could not register DAI: %d\n", ret);
                goto err;
@@ -775,7 +780,7 @@ static int asoc_ssc_init(struct device *dev)
        return 0;
 
 err_unregister_dai:
-       snd_soc_unregister_dai(dev);
+       snd_soc_unregister_component(dev);
 err:
        return ret;
 }
@@ -790,7 +795,7 @@ static void asoc_ssc_exit(struct device *dev)
        else
                atmel_pcm_pdc_platform_unregister(dev);
 
-       snd_soc_unregister_dai(dev);
+       snd_soc_unregister_component(dev);
 }
 
 /**
index ea7d9d157022a59be25323d071e3993bc0b98799..44b8dcecf57179c16dbb695da2e0cad1ebfa8937 100644 (file)
@@ -223,6 +223,10 @@ static struct snd_soc_dai_driver au1xac97c_dai_driver = {
        .ops                    = &alchemy_ac97c_ops,
 };
 
+static const struct snd_soc_component_driver au1xac97c_component = {
+       .name           = "au1xac97c",
+};
+
 static int au1xac97c_drvprobe(struct platform_device *pdev)
 {
        int ret;
@@ -268,7 +272,8 @@ static int au1xac97c_drvprobe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, ctx);
 
-       ret = snd_soc_register_dai(&pdev->dev, &au1xac97c_dai_driver);
+       ret = snd_soc_register_component(&pdev->dev, &au1xac97c_component,
+                                        &au1xac97c_dai_driver, 1);
        if (ret)
                return ret;
 
@@ -280,7 +285,7 @@ static int au1xac97c_drvremove(struct platform_device *pdev)
 {
        struct au1xpsc_audio_data *ctx = platform_get_drvdata(pdev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        WR(ctx, AC97_ENABLE, EN_D);     /* clock off, disable */
 
index 072448afc21993a1e772cb71c078ce2fc07dd735..b3f37f6edbcb0842fdbba6986325f48c742fc10c 100644 (file)
@@ -225,6 +225,10 @@ static struct snd_soc_dai_driver au1xi2s_dai_driver = {
        .ops = &au1xi2s_dai_ops,
 };
 
+static const struct snd_soc_component_driver au1xi2s_component = {
+       .name           = "au1xi2s",
+};
+
 static int au1xi2s_drvprobe(struct platform_device *pdev)
 {
        struct resource *iores, *dmares;
@@ -260,14 +264,15 @@ static int au1xi2s_drvprobe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, ctx);
 
-       return snd_soc_register_dai(&pdev->dev, &au1xi2s_dai_driver);
+       return snd_soc_register_component(&pdev->dev, &au1xi2s_component,
+                                         &au1xi2s_dai_driver, 1);
 }
 
 static int au1xi2s_drvremove(struct platform_device *pdev)
 {
        struct au1xpsc_audio_data *ctx = platform_get_drvdata(pdev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        WR(ctx, I2S_ENABLE, EN_D);      /* clock off, disable */
 
index 6ba07e365967221384760d2917bc1b8850ca5895..8f1862aa733311b35552079ace7a8fa314b4c3b6 100644 (file)
@@ -361,6 +361,10 @@ static const struct snd_soc_dai_driver au1xpsc_ac97_dai_template = {
        .ops = &au1xpsc_ac97_dai_ops,
 };
 
+static const struct snd_soc_component_driver au1xpsc_ac97_component = {
+       .name           = "au1xpsc-ac97",
+};
+
 static int au1xpsc_ac97_drvprobe(struct platform_device *pdev)
 {
        int ret;
@@ -419,7 +423,8 @@ static int au1xpsc_ac97_drvprobe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, wd);
 
-       ret = snd_soc_register_dai(&pdev->dev, &wd->dai_drv);
+       ret = snd_soc_register_component(&pdev->dev, &au1xpsc_ac97_component,
+                                        &wd->dai_drv, 1);
        if (ret)
                return ret;
 
@@ -431,7 +436,7 @@ static int au1xpsc_ac97_drvremove(struct platform_device *pdev)
 {
        struct au1xpsc_audio_data *wd = platform_get_drvdata(pdev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        /* disable PSC completely */
        au_writel(0, AC97_CFG(wd));
index 360b4e50d7c836eccac7000f3216cb61d3c9d146..fe923a7bdc398006bf4a21fe1117e8e8703a6dfb 100644 (file)
@@ -288,6 +288,10 @@ static const struct snd_soc_dai_driver au1xpsc_i2s_dai_template = {
        .ops = &au1xpsc_i2s_dai_ops,
 };
 
+static const struct snd_soc_component_driver au1xpsc_i2s_component = {
+       .name           = "au1xpsc-i2s",
+};
+
 static int au1xpsc_i2s_drvprobe(struct platform_device *pdev)
 {
        struct resource *iores, *dmares;
@@ -350,14 +354,15 @@ static int au1xpsc_i2s_drvprobe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, wd);
 
-       return snd_soc_register_dai(&pdev->dev, &wd->dai_drv);
+       return snd_soc_register_component(&pdev->dev, &au1xpsc_i2s_component,
+                                         &wd->dai_drv, 1);
 }
 
 static int au1xpsc_i2s_drvremove(struct platform_device *pdev)
 {
        struct au1xpsc_audio_data *wd = platform_get_drvdata(pdev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        au_writel(0, I2S_CFG(wd));
        au_sync();
index 8e41bcb020eb5beba44505b7df5c1cfae0ee64e0..490217325975ab47f9c393fc66d01365e16410b1 100644 (file)
@@ -282,6 +282,10 @@ static struct snd_soc_dai_driver bfin_ac97_dai = {
                .formats = SNDRV_PCM_FMTBIT_S16_LE, },
 };
 
+static const struct snd_soc_component_driver bfin_ac97_component = {
+       .name           = "bfin-ac97",
+};
+
 static int asoc_bfin_ac97_probe(struct platform_device *pdev)
 {
        struct sport_device *sport_handle;
@@ -331,7 +335,8 @@ static int asoc_bfin_ac97_probe(struct platform_device *pdev)
                goto sport_config_err;
        }
 
-       ret = snd_soc_register_dai(&pdev->dev, &bfin_ac97_dai);
+       ret = snd_soc_register_component(&pdev->dev, &bfin_ac97_component,
+                                        &bfin_ac97_dai, 1);
        if (ret) {
                pr_err("Failed to register DAI: %d\n", ret);
                goto sport_config_err;
@@ -356,7 +361,7 @@ static int asoc_bfin_ac97_remove(struct platform_device *pdev)
 {
        struct sport_device *sport_handle = platform_get_drvdata(pdev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        sport_done(sport_handle);
 #ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET
        gpio_free(CONFIG_SND_BF5XX_RESET_GPIO_NUM);
index 168d88bccb41cc18f18b22e41296783e9fb17ad8..dd0c2a4f83a3a7cc0f8955a0ad955bf98ab79727 100644 (file)
@@ -245,6 +245,10 @@ static struct snd_soc_dai_driver bf5xx_i2s_dai = {
        .ops = &bf5xx_i2s_dai_ops,
 };
 
+static const struct snd_soc_component_driver bf5xx_i2s_component = {
+       .name           = "bf5xx-i2s",
+};
+
 static int bf5xx_i2s_probe(struct platform_device *pdev)
 {
        struct sport_device *sport_handle;
@@ -257,7 +261,8 @@ static int bf5xx_i2s_probe(struct platform_device *pdev)
                return -ENODEV;
 
        /* register with the ASoC layers */
-       ret = snd_soc_register_dai(&pdev->dev, &bf5xx_i2s_dai);
+       ret = snd_soc_register_component(&pdev->dev, &bf5xx_i2s_component,
+                                        &bf5xx_i2s_dai, 1);
        if (ret) {
                pr_err("Failed to register DAI: %d\n", ret);
                sport_done(sport_handle);
@@ -273,7 +278,7 @@ static int bf5xx_i2s_remove(struct platform_device *pdev)
 
        pr_debug("%s enter\n", __func__);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        sport_done(sport_handle);
 
        return 0;
index c1e516ec53ad174c2c46d0d6735f9e96d2205915..69e9a3e935bd13e008125c58100dc664e9e87009 100644 (file)
@@ -249,6 +249,10 @@ static struct snd_soc_dai_driver bf5xx_tdm_dai = {
        .ops = &bf5xx_tdm_dai_ops,
 };
 
+static const struct snd_soc_component_driver bf5xx_tdm_component = {
+       .name           = "bf5xx-tdm",
+};
+
 static int bfin_tdm_probe(struct platform_device *pdev)
 {
        struct sport_device *sport_handle;
@@ -282,7 +286,8 @@ static int bfin_tdm_probe(struct platform_device *pdev)
                goto sport_config_err;
        }
 
-       ret = snd_soc_register_dai(&pdev->dev, &bf5xx_tdm_dai);
+       ret = snd_soc_register_component(&pdev->dev, &bf5xx_tdm_component,
+                                        &bf5xx_tdm_dai, 1);
        if (ret) {
                pr_err("Failed to register DAI: %d\n", ret);
                goto sport_config_err;
@@ -299,7 +304,7 @@ static int bfin_tdm_remove(struct platform_device *pdev)
 {
        struct sport_device *sport_handle = platform_get_drvdata(pdev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        sport_done(sport_handle);
 
        return 0;
index 8f337972f438f155daffe7cec9bb5fe8405f9748..c02405cc007db2c88c14b25d17eff81b270f550b 100644 (file)
@@ -186,6 +186,10 @@ static struct snd_soc_dai_driver bfin_i2s_dai = {
        .ops = &bfin_i2s_dai_ops,
 };
 
+static const struct snd_soc_component_driver bfin_i2s_component = {
+       .name           = "bfin-i2s",
+};
+
 static int bfin_i2s_probe(struct platform_device *pdev)
 {
        struct sport_device *sport;
@@ -197,7 +201,8 @@ static int bfin_i2s_probe(struct platform_device *pdev)
                return -ENODEV;
 
        /* register with the ASoC layers */
-       ret = snd_soc_register_dai(dev, &bfin_i2s_dai);
+       ret = snd_soc_register_component(dev, &bfin_i2s_component,
+                                        &bfin_i2s_dai, 1);
        if (ret) {
                dev_err(dev, "Failed to register DAI: %d\n", ret);
                sport_delete(sport);
@@ -212,7 +217,7 @@ static int bfin_i2s_remove(struct platform_device *pdev)
 {
        struct sport_device *sport = platform_get_drvdata(pdev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        sport_delete(sport);
 
        return 0;
index 1738d28fb04f586876c6e84c59fa3c7991d95ed4..e593c1e4e1dd0534fe5aef94477d319c0d084506 100644 (file)
@@ -353,6 +353,10 @@ static struct snd_soc_dai_driver ep93xx_ac97_dai = {
        .ops                    = &ep93xx_ac97_dai_ops,
 };
 
+static const struct snd_soc_component_driver ep93xx_ac97_component = {
+       .name           = "ep93xx-ac97",
+};
+
 static int ep93xx_ac97_probe(struct platform_device *pdev)
 {
        struct ep93xx_ac97_info *info;
@@ -390,7 +394,8 @@ static int ep93xx_ac97_probe(struct platform_device *pdev)
        ep93xx_ac97_info = info;
        platform_set_drvdata(pdev, info);
 
-       ret = snd_soc_register_dai(&pdev->dev, &ep93xx_ac97_dai);
+       ret = snd_soc_register_component(&pdev->dev, &ep93xx_ac97_component,
+                                        &ep93xx_ac97_dai, 1);
        if (ret)
                goto fail;
 
@@ -407,7 +412,7 @@ static int ep93xx_ac97_remove(struct platform_device *pdev)
 {
        struct ep93xx_ac97_info *info = platform_get_drvdata(pdev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        /* disable the AC97 controller */
        ep93xx_ac97_write_reg(info, AC97GCR, 0);
index 323ed69b797559906c2f0f5b8c51200c491fca0d..8d244be275d649a303206ec8d5c38874dbbd75a5 100644 (file)
@@ -366,6 +366,10 @@ static struct snd_soc_dai_driver ep93xx_i2s_dai = {
        .ops            = &ep93xx_i2s_dai_ops,
 };
 
+static const struct snd_soc_component_driver ep93xx_i2s_component = {
+       .name           = "ep93xx-i2s",
+};
+
 static int ep93xx_i2s_probe(struct platform_device *pdev)
 {
        struct ep93xx_i2s_info *info;
@@ -405,7 +409,8 @@ static int ep93xx_i2s_probe(struct platform_device *pdev)
        dev_set_drvdata(&pdev->dev, info);
        info->dma_params = ep93xx_i2s_dma_params;
 
-       err = snd_soc_register_dai(&pdev->dev, &ep93xx_i2s_dai);
+       err = snd_soc_register_component(&pdev->dev, &ep93xx_i2s_component,
+                                        &ep93xx_i2s_dai, 1);
        if (err)
                goto fail_put_lrclk;
 
@@ -426,7 +431,7 @@ static int ep93xx_i2s_remove(struct platform_device *pdev)
 {
        struct ep93xx_i2s_info *info = dev_get_drvdata(&pdev->dev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        dev_set_drvdata(&pdev->dev, NULL);
        clk_put(info->lrclk);
        clk_put(info->sclk);
index 8218312071801bcafe3031fd308d70edd3bbd870..ebe82947bab36d4be3e97c4e2c48552119d2528b 100644 (file)
@@ -645,6 +645,10 @@ static struct snd_soc_dai_driver davinci_i2s_dai = {
 
 };
 
+static const struct snd_soc_component_driver davinci_i2s_component = {
+       .name           = "davinci-i2s",
+};
+
 static int davinci_i2s_probe(struct platform_device *pdev)
 {
        struct snd_platform_data *pdata = pdev->dev.platform_data;
@@ -727,20 +731,21 @@ static int davinci_i2s_probe(struct platform_device *pdev)
 
        dev_set_drvdata(&pdev->dev, dev);
 
-       ret = snd_soc_register_dai(&pdev->dev, &davinci_i2s_dai);
+       ret = snd_soc_register_component(&pdev->dev, &davinci_i2s_component,
+                                        &davinci_i2s_dai, 1);
        if (ret != 0)
                goto err_release_clk;
 
        ret = davinci_soc_platform_register(&pdev->dev);
        if (ret) {
                dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
-               goto err_unregister_dai;
+               goto err_unregister_component;
        }
 
        return 0;
 
-err_unregister_dai:
-       snd_soc_unregister_dai(&pdev->dev);
+err_unregister_component:
+       snd_soc_unregister_component(&pdev->dev);
 err_release_clk:
        clk_disable(dev->clk);
        clk_put(dev->clk);
@@ -751,7 +756,7 @@ static int davinci_i2s_remove(struct platform_device *pdev)
 {
        struct davinci_mcbsp_dev *dev = dev_get_drvdata(&pdev->dev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        davinci_soc_platform_unregister(&pdev->dev);
 
        clk_disable(dev->clk);
index 9321e5c9d8c125b3d8894dda33df44d94b7068dc..c2e67f1f194c6f2fa6d6edc9b6ff416737181196 100644 (file)
@@ -962,6 +962,10 @@ static struct snd_soc_dai_driver davinci_mcasp_dai[] = {
 
 };
 
+static const struct snd_soc_component_driver davinci_mcasp_component = {
+       .name           = "davinci-mcasp",
+};
+
 static const struct of_device_id mcasp_dt_ids[] = {
        {
                .compatible = "ti,dm646x-mcasp-audio",
@@ -1170,7 +1174,8 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 
        dma_data->channel = res->start;
        dev_set_drvdata(&pdev->dev, dev);
-       ret = snd_soc_register_dai(&pdev->dev, &davinci_mcasp_dai[pdata->op_mode]);
+       ret = snd_soc_register_component(&pdev->dev, &davinci_mcasp_component,
+                                        &davinci_mcasp_dai[pdata->op_mode], 1);
 
        if (ret != 0)
                goto err_release_clk;
@@ -1178,13 +1183,13 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
        ret = davinci_soc_platform_register(&pdev->dev);
        if (ret) {
                dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
-               goto err_unregister_dai;
+               goto err_unregister_component;
        }
 
        return 0;
 
-err_unregister_dai:
-       snd_soc_unregister_dai(&pdev->dev);
+err_unregister_component:
+       snd_soc_unregister_component(&pdev->dev);
 err_release_clk:
        pm_runtime_put_sync(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
@@ -1194,7 +1199,7 @@ err_release_clk:
 static int davinci_mcasp_remove(struct platform_device *pdev)
 {
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        davinci_soc_platform_unregister(&pdev->dev);
 
        pm_runtime_put_sync(&pdev->dev);
index 07bde2e6f84ef1e789e9a5eefa0cd0d6ee222783..30587c0cdbd2cbdd5d876f9d4e1a7e7c266d36a4 100644 (file)
@@ -204,6 +204,10 @@ static struct snd_soc_dai_driver davinci_vcif_dai = {
 
 };
 
+static const struct snd_soc_component_driver davinci_vcif_component = {
+       .name           = "davinci-vcif",
+};
+
 static int davinci_vcif_probe(struct platform_device *pdev)
 {
        struct davinci_vc *davinci_vc = pdev->dev.platform_data;
@@ -234,7 +238,8 @@ static int davinci_vcif_probe(struct platform_device *pdev)
 
        dev_set_drvdata(&pdev->dev, davinci_vcif_dev);
 
-       ret = snd_soc_register_dai(&pdev->dev, &davinci_vcif_dai);
+       ret = snd_soc_register_component(&pdev->dev, &davinci_vcif_component,
+                                        &davinci_vcif_dai, 1);
        if (ret != 0) {
                dev_err(&pdev->dev, "could not register dai\n");
                return ret;
@@ -243,7 +248,7 @@ static int davinci_vcif_probe(struct platform_device *pdev)
        ret = davinci_soc_platform_register(&pdev->dev);
        if (ret) {
                dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
-               snd_soc_unregister_dai(&pdev->dev);
+               snd_soc_unregister_component(&pdev->dev);
                return ret;
        }
 
@@ -252,7 +257,7 @@ static int davinci_vcif_probe(struct platform_device *pdev)
 
 static int davinci_vcif_remove(struct platform_device *pdev)
 {
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        davinci_soc_platform_unregister(&pdev->dev);
 
        return 0;
index deb30d59965e770a9c8096f5c92b1767f51f96cf..593a3ea12d4c3cca61caa6976d94847478a0c6dc 100644 (file)
@@ -297,6 +297,10 @@ static struct snd_soc_dai_ops dw_i2s_dai_ops = {
        .trigger        = dw_i2s_trigger,
 };
 
+static const struct snd_soc_component_driver dw_i2s_component = {
+       .name           = "dw-i2s",
+};
+
 #ifdef CONFIG_PM
 
 static int dw_i2s_suspend(struct snd_soc_dai *dai)
@@ -413,7 +417,8 @@ static int dw_i2s_probe(struct platform_device *pdev)
 
        dev->dev = &pdev->dev;
        dev_set_drvdata(&pdev->dev, dev);
-       ret = snd_soc_register_dai(&pdev->dev, dw_i2s_dai);
+       ret = snd_soc_register_component(&pdev->dev, &dw_i2s_component,
+                                        dw_i2s_dai, 1);
        if (ret != 0) {
                dev_err(&pdev->dev, "not able to register dai\n");
                goto err_set_drvdata;
@@ -434,7 +439,7 @@ static int dw_i2s_remove(struct platform_device *pdev)
 {
        struct dw_i2s_dev *dev = dev_get_drvdata(&pdev->dev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        dev_set_drvdata(&pdev->dev, NULL);
 
        clk_put(dev->clk);
index 7decbd9b234094945f58065962ba6a6cb22c0200..fe04c67f8fb860839a3fcb9338a9f43e5e89aa3b 100644 (file)
@@ -574,6 +574,10 @@ static struct snd_soc_dai_driver fsl_ssi_dai_template = {
        .ops = &fsl_ssi_dai_ops,
 };
 
+static const struct snd_soc_component_driver fsl_ssi_component = {
+       .name           = "fsl-ssi",
+};
+
 /* Show the statistics of a flag only if its interrupt is enabled.  The
  * compiler will optimze this code to a no-op if the interrupt is not
  * enabled.
@@ -782,7 +786,8 @@ static int fsl_ssi_probe(struct platform_device *pdev)
        /* Register with ASoC */
        dev_set_drvdata(&pdev->dev, ssi_private);
 
-       ret = snd_soc_register_dai(&pdev->dev, &ssi_private->cpu_dai_drv);
+       ret = snd_soc_register_component(&pdev->dev, &fsl_ssi_component,
+                                        &ssi_private->cpu_dai_drv, 1);
        if (ret) {
                dev_err(&pdev->dev, "failed to register DAI: %d\n", ret);
                goto error_dev;
@@ -835,7 +840,7 @@ done:
 error_dai:
        if (ssi_private->ssi_on_imx)
                platform_device_unregister(ssi_private->imx_pcm_pdev);
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
 error_dev:
        dev_set_drvdata(&pdev->dev, NULL);
@@ -873,7 +878,7 @@ static int fsl_ssi_remove(struct platform_device *pdev)
                clk_disable_unprepare(ssi_private->clk);
                clk_put(ssi_private->clk);
        }
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        device_remove_file(&pdev->dev, &ssi_private->dev_attr);
 
        free_irq(ssi_private->irq, ssi_private);
index 810c7eeb7b03998d39a69dde175f21a9c8fcee1c..4a26d88d723667d2b71e856a78c8c71a74344814 100644 (file)
@@ -413,6 +413,10 @@ static struct snd_soc_dai_driver imx_ac97_dai = {
        .ops = &imx_ssi_pcm_dai_ops,
 };
 
+static const struct snd_soc_component_driver imx_component = {
+       .name           = DRV_NAME,
+};
+
 static void setup_channel_to_ac97(struct imx_ssi *imx_ssi)
 {
        void __iomem *base = imx_ssi->base;
@@ -591,7 +595,8 @@ static int imx_ssi_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, ssi);
 
-       ret = snd_soc_register_dai(&pdev->dev, dai);
+       ret = snd_soc_register_component(&pdev->dev, &imx_component,
+                                        dai, 1);
        if (ret) {
                dev_err(&pdev->dev, "register DAI failed\n");
                goto failed_register;
@@ -632,7 +637,7 @@ failed_pdev_alloc:
 failed_pdev_fiq_add:
        platform_device_put(ssi->soc_platform_pdev_fiq);
 failed_pdev_fiq_alloc:
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 failed_register:
        release_mem_region(res->start, resource_size(res));
 failed_get_resource:
@@ -650,7 +655,7 @@ static int imx_ssi_remove(struct platform_device *pdev)
        platform_device_unregister(ssi->soc_platform_pdev);
        platform_device_unregister(ssi->soc_platform_pdev_fiq);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        if (ssi->flags & IMX_SSI_USE_AC97)
                ac97_ssi = NULL;
index a4aec0488dd325cd87f68db6a5705d9b1fcd312a..4141b35ef0bbd27947d3d4147e482b34d45f58a1 100644 (file)
@@ -270,6 +270,9 @@ static struct snd_soc_dai_driver psc_ac97_dai[] = {
        .ops = &psc_ac97_digital_ops,
 } };
 
+static const struct snd_soc_component_driver psc_ac97_component = {
+       .name           = DRV_NAME,
+};
 
 
 /* ---------------------------------------------------------------------
@@ -287,7 +290,8 @@ static int psc_ac97_of_probe(struct platform_device *op)
        if (rc != 0)
                return rc;
 
-       rc = snd_soc_register_dais(&op->dev, psc_ac97_dai, ARRAY_SIZE(psc_ac97_dai));
+       rc = snd_soc_register_component(&op->dev, &psc_ac97_component,
+                                       psc_ac97_dai, ARRAY_SIZE(psc_ac97_dai));
        if (rc != 0) {
                dev_err(&op->dev, "Failed to register DAI\n");
                return rc;
@@ -313,7 +317,7 @@ static int psc_ac97_of_probe(struct platform_device *op)
 static int psc_ac97_of_remove(struct platform_device *op)
 {
        mpc5200_audio_dma_destroy(op);
-       snd_soc_unregister_dais(&op->dev, ARRAY_SIZE(psc_ac97_dai));
+       snd_soc_unregister_component(&op->dev);
        return 0;
 }
 
index b95b966f25a06acbc97c6693c05e2560072884f3..f4efaadb80a2223d29d3718643856fbcee15579c 100644 (file)
@@ -148,6 +148,10 @@ static struct snd_soc_dai_driver psc_i2s_dai[] = {{
        .ops = &psc_i2s_dai_ops,
 } };
 
+static const struct snd_soc_component_driver psc_i2s_component = {
+       .name           = "mpc5200-i2s",
+};
+
 /* ---------------------------------------------------------------------
  * OF platform bus binding code:
  * - Probe/remove operations
@@ -163,7 +167,8 @@ static int psc_i2s_of_probe(struct platform_device *op)
        if (rc != 0)
                return rc;
 
-       rc = snd_soc_register_dais(&op->dev, psc_i2s_dai, ARRAY_SIZE(psc_i2s_dai));
+       rc = snd_soc_register_component(&op->dev, &psc_i2s_component,
+                                       psc_i2s_dai, ARRAY_SIZE(psc_i2s_dai));
        if (rc != 0) {
                pr_err("Failed to register DAI\n");
                return rc;
@@ -208,7 +213,7 @@ static int psc_i2s_of_probe(struct platform_device *op)
 static int psc_i2s_of_remove(struct platform_device *op)
 {
        mpc5200_audio_dma_destroy(op);
-       snd_soc_unregister_dais(&op->dev, ARRAY_SIZE(psc_i2s_dai));
+       snd_soc_unregister_component(&op->dev);
        return 0;
 }
 
index 6cef491f4823cc28467216c8fe207b4eb7df271d..9a126441c5f379c0f00cc85bf7e36be34c3bd8a9 100644 (file)
@@ -425,6 +425,10 @@ static struct snd_soc_dai_driver jz4740_i2s_dai = {
        .resume = jz4740_i2s_resume,
 };
 
+static const struct snd_soc_component_driver jz4740_i2s_component = {
+       .name           = "jz4740-i2s",
+};
+
 static int jz4740_i2s_dev_probe(struct platform_device *pdev)
 {
        struct jz4740_i2s *i2s;
@@ -469,7 +473,8 @@ static int jz4740_i2s_dev_probe(struct platform_device *pdev)
        }
 
        platform_set_drvdata(pdev, i2s);
-       ret = snd_soc_register_dai(&pdev->dev, &jz4740_i2s_dai);
+       ret = snd_soc_register_component(&pdev->dev, &jz4740_i2s_component,
+                                        &jz4740_i2s_dai, 1);
 
        if (ret) {
                dev_err(&pdev->dev, "Failed to register DAI\n");
@@ -496,7 +501,7 @@ static int jz4740_i2s_dev_remove(struct platform_device *pdev)
 {
        struct jz4740_i2s *i2s = platform_get_drvdata(pdev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        clk_put(i2s->clk_i2s);
        clk_put(i2s->clk_aic);
index c74c89065493cec9e90963bf1162be0ed7e5662d..befe68f59285df63b653436a4d2d0dd2d1202ec7 100644 (file)
@@ -451,6 +451,10 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai_extclk = {
        .ops = &kirkwood_i2s_dai_ops,
 };
 
+static const struct snd_soc_component_driver kirkwood_i2s_component = {
+       .name           = DRV_NAME,
+};
+
 static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
 {
        struct kirkwood_asoc_platform_data *data = pdev->dev.platform_data;
@@ -524,10 +528,11 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
                priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_128;
        }
 
-       err = snd_soc_register_dai(&pdev->dev, soc_dai);
+       err = snd_soc_register_component(&pdev->dev, &kirkwood_i2s_component,
+                                        soc_dai, 1);
        if (!err)
                return 0;
-       dev_err(&pdev->dev, "snd_soc_register_dai failed\n");
+       dev_err(&pdev->dev, "snd_soc_register_component failed\n");
 
        if (!IS_ERR(priv->extclk)) {
                clk_disable_unprepare(priv->extclk);
@@ -542,7 +547,7 @@ static int kirkwood_i2s_dev_remove(struct platform_device *pdev)
 {
        struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        if (!IS_ERR(priv->extclk)) {
                clk_disable_unprepare(priv->extclk);
index a263cbed8624527e5b09f19b01da08ecff3e7292..31a829cca5ef147afd3628552f3ed659a0a0a8ad 100644 (file)
@@ -165,6 +165,10 @@ static struct snd_soc_dai_driver sst_platform_dai[] = {
 },
 };
 
+static const struct snd_soc_component_driver sst_component = {
+       .name           = "sst",
+};
+
 /* helper functions */
 static inline void sst_set_stream_status(struct sst_runtime_stream *stream,
                                        int state)
@@ -683,7 +687,7 @@ static int sst_platform_probe(struct platform_device *pdev)
                return ret;
        }
 
-       ret = snd_soc_register_dais(&pdev->dev,
+       ret = snd_soc_register_component(&pdev->dev, &sst_component,
                                sst_platform_dai, ARRAY_SIZE(sst_platform_dai));
        if (ret) {
                pr_err("registering cpu dais failed\n");
@@ -695,7 +699,7 @@ static int sst_platform_probe(struct platform_device *pdev)
 static int sst_platform_remove(struct platform_device *pdev)
 {
 
-       snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(sst_platform_dai));
+       snd_soc_unregister_component(&pdev->dev);
        snd_soc_unregister_platform(&pdev->dev);
        pr_debug("sst_platform_remove success\n");
        return 0;
index 3a2aa1d19b936d5a830513cf43ad3175eea82c2c..3e78ba86668156420775b676c5ea581a0f111c49 100644 (file)
@@ -627,6 +627,10 @@ static struct snd_soc_dai_driver mxs_saif_dai = {
        .ops = &mxs_saif_dai_ops,
 };
 
+static const struct snd_soc_component_driver mxs_saif_component = {
+       .name           = "mxs-saif",
+};
+
 static irqreturn_t mxs_saif_irq(int irq, void *dev_id)
 {
        struct mxs_saif *saif = dev_id;
@@ -763,7 +767,8 @@ static int mxs_saif_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, saif);
 
-       ret = snd_soc_register_dai(&pdev->dev, &mxs_saif_dai);
+       ret = snd_soc_register_component(&pdev->dev, &mxs_saif_component,
+                                        &mxs_saif_dai, 1);
        if (ret) {
                dev_err(&pdev->dev, "register DAI failed\n");
                return ret;
@@ -778,7 +783,7 @@ static int mxs_saif_probe(struct platform_device *pdev)
        return 0;
 
 failed_pdev_alloc:
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        return ret;
 }
@@ -786,7 +791,7 @@ failed_pdev_alloc:
 static int mxs_saif_remove(struct platform_device *pdev)
 {
        mxs_pcm_platform_unregister(&pdev->dev);
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        return 0;
 }
index 0418467a48489716475a3ff33cf8928b69d302c0..fe3285ceaf5bdc4b8903260aed762ab78b02a890 100644 (file)
@@ -314,6 +314,10 @@ static struct snd_soc_dai_driver nuc900_ac97_dai = {
        .ops = &nuc900_ac97_dai_ops,
 };
 
+static const struct snd_soc_component_driver nuc900_ac97_component = {
+       .name           = "nuc900-ac97",
+};
+
 static int nuc900_ac97_drvprobe(struct platform_device *pdev)
 {
        struct nuc900_audio *nuc900_audio;
@@ -361,7 +365,8 @@ static int nuc900_ac97_drvprobe(struct platform_device *pdev)
 
        nuc900_ac97_data = nuc900_audio;
 
-       ret = snd_soc_register_dai(&pdev->dev, &nuc900_ac97_dai);
+       ret = snd_soc_register_component(&pdev->dev, &nuc900_ac97_component,
+                                        &nuc900_ac97_dai, 1);
        if (ret)
                goto out3;
 
@@ -384,7 +389,7 @@ out0:
 
 static int nuc900_ac97_drvremove(struct platform_device *pdev)
 {
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        clk_put(nuc900_ac97_data->clk);
        iounmap(nuc900_ac97_data->mmio);
index ba49ccd9eed9149f234907c6efb66af5587328e6..4c54542895b0ce4999069bb8d7f6016fa40e43ca 100644 (file)
@@ -448,6 +448,10 @@ static struct snd_soc_dai_driver omap_dmic_dai = {
        .ops = &omap_dmic_dai_ops,
 };
 
+static const struct snd_soc_component_driver omap_dmic_component = {
+       .name           = "omap-dmic",
+};
+
 static int asoc_dmic_probe(struct platform_device *pdev)
 {
        struct omap_dmic *dmic;
@@ -507,7 +511,8 @@ static int asoc_dmic_probe(struct platform_device *pdev)
                goto err_put_clk;
        }
 
-       ret = snd_soc_register_dai(&pdev->dev, &omap_dmic_dai);
+       ret = snd_soc_register_component(&pdev->dev, &omap_dmic_component,
+                                        &omap_dmic_dai, 1);
        if (ret)
                goto err_put_clk;
 
@@ -522,7 +527,7 @@ static int asoc_dmic_remove(struct platform_device *pdev)
 {
        struct omap_dmic *dmic = platform_get_drvdata(pdev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        clk_put(dmic->fclk);
 
        return 0;
index 32fa840c493e9f31a6860d0eb48a7392f57d0f91..7e120ccc20e15e9801ac2eb39f71e4b50b49a50e 100644 (file)
@@ -264,6 +264,10 @@ static struct snd_soc_dai_driver omap_hdmi_dai = {
        .ops = &omap_hdmi_dai_ops,
 };
 
+static const struct snd_soc_component_driver omap_hdmi_component = {
+       .name           = DRV_NAME,
+};
+
 static int omap_hdmi_probe(struct platform_device *pdev)
 {
        int ret;
@@ -321,7 +325,8 @@ static int omap_hdmi_probe(struct platform_device *pdev)
        }
 
        dev_set_drvdata(&pdev->dev, hdmi_data);
-       ret = snd_soc_register_dai(&pdev->dev, &omap_hdmi_dai);
+       ret = snd_soc_register_component(&pdev->dev, &omap_hdmi_component,
+                                        &omap_hdmi_dai, 1);
 
        return ret;
 }
@@ -330,7 +335,7 @@ static int omap_hdmi_remove(struct platform_device *pdev)
 {
        struct hdmi_priv *hdmi_data = dev_get_drvdata(&pdev->dev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        if (hdmi_data == NULL) {
                dev_err(&pdev->dev, "cannot obtain HDMi data\n");
index 8d2defd6fdbe04375344a6f9fb440ceac935c347..f51685d72fdbab6fb8441cf12e2e7be31674872d 100644 (file)
@@ -586,6 +586,10 @@ static struct snd_soc_dai_driver omap_mcbsp_dai = {
        .ops = &mcbsp_dai_ops,
 };
 
+static const struct snd_soc_component_driver omap_mcbsp_component = {
+       .name           = "omap-mcbsp",
+};
+
 static int omap_mcbsp_st_info_volsw(struct snd_kcontrol *kcontrol,
                        struct snd_ctl_elem_info *uinfo)
 {
@@ -793,7 +797,8 @@ static int asoc_mcbsp_probe(struct platform_device *pdev)
 
        ret = omap_mcbsp_init(pdev);
        if (!ret)
-               return snd_soc_register_dai(&pdev->dev, &omap_mcbsp_dai);
+               return snd_soc_register_component(&pdev->dev, &omap_mcbsp_component,
+                                                 &omap_mcbsp_dai, 1);
 
        return ret;
 }
@@ -802,7 +807,7 @@ static int asoc_mcbsp_remove(struct platform_device *pdev)
 {
        struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        if (mcbsp->pdata->ops && mcbsp->pdata->ops->free)
                mcbsp->pdata->ops->free(mcbsp->id);
index 5ca11bdac21e3b8b7d37ba1ee1978c6cf477cb15..4cc98071aa91edeae4b7f45396d32ce13f1e08e3 100644 (file)
@@ -420,6 +420,10 @@ static struct snd_soc_dai_driver omap_mcpdm_dai = {
        .ops = &omap_mcpdm_dai_ops,
 };
 
+static const struct snd_soc_component_driver omap_mcpdm_component = {
+       .name           = "omap-mcpdm",
+};
+
 void omap_mcpdm_configure_dn_offsets(struct snd_soc_pcm_runtime *rtd,
                                    u8 rx1, u8 rx2)
 {
@@ -480,12 +484,13 @@ static int asoc_mcpdm_probe(struct platform_device *pdev)
 
        mcpdm->dev = &pdev->dev;
 
-       return snd_soc_register_dai(&pdev->dev, &omap_mcpdm_dai);
+       return snd_soc_register_component(&pdev->dev, &omap_mcpdm_component,
+                                         &omap_mcpdm_dai, 1);
 }
 
 static int asoc_mcpdm_remove(struct platform_device *pdev)
 {
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        return 0;
 }
 
index 9140c4abafbc98f4ea5a464f26cefba7286c258e..a647799801773d0baedcbffc5e9d3ddec4208b62 100644 (file)
@@ -405,6 +405,10 @@ struct snd_soc_dai_driver mmp_sspa_dai = {
        .ops = &mmp_sspa_dai_ops,
 };
 
+static const struct snd_soc_component_driver mmp_sspa_component = {
+       .name           = "mmp-sspa",
+};
+
 static int asoc_mmp_sspa_probe(struct platform_device *pdev)
 {
        struct sspa_priv *priv;
@@ -450,7 +454,8 @@ static int asoc_mmp_sspa_probe(struct platform_device *pdev)
        priv->dai_fmt = (unsigned int) -1;
        platform_set_drvdata(pdev, priv);
 
-       return snd_soc_register_dai(&pdev->dev, &mmp_sspa_dai);
+       return snd_soc_register_component(&pdev->dev, &mmp_sspa_component,
+                                         &mmp_sspa_dai, 1);
 }
 
 static int asoc_mmp_sspa_remove(struct platform_device *pdev)
@@ -460,7 +465,7 @@ static int asoc_mmp_sspa_remove(struct platform_device *pdev)
        clk_disable(priv->audio_clk);
        clk_put(priv->audio_clk);
        clk_put(priv->sysclk);
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        return 0;
 }
 
index d3eb0c2eec7724a843f277647cb80d5ed8ecea9f..6f4dd7543e829db8e73577f1184c667a596c89d0 100644 (file)
@@ -794,14 +794,19 @@ static struct snd_soc_dai_driver pxa_ssp_dai = {
                .ops = &pxa_ssp_dai_ops,
 };
 
+static const struct snd_soc_component_driver pxa_ssp_component = {
+       .name           = "pxa-ssp",
+};
+
 static int asoc_ssp_probe(struct platform_device *pdev)
 {
-       return snd_soc_register_dai(&pdev->dev, &pxa_ssp_dai);
+       return snd_soc_register_component(&pdev->dev, &pxa_ssp_component,
+                                         &pxa_ssp_dai, 1);
 }
 
 static int asoc_ssp_remove(struct platform_device *pdev)
 {
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        return 0;
 }
 
index 4b0a009bd68388e0355ff82841b7673d46120181..57ea8e6c54885372f7808376968b7f56783ef78a 100644 (file)
@@ -47,6 +47,7 @@ struct snd_ac97_bus_ops soc_ac97_ops = {
        .warm_reset     = pxa2xx_ac97_warm_reset,
        .reset  = pxa2xx_ac97_cold_reset,
 };
+EXPORT_SYMBOL_GPL(soc_ac97_ops);
 
 static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_stereo_out = {
        .name                   = "AC97 PCM Stereo out",
@@ -232,7 +233,9 @@ static struct snd_soc_dai_driver pxa_ac97_dai_driver[] = {
 },
 };
 
-EXPORT_SYMBOL_GPL(soc_ac97_ops);
+static const struct snd_soc_component_driver pxa_ac97_component = {
+       .name           = "pxa-ac97",
+};
 
 static int pxa2xx_ac97_dev_probe(struct platform_device *pdev)
 {
@@ -245,13 +248,13 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev)
         * driver to do interesting things with the clocking to get us up
         * and running.
         */
-       return snd_soc_register_dais(&pdev->dev, pxa_ac97_dai_driver,
-                       ARRAY_SIZE(pxa_ac97_dai_driver));
+       return snd_soc_register_component(&pdev->dev, &pxa_ac97_component,
+                                         pxa_ac97_dai_driver, ARRAY_SIZE(pxa_ac97_dai_driver));
 }
 
 static int pxa2xx_ac97_dev_remove(struct platform_device *pdev)
 {
-       snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(pxa_ac97_dai_driver));
+       snd_soc_unregister_component(&pdev->dev);
        return 0;
 }
 
index 6b1a06f67564abc2ce97450ed9cad05c1cd7a2ee..f7ca716641126bdb65ff5815823a500719bbeba8 100644 (file)
@@ -360,14 +360,19 @@ static struct snd_soc_dai_driver pxa_i2s_dai = {
        .symmetric_rates = 1,
 };
 
+static const struct snd_soc_component_driver pxa_i2s_component = {
+       .name           = "pxa-i2s",
+};
+
 static int pxa2xx_i2s_drv_probe(struct platform_device *pdev)
 {
-       return snd_soc_register_dai(&pdev->dev, &pxa_i2s_dai);
+       return snd_soc_register_component(&pdev->dev, &pxa_i2s_component,
+                                         &pxa_i2s_dai, 1);
 }
 
 static int pxa2xx_i2s_drv_remove(struct platform_device *pdev)
 {
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        return 0;
 }
 
index fee4d477a49cab75810ab7f02579a50516227450..73bb99f0109a2579597128e692c7d70f1de8758d 100644 (file)
@@ -436,6 +436,10 @@ static struct snd_soc_dai_driver s6000_i2s_dai = {
        .ops = &s6000_i2s_dai_ops,
 };
 
+static const struct snd_soc_component_driver s6000_i2s_component = {
+       .name           = "s6000-i2s",
+};
+
 static int s6000_i2s_probe(struct platform_device *pdev)
 {
        struct s6000_i2s_dev *dev;
@@ -543,7 +547,8 @@ static int s6000_i2s_probe(struct platform_device *pdev)
                         S6_I2S_INT_UNDERRUN |
                         S6_I2S_INT_OVERRUN);
 
-       ret = snd_soc_register_dai(&pdev->dev, &s6000_i2s_dai);
+       ret = snd_soc_register_component(&pdev->dev, &s6000_i2s_component,
+                                        &s6000_i2s_dai, 1);
        if (ret)
                goto err_release_dev;
 
@@ -572,7 +577,7 @@ static void s6000_i2s_remove(struct platform_device *pdev)
        struct resource *region;
        void __iomem *mmio = dev->scbbase;
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        s6000_i2s_stop_channel(dev, 0);
        s6000_i2s_stop_channel(dev, 1);
index 0df3c5644cfafb9629621b728339157cc8496cc7..32ff594954bc44829afc27b4f7050a468288f99f 100644 (file)
@@ -370,6 +370,10 @@ static struct snd_soc_dai_driver s3c_ac97_dai[] = {
        },
 };
 
+static const struct snd_soc_component_driver s3c_ac97_component = {
+       .name           = "s3c-ac97",
+};
+
 static int s3c_ac97_probe(struct platform_device *pdev)
 {
        struct resource *mem_res, *dmatx_res, *dmarx_res, *dmamic_res, *irq_res;
@@ -457,8 +461,8 @@ static int s3c_ac97_probe(struct platform_device *pdev)
                goto err4;
        }
 
-       ret = snd_soc_register_dais(&pdev->dev, s3c_ac97_dai,
-                       ARRAY_SIZE(s3c_ac97_dai));
+       ret = snd_soc_register_component(&pdev->dev, &s3c_ac97_component,
+                                        s3c_ac97_dai, ARRAY_SIZE(s3c_ac97_dai));
        if (ret)
                goto err5;
 
@@ -470,7 +474,7 @@ static int s3c_ac97_probe(struct platform_device *pdev)
 
        return 0;
 err6:
-       snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(s3c_ac97_dai));
+       snd_soc_unregister_component(&pdev->dev);
 err5:
        free_irq(irq_res->start, NULL);
 err4:
@@ -490,7 +494,7 @@ static int s3c_ac97_remove(struct platform_device *pdev)
        struct resource *mem_res, *irq_res;
 
        asoc_dma_platform_unregister(&pdev->dev);
-       snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(s3c_ac97_dai));
+       snd_soc_unregister_component(&pdev->dev);
 
        irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
        if (irq_res)
index d37ede58e0a8620eb21ba317a8885b7601d02c3b..415ad81999c4bab0076d6e3f7933c19c338fee13 100644 (file)
@@ -218,6 +218,10 @@ static struct snd_soc_dai_driver voice_dai = {
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
 };
 
+static const struct snd_soc_component_driver voice_component = {
+       .name           = "goni-voice",
+};
+
 static struct snd_soc_ops goni_voice_ops = {
        .hw_params = goni_voice_hw_params,
 };
@@ -270,7 +274,8 @@ static int __init goni_init(void)
                return -ENOMEM;
 
        /* register voice DAI here */
-       ret = snd_soc_register_dai(&goni_snd_device->dev, &voice_dai);
+       ret = snd_soc_register_component(&goni_snd_device->dev, &voice_component,
+                                        &voice_dai, 1);
        if (ret) {
                platform_device_put(goni_snd_device);
                return ret;
@@ -280,7 +285,7 @@ static int __init goni_init(void)
        ret = platform_device_add(goni_snd_device);
 
        if (ret) {
-               snd_soc_unregister_dai(&goni_snd_device->dev);
+               snd_soc_unregister_component(&goni_snd_device->dev);
                platform_device_put(goni_snd_device);
        }
 
@@ -289,7 +294,7 @@ static int __init goni_init(void)
 
 static void __exit goni_exit(void)
 {
-       snd_soc_unregister_dai(&goni_snd_device->dev);
+       snd_soc_unregister_component(&goni_snd_device->dev);
        platform_device_unregister(goni_snd_device);
 }
 
index 6bbeb0bf1a73a58fa9e3a573e00655dc3e8763d2..abbcbe4b429c48c96c8d859b3f7035a92d05a474 100644 (file)
@@ -963,6 +963,10 @@ static const struct snd_soc_dai_ops samsung_i2s_dai_ops = {
        .delay = i2s_delay,
 };
 
+static const struct snd_soc_component_driver samsung_i2s_component = {
+       .name           = "samsung-i2s",
+};
+
 #define SAMSUNG_I2S_RATES      SNDRV_PCM_RATE_8000_96000
 
 #define SAMSUNG_I2S_FMTS       (SNDRV_PCM_FMTBIT_S8 | \
@@ -1114,8 +1118,9 @@ static int samsung_i2s_probe(struct platform_device *pdev)
                        dev_err(&pdev->dev, "Unable to get drvdata\n");
                        return -EFAULT;
                }
-               snd_soc_register_dai(&sec_dai->pdev->dev,
-                       &sec_dai->i2s_dai_drv);
+               snd_soc_register_component(&sec_dai->pdev->dev,
+                                          &samsung_i2s_component,
+                                          &sec_dai->i2s_dai_drv, 1);
                asoc_dma_platform_register(&pdev->dev);
                return 0;
        }
@@ -1244,7 +1249,8 @@ static int samsung_i2s_probe(struct platform_device *pdev)
                }
        }
 
-       snd_soc_register_dai(&pri_dai->pdev->dev, &pri_dai->i2s_dai_drv);
+       snd_soc_register_component(&pri_dai->pdev->dev, &samsung_i2s_component,
+                                  &pri_dai->i2s_dai_drv, 1);
 
        pm_runtime_enable(&pdev->dev);
 
@@ -1283,7 +1289,7 @@ static int samsung_i2s_remove(struct platform_device *pdev)
        i2s->sec_dai = NULL;
 
        asoc_dma_platform_unregister(&pdev->dev);
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        return 0;
 }
index 13bab79ad93d2fb493608b7fa0b909df42be26ac..1566afe9ef525097ee45ce737af33bc63b47fba7 100644 (file)
@@ -490,6 +490,10 @@ static struct snd_soc_dai_driver s3c_pcm_dai[] = {
        },
 };
 
+static const struct snd_soc_component_driver s3c_pcm_component = {
+       .name           = "s3c-pcm",
+};
+
 static int s3c_pcm_dev_probe(struct platform_device *pdev)
 {
        struct s3c_pcm_info *pcm;
@@ -583,7 +587,8 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
 
        pm_runtime_enable(&pdev->dev);
 
-       ret = snd_soc_register_dai(&pdev->dev, &s3c_pcm_dai[pdev->id]);
+       ret = snd_soc_register_component(&pdev->dev, &s3c_pcm_component,
+                                        &s3c_pcm_dai[pdev->id], 1);
        if (ret != 0) {
                dev_err(&pdev->dev, "failed to get register DAI: %d\n", ret);
                goto err5;
@@ -598,7 +603,7 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
        return 0;
 
 err6:
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 err5:
        clk_disable_unprepare(pcm->pclk);
        clk_put(pcm->pclk);
@@ -619,7 +624,7 @@ static int s3c_pcm_dev_remove(struct platform_device *pdev)
        struct resource *mem_res;
 
        asoc_dma_platform_unregister(&pdev->dev);
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        pm_runtime_disable(&pdev->dev);
 
index 7a73380b3560f22af046d30af04846435f806e83..20e98d1dded207ec328e94dc3187b6d025cfc06f 100644 (file)
@@ -731,8 +731,9 @@ static int s3c2412_i2s_resume(struct snd_soc_dai *dai)
 #define s3c2412_i2s_resume  NULL
 #endif
 
-int s3c_i2sv2_register_dai(struct device *dev, int id,
-               struct snd_soc_dai_driver *drv)
+int s3c_i2sv2_register_component(struct device *dev, int id,
+                          struct snd_soc_component_driver *cmp_drv,
+                          struct snd_soc_dai_driver *dai_drv)
 {
        struct snd_soc_dai_ops *ops = drv->ops;
 
@@ -750,8 +751,8 @@ int s3c_i2sv2_register_dai(struct device *dev, int id,
        drv->suspend = s3c2412_i2s_suspend;
        drv->resume = s3c2412_i2s_resume;
 
-       return snd_soc_register_dai(dev, drv);
+       return snd_soc_register_component(dev, cmp_drv, dai_drv, 1);
 }
-EXPORT_SYMBOL_GPL(s3c_i2sv2_register_dai);
+EXPORT_SYMBOL_GPL(s3c_i2sv2_register_component);
 
 MODULE_LICENSE("GPL");
index f8297d9bb8a39688e1f95f4e1b619b61574127b2..90abab364b495fd18d11ed421a37bc123e3fa45e 100644 (file)
@@ -92,7 +92,7 @@ extern int s3c_i2sv2_probe(struct snd_soc_dai *dai,
                           unsigned long base);
 
 /**
- * s3c_i2sv2_register_dai - register dai with soc core
+ * s3c_i2sv2_register_component - register component and dai with soc core
  * @dev: DAI device
  * @id: DAI ID
  * @drv: The driver structure to register
@@ -100,7 +100,8 @@ extern int s3c_i2sv2_probe(struct snd_soc_dai *dai,
  * Fill in any missing fields and then register the given dai with the
  * soc core.
  */
-extern int s3c_i2sv2_register_dai(struct device *dev, int id,
-               struct snd_soc_dai_driver *drv);
+extern int s3c_i2sv2_register_component(struct device *dev, int id,
+                                       struct snd_soc_component_driver *cmp_drv,
+                                       struct snd_soc_dai_driver *dai_drv);
 
 #endif /* __SND_SOC_S3C24XX_S3C_I2SV2_I2S_H */
index 22133771639359877a7a918a593d28f9eac3fa9d..47e23864ea72f762deea79ee195ae0b633f8c6db 100644 (file)
@@ -160,11 +160,17 @@ static struct snd_soc_dai_driver s3c2412_i2s_dai = {
        .ops = &s3c2412_i2s_dai_ops,
 };
 
+static const struct snd_soc_component_driver s3c2412_i2s_component = {
+       .name           = "s3c2412-i2s",
+};
+
 static int s3c2412_iis_dev_probe(struct platform_device *pdev)
 {
        int ret = 0;
 
-       ret = s3c_i2sv2_register_dai(&pdev->dev, -1, &s3c2412_i2s_dai);
+       ret = s3c_i2sv2_register_component(&pdev->dev, -1,
+                                          &s3c2412_i2s_component,
+                                          &s3c2412_i2s_dai);
        if (ret) {
                pr_err("failed to register the dai\n");
                return ret;
@@ -178,14 +184,14 @@ static int s3c2412_iis_dev_probe(struct platform_device *pdev)
 
        return 0;
 err:
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        return ret;
 }
 
 static int s3c2412_iis_dev_remove(struct platform_device *pdev)
 {
        asoc_dma_platform_unregister(&pdev->dev);
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        return 0;
 }
 
index 13f6dd1ceb00ae2d48febed247630af3e56ecc38..5403176b2aa39519283cd31bbbff7c15d7ac7023 100644 (file)
@@ -465,11 +465,16 @@ static struct snd_soc_dai_driver s3c24xx_i2s_dai = {
        .ops = &s3c24xx_i2s_dai_ops,
 };
 
+static const struct snd_soc_component_driver s3c24xx_i2s_component = {
+       .name           = "s3c24xx-i2s",
+};
+
 static int s3c24xx_iis_dev_probe(struct platform_device *pdev)
 {
        int ret = 0;
 
-       ret = snd_soc_register_dai(&pdev->dev, &s3c24xx_i2s_dai);
+       ret = snd_soc_register_component(&pdev->dev, &s3c24xx_i2s_component,
+                                        &s3c24xx_i2s_dai, 1);
        if (ret) {
                pr_err("failed to register the dai\n");
                return ret;
@@ -483,14 +488,14 @@ static int s3c24xx_iis_dev_probe(struct platform_device *pdev)
 
        return 0;
 err:
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        return ret;
 }
 
 static int s3c24xx_iis_dev_remove(struct platform_device *pdev)
 {
        asoc_dma_platform_unregister(&pdev->dev);
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        return 0;
 }
 
index 5008e5bd6ed8072c62a0b9feb34f136497801b50..2e5ebb2f1982c2e849e8a8adc7924034a6931675 100644 (file)
@@ -357,6 +357,10 @@ static struct snd_soc_dai_driver samsung_spdif_dai = {
        .resume = spdif_resume,
 };
 
+static const struct snd_soc_component_driver samsung_spdif_component = {
+       .name           = "samsung-spdif",
+};
+
 static int spdif_probe(struct platform_device *pdev)
 {
        struct s3c_audio_pdata *spdif_pdata;
@@ -424,7 +428,8 @@ static int spdif_probe(struct platform_device *pdev)
 
        dev_set_drvdata(&pdev->dev, spdif);
 
-       ret = snd_soc_register_dai(&pdev->dev, &samsung_spdif_dai);
+       ret = snd_soc_register_component(&pdev->dev, &samsung_spdif_component,
+                                        &samsung_spdif_dai, 1);
        if (ret != 0) {
                dev_err(&pdev->dev, "fail to register dai\n");
                goto err4;
@@ -445,7 +450,7 @@ static int spdif_probe(struct platform_device *pdev)
 
        return 0;
 err5:
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 err4:
        iounmap(spdif->regs);
 err3:
@@ -466,7 +471,7 @@ static int spdif_remove(struct platform_device *pdev)
        struct resource *mem_res;
 
        asoc_dma_platform_unregister(&pdev->dev);
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        iounmap(spdif->regs);
 
index c724026a246f6ec90f80b11dfed4397fee6d7d37..254c6375f7a1ebe890df2f42eae8e0bcd5107de2 100644 (file)
@@ -1886,6 +1886,10 @@ static struct snd_soc_platform_driver fsi_soc_platform = {
        .pcm_free       = fsi_pcm_free,
 };
 
+static const struct snd_soc_component_driver fsi_soc_component = {
+       .name           = "fsi",
+};
+
 /*
  *             platform function
  */
@@ -2046,10 +2050,10 @@ static int fsi_probe(struct platform_device *pdev)
                goto exit_fsib;
        }
 
-       ret = snd_soc_register_dais(&pdev->dev, fsi_soc_dai,
-                                   ARRAY_SIZE(fsi_soc_dai));
+       ret = snd_soc_register_component(&pdev->dev, &fsi_soc_component,
+                                   fsi_soc_dai, ARRAY_SIZE(fsi_soc_dai));
        if (ret < 0) {
-               dev_err(&pdev->dev, "cannot snd dai register\n");
+               dev_err(&pdev->dev, "cannot snd component register\n");
                goto exit_snd_soc;
        }
 
@@ -2074,7 +2078,7 @@ static int fsi_remove(struct platform_device *pdev)
 
        pm_runtime_disable(&pdev->dev);
 
-       snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(fsi_soc_dai));
+       snd_soc_unregister_component(&pdev->dev);
        snd_soc_unregister_platform(&pdev->dev);
 
        fsi_stream_remove(&master->fsia);
index 4cc2d64ef4765a68f458da65caedce29d8c86641..af19f77b7bf0fa84c101170b5bee45cad6920f26 100644 (file)
@@ -310,15 +310,19 @@ static struct snd_soc_dai_driver sh4_hac_dai[] = {
 #endif
 };
 
+static const struct snd_soc_component_driver sh4_hac_component = {
+       .name           = "sh4-hac",
+};
+
 static int hac_soc_platform_probe(struct platform_device *pdev)
 {
-       return snd_soc_register_dais(&pdev->dev, sh4_hac_dai,
-                       ARRAY_SIZE(sh4_hac_dai));
+       return snd_soc_register_component(&pdev->dev, &sh4_hac_component,
+                                         sh4_hac_dai, ARRAY_SIZE(sh4_hac_dai));
 }
 
 static int hac_soc_platform_remove(struct platform_device *pdev)
 {
-       snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(sh4_hac_dai));
+       snd_soc_unregister_component(&pdev->dev);
        return 0;
 }
 
index 8526e1edaf45cad2fc4ba1d1e30b9b59a1e8f951..5014a884afeebff8fdf168a76dd90d33e2387bbf 100644 (file)
@@ -153,7 +153,7 @@ static int migor_dai_init(struct snd_soc_pcm_runtime *rtd)
 static struct snd_soc_dai_link migor_dai = {
        .name = "wm8978",
        .stream_name = "WM8978",
-       .cpu_dai_name = "siu-i2s-dai",
+       .cpu_dai_name = "siu-pcm-audio",
        .codec_dai_name = "wm8978-hifi",
        .platform_name = "siu-pcm-audio",
        .codec_name = "wm8978.0-001a",
index 34facdc9e4acfd68594e3db561b2aca108235459..9dc24ffa892a45fcee55009322aeebaa768b361f 100644 (file)
@@ -726,6 +726,10 @@ static struct snd_soc_dai_driver siu_i2s_dai = {
        .ops = &siu_dai_ops,
 };
 
+static const struct snd_soc_component_driver siu_i2s_component = {
+       .name           = "siu-i2s",
+};
+
 static int siu_probe(struct platform_device *pdev)
 {
        const struct firmware *fw_entry;
@@ -783,7 +787,8 @@ static int siu_probe(struct platform_device *pdev)
        dev_set_drvdata(&pdev->dev, info);
 
        /* register using ARRAY version so we can keep dai name */
-       ret = snd_soc_register_dais(&pdev->dev, &siu_i2s_dai, 1);
+       ret = snd_soc_register_component(&pdev->dev, &siu_i2s_component,
+                                        &siu_i2s_dai, 1);
        if (ret < 0)
                goto edaiinit;
 
@@ -796,7 +801,7 @@ static int siu_probe(struct platform_device *pdev)
        return ret;
 
 esocregp:
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 edaiinit:
        iounmap(info->reg);
 emapreg:
@@ -823,7 +828,7 @@ static int siu_remove(struct platform_device *pdev)
        pm_runtime_disable(&pdev->dev);
 
        snd_soc_unregister_platform(&pdev->dev);
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        iounmap(info->reg);
        iounmap(info->yram);
index c8e73a7039348e7818b15bacb95b1e6e6268b856..e889405ebd385db5143b9aa63d2479f529035331 100644 (file)
@@ -379,15 +379,19 @@ static struct snd_soc_dai_driver sh4_ssi_dai[] = {
 #endif
 };
 
+static const struct snd_soc_component_driver sh4_ssi_component = {
+       .name           = "sh4-ssi",
+};
+
 static int sh4_soc_dai_probe(struct platform_device *pdev)
 {
-       return snd_soc_register_dais(&pdev->dev, sh4_ssi_dai,
-                       ARRAY_SIZE(sh4_ssi_dai));
+       return snd_soc_register_component(&pdev->dev, &sh4_ssi_component,
+                                         sh4_ssi_dai, ARRAY_SIZE(sh4_ssi_dai));
 }
 
 static int sh4_soc_dai_remove(struct platform_device *pdev)
 {
-       snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(sh4_ssi_dai));
+       snd_soc_unregister_component(&pdev->dev);
        return 0;
 }
 
index ff4b45a5d796f0f16dcd09b7611ad6dc3bda5bb0..45aa1d3a4a52f628a7b13c6a8a3ae2206772dbcd 100644 (file)
@@ -58,6 +58,7 @@ static DEFINE_MUTEX(client_mutex);
 static LIST_HEAD(dai_list);
 static LIST_HEAD(platform_list);
 static LIST_HEAD(codec_list);
+static LIST_HEAD(component_list);
 
 /*
  * This is a timeout to do a DAPM powerdown after a stream is closed().
@@ -3740,7 +3741,7 @@ static inline char *fmt_multiple_name(struct device *dev,
  *
  * @dai: DAI to register
  */
-int snd_soc_register_dai(struct device *dev,
+static int snd_soc_register_dai(struct device *dev,
                struct snd_soc_dai_driver *dai_drv)
 {
        struct snd_soc_codec *codec;
@@ -3787,14 +3788,13 @@ int snd_soc_register_dai(struct device *dev,
 
        return 0;
 }
-EXPORT_SYMBOL_GPL(snd_soc_register_dai);
 
 /**
  * snd_soc_unregister_dai - Unregister a DAI from the ASoC core
  *
  * @dai: DAI to unregister
  */
-void snd_soc_unregister_dai(struct device *dev)
+static void snd_soc_unregister_dai(struct device *dev)
 {
        struct snd_soc_dai *dai;
 
@@ -3813,7 +3813,6 @@ found:
        kfree(dai->name);
        kfree(dai);
 }
-EXPORT_SYMBOL_GPL(snd_soc_unregister_dai);
 
 /**
  * snd_soc_register_dais - Register multiple DAIs with the ASoC core
@@ -3821,7 +3820,7 @@ EXPORT_SYMBOL_GPL(snd_soc_unregister_dai);
  * @dai: Array of DAIs to register
  * @count: Number of DAIs
  */
-int snd_soc_register_dais(struct device *dev,
+static int snd_soc_register_dais(struct device *dev,
                struct snd_soc_dai_driver *dai_drv, size_t count)
 {
        struct snd_soc_codec *codec;
@@ -3885,7 +3884,6 @@ err:
 
        return ret;
 }
-EXPORT_SYMBOL_GPL(snd_soc_register_dais);
 
 /**
  * snd_soc_unregister_dais - Unregister multiple DAIs from the ASoC core
@@ -3893,14 +3891,13 @@ EXPORT_SYMBOL_GPL(snd_soc_register_dais);
  * @dai: Array of DAIs to unregister
  * @count: Number of DAIs
  */
-void snd_soc_unregister_dais(struct device *dev, size_t count)
+static void snd_soc_unregister_dais(struct device *dev, size_t count)
 {
        int i;
 
        for (i = 0; i < count; i++)
                snd_soc_unregister_dai(dev);
 }
-EXPORT_SYMBOL_GPL(snd_soc_unregister_dais);
 
 /**
  * snd_soc_register_platform - Register a platform with the ASoC core
@@ -4139,6 +4136,92 @@ found:
 }
 EXPORT_SYMBOL_GPL(snd_soc_unregister_codec);
 
+
+/**
+ * snd_soc_register_component - Register a component with the ASoC core
+ *
+ */
+int snd_soc_register_component(struct device *dev,
+                        const struct snd_soc_component_driver *cmpnt_drv,
+                        struct snd_soc_dai_driver *dai_drv,
+                        int num_dai)
+{
+       struct snd_soc_component *cmpnt;
+       int ret;
+
+       dev_dbg(dev, "component register %s\n", dev_name(dev));
+
+       cmpnt = devm_kzalloc(dev, sizeof(*cmpnt), GFP_KERNEL);
+       if (!cmpnt) {
+               dev_err(dev, "ASoC: Failed to allocate memory\n");
+               return -ENOMEM;
+       }
+
+       cmpnt->name = fmt_single_name(dev, &cmpnt->id);
+       if (!cmpnt->name) {
+               dev_err(dev, "ASoC: Failed to simplifying name\n");
+               return -ENOMEM;
+       }
+
+       cmpnt->dev      = dev;
+       cmpnt->driver   = cmpnt_drv;
+       cmpnt->num_dai  = num_dai;
+
+       /*
+        * snd_soc_register_dai()  uses fmt_single_name(), and
+        * snd_soc_register_dais() uses fmt_multiple_name()
+        * for dai->name which is used for name based matching
+        */
+       if (1 == num_dai)
+               ret = snd_soc_register_dai(dev, dai_drv);
+       else
+               ret = snd_soc_register_dais(dev, dai_drv, num_dai);
+       if (ret < 0) {
+               dev_err(dev, "ASoC: Failed to regster DAIs: %d\n", ret);
+               goto error_component_name;
+       }
+
+       mutex_lock(&client_mutex);
+       list_add(&cmpnt->list, &component_list);
+       mutex_unlock(&client_mutex);
+
+       dev_dbg(cmpnt->dev, "ASoC: Registered component '%s'\n", cmpnt->name);
+
+       return ret;
+
+error_component_name:
+       kfree(cmpnt->name);
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(snd_soc_register_component);
+
+/**
+ * snd_soc_unregister_component - Unregister a component from the ASoC core
+ *
+ */
+void snd_soc_unregister_component(struct device *dev)
+{
+       struct snd_soc_component *cmpnt;
+
+       list_for_each_entry(cmpnt, &component_list, list) {
+               if (dev == cmpnt->dev)
+                       goto found;
+       }
+       return;
+
+found:
+       snd_soc_unregister_dais(dev, cmpnt->num_dai);
+
+       mutex_lock(&client_mutex);
+       list_del(&cmpnt->list);
+       mutex_unlock(&client_mutex);
+
+       dev_dbg(dev, "ASoC: Unregistered component '%s'\n", cmpnt->name);
+       kfree(cmpnt->name);
+}
+EXPORT_SYMBOL_GPL(snd_soc_unregister_component);
+
 /* Retrieve a card's name from device tree */
 int snd_soc_of_parse_card_name(struct snd_soc_card *card,
                               const char *propname)
index c7c4b20395bb7bb54c9a56dd2a4916d27b58f97b..14d57e89bcbac5362efa85f40a41a9cf3e28f026 100644 (file)
@@ -170,6 +170,10 @@ struct snd_soc_dai_driver spdif_in_dai = {
        .ops = &spdif_in_dai_ops,
 };
 
+static const struct snd_soc_component_driver spdif_in_component = {
+       .name           = "spdif-in",
+};
+
 static irqreturn_t spdif_in_irq(int irq, void *arg)
 {
        struct spdif_in_dev *host = (struct spdif_in_dev *)arg;
@@ -258,7 +262,8 @@ static int spdif_in_probe(struct platform_device *pdev)
                return ret;
        }
 
-       ret = snd_soc_register_dai(&pdev->dev, &spdif_in_dai);
+       ret = snd_soc_register_component(&pdev->dev, &spdif_in_component,
+                                        &spdif_in_dai, 1);
        if (ret != 0) {
                clk_put(host->clk);
                return ret;
@@ -271,7 +276,7 @@ static int spdif_in_remove(struct platform_device *pdev)
 {
        struct spdif_in_dev *host = dev_get_drvdata(&pdev->dev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        dev_set_drvdata(&pdev->dev, NULL);
 
        clk_put(host->clk);
index 5eac4cda2fd756a43a8976e27d3125eac5a084c0..1e3c3dda359846e07fa73f13b3538f81b3dedeb7 100644 (file)
@@ -270,6 +270,10 @@ static struct snd_soc_dai_driver spdif_out_dai = {
        .ops = &spdif_out_dai_ops,
 };
 
+static const struct snd_soc_component_driver spdif_out_component = {
+       .name           = "spdif-out",
+};
+
 static int spdif_out_probe(struct platform_device *pdev)
 {
        struct spdif_out_dev *host;
@@ -314,7 +318,8 @@ static int spdif_out_probe(struct platform_device *pdev)
 
        dev_set_drvdata(&pdev->dev, host);
 
-       ret = snd_soc_register_dai(&pdev->dev, &spdif_out_dai);
+       ret = snd_soc_register_component(&pdev->dev, &spdif_out_component,
+                                        &spdif_out_dai, 1);
        if (ret != 0) {
                clk_put(host->clk);
                return ret;
@@ -327,7 +332,7 @@ static int spdif_out_remove(struct platform_device *pdev)
 {
        struct spdif_out_dev *host = dev_get_drvdata(&pdev->dev);
 
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        dev_set_drvdata(&pdev->dev, NULL);
 
        clk_put(host->clk);
index 336dcdd3e8a457e4a67c113e66ea0a88155dce74..b5cee92f82e85071662be5261d7c4b4f13f8c46a 100644 (file)
@@ -248,6 +248,10 @@ static struct snd_soc_dai_driver tegra20_ac97_dai = {
        .ops = &tegra20_ac97_dai_ops,
 };
 
+static const struct snd_soc_component_driver tegra20_ac97_component = {
+       .name           = DRV_NAME,
+};
+
 static bool tegra20_ac97_wr_rd_reg(struct device *dev, unsigned int reg)
 {
        switch (reg) {
@@ -398,7 +402,8 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev)
        ac97->playback_dma_data.width = 32;
        ac97->playback_dma_data.req_sel = of_dma[1];
 
-       ret = snd_soc_register_dais(&pdev->dev, &tegra20_ac97_dai, 1);
+       ret = snd_soc_register_component(&pdev->dev, &tegra20_ac97_component,
+                                        &tegra20_ac97_dai, 1);
        if (ret) {
                dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
                ret = -ENOMEM;
@@ -408,7 +413,7 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev)
        ret = tegra_pcm_platform_register(&pdev->dev);
        if (ret) {
                dev_err(&pdev->dev, "Could not register PCM: %d\n", ret);
-               goto err_unregister_dai;
+               goto err_unregister_component;
        }
 
        ret = tegra_asoc_utils_init(&ac97->util_data, &pdev->dev);
@@ -434,8 +439,8 @@ err_asoc_utils_fini:
        tegra_asoc_utils_fini(&ac97->util_data);
 err_unregister_pcm:
        tegra_pcm_platform_unregister(&pdev->dev);
-err_unregister_dai:
-       snd_soc_unregister_dai(&pdev->dev);
+err_unregister_component:
+       snd_soc_unregister_component(&pdev->dev);
 err_clk_put:
        clk_put(ac97->clk_ac97);
 err:
@@ -447,7 +452,7 @@ static int tegra20_ac97_platform_remove(struct platform_device *pdev)
        struct tegra20_ac97 *ac97 = dev_get_drvdata(&pdev->dev);
 
        tegra_pcm_platform_unregister(&pdev->dev);
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        tegra_asoc_utils_fini(&ac97->util_data);
 
index caa772de5a184cb021def3333323e4343343fc51..8b1ceb82c86f7a0fbea2ecc6c06841634bd094a6 100644 (file)
@@ -276,6 +276,10 @@ static const struct snd_soc_dai_driver tegra20_i2s_dai_template = {
        .symmetric_rates = 1,
 };
 
+static const struct snd_soc_component_driver tegra20_i2s_component = {
+       .name           = DRV_NAME,
+};
+
 static bool tegra20_i2s_wr_rd_reg(struct device *dev, unsigned int reg)
 {
        switch (reg) {
@@ -419,7 +423,8 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev)
                        goto err_pm_disable;
        }
 
-       ret = snd_soc_register_dai(&pdev->dev, &i2s->dai);
+       ret = snd_soc_register_component(&pdev->dev, &tegra20_i2s_component,
+                                        &i2s->dai, 1);
        if (ret) {
                dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
                ret = -ENOMEM;
@@ -429,13 +434,13 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev)
        ret = tegra_pcm_platform_register(&pdev->dev);
        if (ret) {
                dev_err(&pdev->dev, "Could not register PCM: %d\n", ret);
-               goto err_unregister_dai;
+               goto err_unregister_component;
        }
 
        return 0;
 
-err_unregister_dai:
-       snd_soc_unregister_dai(&pdev->dev);
+err_unregister_component:
+       snd_soc_unregister_component(&pdev->dev);
 err_suspend:
        if (!pm_runtime_status_suspended(&pdev->dev))
                tegra20_i2s_runtime_suspend(&pdev->dev);
@@ -456,7 +461,7 @@ static int tegra20_i2s_platform_remove(struct platform_device *pdev)
                tegra20_i2s_runtime_suspend(&pdev->dev);
 
        tegra_pcm_platform_unregister(&pdev->dev);
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        clk_put(i2s->clk_i2s);
 
index 04771d14d34342181932df8a5bccf07e19a5191b..6fce0be5eaa31e866d04ccdb8c41c4145c98fdec 100644 (file)
@@ -182,6 +182,10 @@ static struct snd_soc_dai_driver tegra20_spdif_dai = {
        .ops = &tegra20_spdif_dai_ops,
 };
 
+static const struct snd_soc_component_driver tegra20_spdif_component = {
+       .name           = DRV_NAME,
+};
+
 static bool tegra20_spdif_wr_rd_reg(struct device *dev, unsigned int reg)
 {
        switch (reg) {
@@ -329,7 +333,8 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev)
                        goto err_pm_disable;
        }
 
-       ret = snd_soc_register_dai(&pdev->dev, &tegra20_spdif_dai);
+       ret = snd_soc_register_component(&pdev->dev, &tegra20_spdif_component,
+                                  &tegra20_spdif_dai, 1);
        if (ret) {
                dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
                ret = -ENOMEM;
@@ -339,13 +344,13 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev)
        ret = tegra_pcm_platform_register(&pdev->dev);
        if (ret) {
                dev_err(&pdev->dev, "Could not register PCM: %d\n", ret);
-               goto err_unregister_dai;
+               goto err_unregister_component;
        }
 
        return 0;
 
-err_unregister_dai:
-       snd_soc_unregister_dai(&pdev->dev);
+err_unregister_component:
+       snd_soc_unregister_component(&pdev->dev);
 err_suspend:
        if (!pm_runtime_status_suspended(&pdev->dev))
                tegra20_spdif_runtime_suspend(&pdev->dev);
@@ -366,7 +371,7 @@ static int tegra20_spdif_platform_remove(struct platform_device *pdev)
                tegra20_spdif_runtime_suspend(&pdev->dev);
 
        tegra_pcm_platform_unregister(&pdev->dev);
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        clk_put(spdif->clk_spdif_out);
 
index f4e1ce82750abf1d8ae02f2389b52476ec7bccbd..f138d8fea9776508ae3416b307a1719c6f1635e9 100644 (file)
@@ -336,6 +336,10 @@ static const struct snd_soc_dai_driver tegra30_i2s_dai_template = {
        .symmetric_rates = 1,
 };
 
+static const struct snd_soc_component_driver tegra30_i2s_component = {
+       .name           = DRV_NAME,
+};
+
 static bool tegra30_i2s_wr_rd_reg(struct device *dev, unsigned int reg)
 {
        switch (reg) {
@@ -464,7 +468,8 @@ static int tegra30_i2s_platform_probe(struct platform_device *pdev)
                        goto err_pm_disable;
        }
 
-       ret = snd_soc_register_dai(&pdev->dev, &i2s->dai);
+       ret = snd_soc_register_component(&pdev->dev, &tegra30_i2s_component,
+                                  &i2s->dai, 1);
        if (ret) {
                dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
                ret = -ENOMEM;
@@ -474,13 +479,13 @@ static int tegra30_i2s_platform_probe(struct platform_device *pdev)
        ret = tegra_pcm_platform_register(&pdev->dev);
        if (ret) {
                dev_err(&pdev->dev, "Could not register PCM: %d\n", ret);
-               goto err_unregister_dai;
+               goto err_unregister_component;
        }
 
        return 0;
 
-err_unregister_dai:
-       snd_soc_unregister_dai(&pdev->dev);
+err_unregister_component:
+       snd_soc_unregister_component(&pdev->dev);
 err_suspend:
        if (!pm_runtime_status_suspended(&pdev->dev))
                tegra30_i2s_runtime_suspend(&pdev->dev);
@@ -501,7 +506,7 @@ static int tegra30_i2s_platform_remove(struct platform_device *pdev)
                tegra30_i2s_runtime_suspend(&pdev->dev);
 
        tegra_pcm_platform_unregister(&pdev->dev);
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
 
        clk_put(i2s->clk_i2s);
 
index 68d42403d9b5b871c0e2e54f32c1fe524cc6acb2..6839f88167d04c7d3d70b5d82a00e6c2f1a8b1d3 100644 (file)
@@ -55,7 +55,7 @@ static int tegra_wm9712_init(struct snd_soc_pcm_runtime *rtd)
 static struct snd_soc_dai_link tegra_wm9712_dai = {
        .name = "AC97 HiFi",
        .stream_name = "AC97 HiFi",
-       .cpu_dai_name = "tegra-ac97-pcm",
+       .cpu_dai_name = "tegra20-ac97",
        .codec_dai_name = "wm9712-hifi",
        .codec_name = "wm9712-codec",
        .init = tegra_wm9712_init,
index 16ab69635e2e209da6913b58e700a8b2eec0c00d..8a2840304d288e80cbce6e0b7946d354eaa8b1cb 100644 (file)
@@ -170,6 +170,10 @@ static struct snd_soc_dai_driver txx9aclc_ac97_dai = {
        },
 };
 
+static const struct snd_soc_component_driver txx9aclc_ac97_component = {
+       .name           = "txx9aclc-ac97",
+};
+
 static int txx9aclc_ac97_dev_probe(struct platform_device *pdev)
 {
        struct txx9aclc_plat_drvdata *drvdata;
@@ -205,12 +209,13 @@ static int txx9aclc_ac97_dev_probe(struct platform_device *pdev)
        if (err < 0)
                return err;
 
-       return snd_soc_register_dai(&pdev->dev, &txx9aclc_ac97_dai);
+       return snd_soc_register_component(&pdev->dev, &txx9aclc_ac97_component,
+                                         &txx9aclc_ac97_dai, 1);
 }
 
 static int txx9aclc_ac97_dev_remove(struct platform_device *pdev)
 {
-       snd_soc_unregister_dai(&pdev->dev);
+       snd_soc_unregister_component(&pdev->dev);
        return 0;
 }
 
index 94a3e5705aaa498495b16e0b50749b111e30f976..f1e8a5ecb00bb603d57206b5366fe2d2d2a38d53 100644 (file)
@@ -768,6 +768,11 @@ static struct snd_soc_dai_driver ux500_msp_dai_drv[UX500_NBR_OF_DAI] = {
        },
 };
 
+static const struct snd_soc_component_driver ux500_msp_component = {
+       .name           = "ux500-msp",
+};
+
+
 static int ux500_msp_drv_probe(struct platform_device *pdev)
 {
        struct ux500_msp_i2s_drvdata *drvdata;
@@ -825,8 +830,8 @@ static int ux500_msp_drv_probe(struct platform_device *pdev)
        }
        dev_set_drvdata(&pdev->dev, drvdata);
 
-       ret = snd_soc_register_dai(&pdev->dev,
-                               &ux500_msp_dai_drv[drvdata->msp->id]);
+       ret = snd_soc_register_component(&pdev->dev, &ux500_msp_component,
+                                        &ux500_msp_dai_drv[drvdata->msp->id], 1);
        if (ret < 0) {
                dev_err(&pdev->dev, "Error: %s: Failed to register MSP%d!\n",
                        __func__, drvdata->msp->id);
@@ -844,7 +849,7 @@ static int ux500_msp_drv_probe(struct platform_device *pdev)
        return 0;
 
 err_reg_plat:
-       snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(ux500_msp_dai_drv));
+       snd_soc_unregister_component(&pdev->dev);
 err_init_msp:
        clk_put(drvdata->clk);
 err_clk:
@@ -861,7 +866,7 @@ static int ux500_msp_drv_remove(struct platform_device *pdev)
 
        ux500_pcm_unregister_platform(pdev);
 
-       snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(ux500_msp_dai_drv));
+       snd_soc_unregister_component(&pdev->dev);
 
        devm_regulator_put(drvdata->reg_vape);
        prcmu_qos_remove_requirement(PRCMU_QOS_APE_OPP, "ux500_msp_i2s");