Commit 13419625 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branch 'asoc/topic/component' into asoc-next

parents 604c724b 89cab462
...@@ -95,14 +95,6 @@ struct snd_soc_dai_driver; ...@@ -95,14 +95,6 @@ struct snd_soc_dai_driver;
struct snd_soc_dai; struct snd_soc_dai;
struct snd_ac97_bus_ops; 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.*/ /* Digital Audio Interface clocking API.*/
int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
unsigned int freq, int dir); unsigned int freq, int dir);
......
...@@ -324,6 +324,8 @@ struct snd_soc_dai_link; ...@@ -324,6 +324,8 @@ struct snd_soc_dai_link;
struct snd_soc_platform_driver; struct snd_soc_platform_driver;
struct snd_soc_codec; struct snd_soc_codec;
struct snd_soc_codec_driver; struct snd_soc_codec_driver;
struct snd_soc_component;
struct snd_soc_component_driver;
struct soc_enum; struct soc_enum;
struct snd_soc_jack; struct snd_soc_jack;
struct snd_soc_jack_zone; struct snd_soc_jack_zone;
...@@ -377,6 +379,10 @@ int snd_soc_register_codec(struct device *dev, ...@@ -377,6 +379,10 @@ int snd_soc_register_codec(struct device *dev,
const struct snd_soc_codec_driver *codec_drv, const struct snd_soc_codec_driver *codec_drv,
struct snd_soc_dai_driver *dai_drv, int num_dai); struct snd_soc_dai_driver *dai_drv, int num_dai);
void snd_soc_unregister_codec(struct device *dev); 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, int snd_soc_codec_volatile_register(struct snd_soc_codec *codec,
unsigned int reg); unsigned int reg);
int snd_soc_codec_readable_register(struct snd_soc_codec *codec, int snd_soc_codec_readable_register(struct snd_soc_codec *codec,
...@@ -841,6 +847,20 @@ struct snd_soc_platform { ...@@ -841,6 +847,20 @@ struct snd_soc_platform {
#endif #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 { struct snd_soc_dai_link {
/* config - must be set by machine driver */ /* config - must be set by machine driver */
const char *name; /* Codec name */ const char *name; /* Codec name */
......
...@@ -750,13 +750,18 @@ static struct snd_soc_dai_driver atmel_ssc_dai = { ...@@ -750,13 +750,18 @@ static struct snd_soc_dai_driver atmel_ssc_dai = {
.ops = &atmel_ssc_dai_ops, .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) static int asoc_ssc_init(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct ssc_device *ssc = platform_get_drvdata(pdev); struct ssc_device *ssc = platform_get_drvdata(pdev);
int ret; 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) { if (ret) {
dev_err(dev, "Could not register DAI: %d\n", ret); dev_err(dev, "Could not register DAI: %d\n", ret);
goto err; goto err;
...@@ -775,7 +780,7 @@ static int asoc_ssc_init(struct device *dev) ...@@ -775,7 +780,7 @@ static int asoc_ssc_init(struct device *dev)
return 0; return 0;
err_unregister_dai: err_unregister_dai:
snd_soc_unregister_dai(dev); snd_soc_unregister_component(dev);
err: err:
return ret; return ret;
} }
...@@ -790,7 +795,7 @@ static void asoc_ssc_exit(struct device *dev) ...@@ -790,7 +795,7 @@ static void asoc_ssc_exit(struct device *dev)
else else
atmel_pcm_pdc_platform_unregister(dev); atmel_pcm_pdc_platform_unregister(dev);
snd_soc_unregister_dai(dev); snd_soc_unregister_component(dev);
} }
/** /**
......
...@@ -223,6 +223,10 @@ static struct snd_soc_dai_driver au1xac97c_dai_driver = { ...@@ -223,6 +223,10 @@ static struct snd_soc_dai_driver au1xac97c_dai_driver = {
.ops = &alchemy_ac97c_ops, .ops = &alchemy_ac97c_ops,
}; };
static const struct snd_soc_component_driver au1xac97c_component = {
.name = "au1xac97c",
};
static int au1xac97c_drvprobe(struct platform_device *pdev) static int au1xac97c_drvprobe(struct platform_device *pdev)
{ {
int ret; int ret;
...@@ -268,7 +272,8 @@ static int au1xac97c_drvprobe(struct platform_device *pdev) ...@@ -268,7 +272,8 @@ static int au1xac97c_drvprobe(struct platform_device *pdev)
platform_set_drvdata(pdev, ctx); 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) if (ret)
return ret; return ret;
...@@ -280,7 +285,7 @@ static int au1xac97c_drvremove(struct platform_device *pdev) ...@@ -280,7 +285,7 @@ static int au1xac97c_drvremove(struct platform_device *pdev)
{ {
struct au1xpsc_audio_data *ctx = platform_get_drvdata(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 */ WR(ctx, AC97_ENABLE, EN_D); /* clock off, disable */
......
...@@ -225,6 +225,10 @@ static struct snd_soc_dai_driver au1xi2s_dai_driver = { ...@@ -225,6 +225,10 @@ static struct snd_soc_dai_driver au1xi2s_dai_driver = {
.ops = &au1xi2s_dai_ops, .ops = &au1xi2s_dai_ops,
}; };
static const struct snd_soc_component_driver au1xi2s_component = {
.name = "au1xi2s",
};
static int au1xi2s_drvprobe(struct platform_device *pdev) static int au1xi2s_drvprobe(struct platform_device *pdev)
{ {
struct resource *iores, *dmares; struct resource *iores, *dmares;
...@@ -260,14 +264,15 @@ static int au1xi2s_drvprobe(struct platform_device *pdev) ...@@ -260,14 +264,15 @@ static int au1xi2s_drvprobe(struct platform_device *pdev)
platform_set_drvdata(pdev, ctx); 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) static int au1xi2s_drvremove(struct platform_device *pdev)
{ {
struct au1xpsc_audio_data *ctx = platform_get_drvdata(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 */ WR(ctx, I2S_ENABLE, EN_D); /* clock off, disable */
......
...@@ -361,6 +361,10 @@ static const struct snd_soc_dai_driver au1xpsc_ac97_dai_template = { ...@@ -361,6 +361,10 @@ static const struct snd_soc_dai_driver au1xpsc_ac97_dai_template = {
.ops = &au1xpsc_ac97_dai_ops, .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) static int au1xpsc_ac97_drvprobe(struct platform_device *pdev)
{ {
int ret; int ret;
...@@ -419,7 +423,8 @@ static int au1xpsc_ac97_drvprobe(struct platform_device *pdev) ...@@ -419,7 +423,8 @@ static int au1xpsc_ac97_drvprobe(struct platform_device *pdev)
platform_set_drvdata(pdev, wd); 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) if (ret)
return ret; return ret;
...@@ -431,7 +436,7 @@ static int au1xpsc_ac97_drvremove(struct platform_device *pdev) ...@@ -431,7 +436,7 @@ static int au1xpsc_ac97_drvremove(struct platform_device *pdev)
{ {
struct au1xpsc_audio_data *wd = platform_get_drvdata(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 */ /* disable PSC completely */
au_writel(0, AC97_CFG(wd)); au_writel(0, AC97_CFG(wd));
......
...@@ -288,6 +288,10 @@ static const struct snd_soc_dai_driver au1xpsc_i2s_dai_template = { ...@@ -288,6 +288,10 @@ static const struct snd_soc_dai_driver au1xpsc_i2s_dai_template = {
.ops = &au1xpsc_i2s_dai_ops, .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) static int au1xpsc_i2s_drvprobe(struct platform_device *pdev)
{ {
struct resource *iores, *dmares; struct resource *iores, *dmares;
...@@ -350,14 +354,15 @@ static int au1xpsc_i2s_drvprobe(struct platform_device *pdev) ...@@ -350,14 +354,15 @@ static int au1xpsc_i2s_drvprobe(struct platform_device *pdev)
platform_set_drvdata(pdev, wd); 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) static int au1xpsc_i2s_drvremove(struct platform_device *pdev)
{ {
struct au1xpsc_audio_data *wd = platform_get_drvdata(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_writel(0, I2S_CFG(wd));
au_sync(); au_sync();
......
...@@ -282,6 +282,10 @@ static struct snd_soc_dai_driver bfin_ac97_dai = { ...@@ -282,6 +282,10 @@ static struct snd_soc_dai_driver bfin_ac97_dai = {
.formats = SNDRV_PCM_FMTBIT_S16_LE, }, .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) static int asoc_bfin_ac97_probe(struct platform_device *pdev)
{ {
struct sport_device *sport_handle; struct sport_device *sport_handle;
...@@ -331,7 +335,8 @@ static int asoc_bfin_ac97_probe(struct platform_device *pdev) ...@@ -331,7 +335,8 @@ static int asoc_bfin_ac97_probe(struct platform_device *pdev)
goto sport_config_err; 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) { if (ret) {
pr_err("Failed to register DAI: %d\n", ret); pr_err("Failed to register DAI: %d\n", ret);
goto sport_config_err; goto sport_config_err;
...@@ -356,7 +361,7 @@ static int asoc_bfin_ac97_remove(struct platform_device *pdev) ...@@ -356,7 +361,7 @@ static int asoc_bfin_ac97_remove(struct platform_device *pdev)
{ {
struct sport_device *sport_handle = platform_get_drvdata(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); sport_done(sport_handle);
#ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET #ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET
gpio_free(CONFIG_SND_BF5XX_RESET_GPIO_NUM); gpio_free(CONFIG_SND_BF5XX_RESET_GPIO_NUM);
......
...@@ -245,6 +245,10 @@ static struct snd_soc_dai_driver bf5xx_i2s_dai = { ...@@ -245,6 +245,10 @@ static struct snd_soc_dai_driver bf5xx_i2s_dai = {
.ops = &bf5xx_i2s_dai_ops, .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) static int bf5xx_i2s_probe(struct platform_device *pdev)
{ {
struct sport_device *sport_handle; struct sport_device *sport_handle;
...@@ -257,7 +261,8 @@ static int bf5xx_i2s_probe(struct platform_device *pdev) ...@@ -257,7 +261,8 @@ static int bf5xx_i2s_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
/* register with the ASoC layers */ /* 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) { if (ret) {
pr_err("Failed to register DAI: %d\n", ret); pr_err("Failed to register DAI: %d\n", ret);
sport_done(sport_handle); sport_done(sport_handle);
...@@ -273,7 +278,7 @@ static int bf5xx_i2s_remove(struct platform_device *pdev) ...@@ -273,7 +278,7 @@ static int bf5xx_i2s_remove(struct platform_device *pdev)
pr_debug("%s enter\n", __func__); pr_debug("%s enter\n", __func__);
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
sport_done(sport_handle); sport_done(sport_handle);
return 0; return 0;
......
...@@ -249,6 +249,10 @@ static struct snd_soc_dai_driver bf5xx_tdm_dai = { ...@@ -249,6 +249,10 @@ static struct snd_soc_dai_driver bf5xx_tdm_dai = {
.ops = &bf5xx_tdm_dai_ops, .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) static int bfin_tdm_probe(struct platform_device *pdev)
{ {
struct sport_device *sport_handle; struct sport_device *sport_handle;
...@@ -282,7 +286,8 @@ static int bfin_tdm_probe(struct platform_device *pdev) ...@@ -282,7 +286,8 @@ static int bfin_tdm_probe(struct platform_device *pdev)
goto sport_config_err; 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) { if (ret) {
pr_err("Failed to register DAI: %d\n", ret); pr_err("Failed to register DAI: %d\n", ret);
goto sport_config_err; goto sport_config_err;
...@@ -299,7 +304,7 @@ static int bfin_tdm_remove(struct platform_device *pdev) ...@@ -299,7 +304,7 @@ static int bfin_tdm_remove(struct platform_device *pdev)
{ {
struct sport_device *sport_handle = platform_get_drvdata(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); sport_done(sport_handle);
return 0; return 0;
......
...@@ -186,6 +186,10 @@ static struct snd_soc_dai_driver bfin_i2s_dai = { ...@@ -186,6 +186,10 @@ static struct snd_soc_dai_driver bfin_i2s_dai = {
.ops = &bfin_i2s_dai_ops, .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) static int bfin_i2s_probe(struct platform_device *pdev)
{ {
struct sport_device *sport; struct sport_device *sport;
...@@ -197,7 +201,8 @@ static int bfin_i2s_probe(struct platform_device *pdev) ...@@ -197,7 +201,8 @@ static int bfin_i2s_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
/* register with the ASoC layers */ /* 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) { if (ret) {
dev_err(dev, "Failed to register DAI: %d\n", ret); dev_err(dev, "Failed to register DAI: %d\n", ret);
sport_delete(sport); sport_delete(sport);
...@@ -212,7 +217,7 @@ static int bfin_i2s_remove(struct platform_device *pdev) ...@@ -212,7 +217,7 @@ static int bfin_i2s_remove(struct platform_device *pdev)
{ {
struct sport_device *sport = platform_get_drvdata(pdev); struct sport_device *sport = platform_get_drvdata(pdev);
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
sport_delete(sport); sport_delete(sport);
return 0; return 0;
......
...@@ -353,6 +353,10 @@ static struct snd_soc_dai_driver ep93xx_ac97_dai = { ...@@ -353,6 +353,10 @@ static struct snd_soc_dai_driver ep93xx_ac97_dai = {
.ops = &ep93xx_ac97_dai_ops, .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) static int ep93xx_ac97_probe(struct platform_device *pdev)
{ {
struct ep93xx_ac97_info *info; struct ep93xx_ac97_info *info;
...@@ -390,7 +394,8 @@ static int ep93xx_ac97_probe(struct platform_device *pdev) ...@@ -390,7 +394,8 @@ static int ep93xx_ac97_probe(struct platform_device *pdev)
ep93xx_ac97_info = info; ep93xx_ac97_info = info;
platform_set_drvdata(pdev, 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) if (ret)
goto fail; goto fail;
...@@ -407,7 +412,7 @@ static int ep93xx_ac97_remove(struct platform_device *pdev) ...@@ -407,7 +412,7 @@ static int ep93xx_ac97_remove(struct platform_device *pdev)
{ {
struct ep93xx_ac97_info *info = platform_get_drvdata(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 */ /* disable the AC97 controller */
ep93xx_ac97_write_reg(info, AC97GCR, 0); ep93xx_ac97_write_reg(info, AC97GCR, 0);
......
...@@ -366,6 +366,10 @@ static struct snd_soc_dai_driver ep93xx_i2s_dai = { ...@@ -366,6 +366,10 @@ static struct snd_soc_dai_driver ep93xx_i2s_dai = {
.ops = &ep93xx_i2s_dai_ops, .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) static int ep93xx_i2s_probe(struct platform_device *pdev)
{ {
struct ep93xx_i2s_info *info; struct ep93xx_i2s_info *info;
...@@ -405,7 +409,8 @@ static int ep93xx_i2s_probe(struct platform_device *pdev) ...@@ -405,7 +409,8 @@ static int ep93xx_i2s_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, info); dev_set_drvdata(&pdev->dev, info);
info->dma_params = ep93xx_i2s_dma_params; 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) if (err)
goto fail_put_lrclk; goto fail_put_lrclk;
...@@ -426,7 +431,7 @@ static int ep93xx_i2s_remove(struct platform_device *pdev) ...@@ -426,7 +431,7 @@ static int ep93xx_i2s_remove(struct platform_device *pdev)
{ {
struct ep93xx_i2s_info *info = dev_get_drvdata(&pdev->dev); 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); dev_set_drvdata(&pdev->dev, NULL);
clk_put(info->lrclk); clk_put(info->lrclk);
clk_put(info->sclk); clk_put(info->sclk);
......
...@@ -645,6 +645,10 @@ static struct snd_soc_dai_driver davinci_i2s_dai = { ...@@ -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) static int davinci_i2s_probe(struct platform_device *pdev)
{ {
struct snd_platform_data *pdata = pdev->dev.platform_data; struct snd_platform_data *pdata = pdev->dev.platform_data;
...@@ -727,20 +731,21 @@ static int davinci_i2s_probe(struct platform_device *pdev) ...@@ -727,20 +731,21 @@ static int davinci_i2s_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, dev); 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) if (ret != 0)
goto err_release_clk; goto err_release_clk;
ret = davinci_soc_platform_register(&pdev->dev); ret = davinci_soc_platform_register(&pdev->dev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "register PCM failed: %d\n", ret); dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
goto err_unregister_dai; goto err_unregister_component;
} }
return 0; return 0;
err_unregister_dai: err_unregister_component:
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
err_release_clk: err_release_clk:
clk_disable(dev->clk); clk_disable(dev->clk);
clk_put(dev->clk); clk_put(dev->clk);
...@@ -751,7 +756,7 @@ static int davinci_i2s_remove(struct platform_device *pdev) ...@@ -751,7 +756,7 @@ static int davinci_i2s_remove(struct platform_device *pdev)
{ {
struct davinci_mcbsp_dev *dev = dev_get_drvdata(&pdev->dev); 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); davinci_soc_platform_unregister(&pdev->dev);
clk_disable(dev->clk); clk_disable(dev->clk);
......
...@@ -962,6 +962,10 @@ static struct snd_soc_dai_driver davinci_mcasp_dai[] = { ...@@ -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[] = { static const struct of_device_id mcasp_dt_ids[] = {
{ {
.compatible = "ti,dm646x-mcasp-audio", .compatible = "ti,dm646x-mcasp-audio",
...@@ -1170,7 +1174,8 @@ static int davinci_mcasp_probe(struct platform_device *pdev) ...@@ -1170,7 +1174,8 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
dma_data->channel = res->start; dma_data->channel = res->start;
dev_set_drvdata(&pdev->dev, dev); 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) if (ret != 0)
goto err_release_clk; goto err_release_clk;
...@@ -1178,13 +1183,13 @@ static int davinci_mcasp_probe(struct platform_device *pdev) ...@@ -1178,13 +1183,13 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
ret = davinci_soc_platform_register(&pdev->dev); ret = davinci_soc_platform_register(&pdev->dev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "register PCM failed: %d\n", ret); dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
goto err_unregister_dai; goto err_unregister_component;
} }
return 0; return 0;
err_unregister_dai: err_unregister_component:
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
err_release_clk: err_release_clk:
pm_runtime_put_sync(&pdev->dev); pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
...@@ -1194,7 +1199,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) ...@@ -1194,7 +1199,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
static int davinci_mcasp_remove(struct platform_device *pdev) 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); davinci_soc_platform_unregister(&pdev->dev);
pm_runtime_put_sync(&pdev->dev); pm_runtime_put_sync(&pdev->dev);
......
...@@ -204,6 +204,10 @@ static struct snd_soc_dai_driver davinci_vcif_dai = { ...@@ -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) static int davinci_vcif_probe(struct platform_device *pdev)
{ {
struct davinci_vc *davinci_vc = pdev->dev.platform_data; struct davinci_vc *davinci_vc = pdev->dev.platform_data;
...@@ -234,7 +238,8 @@ static int davinci_vcif_probe(struct platform_device *pdev) ...@@ -234,7 +238,8 @@ static int davinci_vcif_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, davinci_vcif_dev); 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) { if (ret != 0) {
dev_err(&pdev->dev, "could not register dai\n"); dev_err(&pdev->dev, "could not register dai\n");
return ret; return ret;
...@@ -243,7 +248,7 @@ static int davinci_vcif_probe(struct platform_device *pdev) ...@@ -243,7 +248,7 @@ static int davinci_vcif_probe(struct platform_device *pdev)
ret = davinci_soc_platform_register(&pdev->dev); ret = davinci_soc_platform_register(&pdev->dev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "register PCM failed: %d\n", 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; return ret;
} }
...@@ -252,7 +257,7 @@ static int davinci_vcif_probe(struct platform_device *pdev) ...@@ -252,7 +257,7 @@ static int davinci_vcif_probe(struct platform_device *pdev)
static int davinci_vcif_remove(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); davinci_soc_platform_unregister(&pdev->dev);
return 0; return 0;
......
...@@ -297,6 +297,10 @@ static struct snd_soc_dai_ops dw_i2s_dai_ops = { ...@@ -297,6 +297,10 @@ static struct snd_soc_dai_ops dw_i2s_dai_ops = {
.trigger = dw_i2s_trigger, .trigger = dw_i2s_trigger,
}; };
static const struct snd_soc_component_driver dw_i2s_component = {
.name = "dw-i2s",
};
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int dw_i2s_suspend(struct snd_soc_dai *dai) static int dw_i2s_suspend(struct snd_soc_dai *dai)
...@@ -413,7 +417,8 @@ static int dw_i2s_probe(struct platform_device *pdev) ...@@ -413,7 +417,8 @@ static int dw_i2s_probe(struct platform_device *pdev)
dev->dev = &pdev->dev; dev->dev = &pdev->dev;
dev_set_drvdata(&pdev->dev, 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) { if (ret != 0) {
dev_err(&pdev->dev, "not able to register dai\n"); dev_err(&pdev->dev, "not able to register dai\n");
goto err_set_drvdata; goto err_set_drvdata;
...@@ -434,7 +439,7 @@ static int dw_i2s_remove(struct platform_device *pdev) ...@@ -434,7 +439,7 @@ static int dw_i2s_remove(struct platform_device *pdev)
{ {
struct dw_i2s_dev *dev = dev_get_drvdata(&pdev->dev); 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); dev_set_drvdata(&pdev->dev, NULL);
clk_put(dev->clk); clk_put(dev->clk);
......
...@@ -574,6 +574,10 @@ static struct snd_soc_dai_driver fsl_ssi_dai_template = { ...@@ -574,6 +574,10 @@ static struct snd_soc_dai_driver fsl_ssi_dai_template = {
.ops = &fsl_ssi_dai_ops, .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 /* 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 * compiler will optimze this code to a no-op if the interrupt is not
* enabled. * enabled.
...@@ -782,7 +786,8 @@ static int fsl_ssi_probe(struct platform_device *pdev) ...@@ -782,7 +786,8 @@ static int fsl_ssi_probe(struct platform_device *pdev)
/* Register with ASoC */ /* Register with ASoC */
dev_set_drvdata(&pdev->dev, ssi_private); 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) { if (ret) {
dev_err(&pdev->dev, "failed to register DAI: %d\n", ret); dev_err(&pdev->dev, "failed to register DAI: %d\n", ret);
goto error_dev; goto error_dev;
...@@ -835,7 +840,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) ...@@ -835,7 +840,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
error_dai: error_dai:
if (ssi_private->ssi_on_imx) if (ssi_private->ssi_on_imx)
platform_device_unregister(ssi_private->imx_pcm_pdev); platform_device_unregister(ssi_private->imx_pcm_pdev);
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
error_dev: error_dev:
dev_set_drvdata(&pdev->dev, NULL); dev_set_drvdata(&pdev->dev, NULL);
...@@ -873,7 +878,7 @@ static int fsl_ssi_remove(struct platform_device *pdev) ...@@ -873,7 +878,7 @@ static int fsl_ssi_remove(struct platform_device *pdev)
clk_disable_unprepare(ssi_private->clk); clk_disable_unprepare(ssi_private->clk);
clk_put(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); device_remove_file(&pdev->dev, &ssi_private->dev_attr);
free_irq(ssi_private->irq, ssi_private); free_irq(ssi_private->irq, ssi_private);
......
...@@ -413,6 +413,10 @@ static struct snd_soc_dai_driver imx_ac97_dai = { ...@@ -413,6 +413,10 @@ static struct snd_soc_dai_driver imx_ac97_dai = {
.ops = &imx_ssi_pcm_dai_ops, .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) static void setup_channel_to_ac97(struct imx_ssi *imx_ssi)
{ {
void __iomem *base = imx_ssi->base; void __iomem *base = imx_ssi->base;
...@@ -591,7 +595,8 @@ static int imx_ssi_probe(struct platform_device *pdev) ...@@ -591,7 +595,8 @@ static int imx_ssi_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ssi); 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) { if (ret) {
dev_err(&pdev->dev, "register DAI failed\n"); dev_err(&pdev->dev, "register DAI failed\n");
goto failed_register; goto failed_register;
...@@ -632,7 +637,7 @@ static int imx_ssi_probe(struct platform_device *pdev) ...@@ -632,7 +637,7 @@ static int imx_ssi_probe(struct platform_device *pdev)
failed_pdev_fiq_add: failed_pdev_fiq_add:
platform_device_put(ssi->soc_platform_pdev_fiq); platform_device_put(ssi->soc_platform_pdev_fiq);
failed_pdev_fiq_alloc: failed_pdev_fiq_alloc:
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
failed_register: failed_register:
release_mem_region(res->start, resource_size(res)); release_mem_region(res->start, resource_size(res));
failed_get_resource: failed_get_resource:
...@@ -650,7 +655,7 @@ static int imx_ssi_remove(struct platform_device *pdev) ...@@ -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);
platform_device_unregister(ssi->soc_platform_pdev_fiq); 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) if (ssi->flags & IMX_SSI_USE_AC97)
ac97_ssi = NULL; ac97_ssi = NULL;
......
...@@ -270,6 +270,9 @@ static struct snd_soc_dai_driver psc_ac97_dai[] = { ...@@ -270,6 +270,9 @@ static struct snd_soc_dai_driver psc_ac97_dai[] = {
.ops = &psc_ac97_digital_ops, .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) ...@@ -287,7 +290,8 @@ static int psc_ac97_of_probe(struct platform_device *op)
if (rc != 0) if (rc != 0)
return rc; 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) { if (rc != 0) {
dev_err(&op->dev, "Failed to register DAI\n"); dev_err(&op->dev, "Failed to register DAI\n");
return rc; return rc;
...@@ -313,7 +317,7 @@ static int psc_ac97_of_probe(struct platform_device *op) ...@@ -313,7 +317,7 @@ static int psc_ac97_of_probe(struct platform_device *op)
static int psc_ac97_of_remove(struct platform_device *op) static int psc_ac97_of_remove(struct platform_device *op)
{ {
mpc5200_audio_dma_destroy(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; return 0;
} }
......
...@@ -148,6 +148,10 @@ static struct snd_soc_dai_driver psc_i2s_dai[] = {{ ...@@ -148,6 +148,10 @@ static struct snd_soc_dai_driver psc_i2s_dai[] = {{
.ops = &psc_i2s_dai_ops, .ops = &psc_i2s_dai_ops,
} }; } };
static const struct snd_soc_component_driver psc_i2s_component = {
.name = "mpc5200-i2s",
};
/* --------------------------------------------------------------------- /* ---------------------------------------------------------------------
* OF platform bus binding code: * OF platform bus binding code:
* - Probe/remove operations * - Probe/remove operations
...@@ -163,7 +167,8 @@ static int psc_i2s_of_probe(struct platform_device *op) ...@@ -163,7 +167,8 @@ static int psc_i2s_of_probe(struct platform_device *op)
if (rc != 0) if (rc != 0)
return rc; 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) { if (rc != 0) {
pr_err("Failed to register DAI\n"); pr_err("Failed to register DAI\n");
return rc; return rc;
...@@ -208,7 +213,7 @@ static int psc_i2s_of_probe(struct platform_device *op) ...@@ -208,7 +213,7 @@ static int psc_i2s_of_probe(struct platform_device *op)
static int psc_i2s_of_remove(struct platform_device *op) static int psc_i2s_of_remove(struct platform_device *op)
{ {
mpc5200_audio_dma_destroy(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; return 0;
} }
......
...@@ -425,6 +425,10 @@ static struct snd_soc_dai_driver jz4740_i2s_dai = { ...@@ -425,6 +425,10 @@ static struct snd_soc_dai_driver jz4740_i2s_dai = {
.resume = jz4740_i2s_resume, .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) static int jz4740_i2s_dev_probe(struct platform_device *pdev)
{ {
struct jz4740_i2s *i2s; struct jz4740_i2s *i2s;
...@@ -469,7 +473,8 @@ static int jz4740_i2s_dev_probe(struct platform_device *pdev) ...@@ -469,7 +473,8 @@ static int jz4740_i2s_dev_probe(struct platform_device *pdev)
} }
platform_set_drvdata(pdev, i2s); 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) { if (ret) {
dev_err(&pdev->dev, "Failed to register DAI\n"); dev_err(&pdev->dev, "Failed to register DAI\n");
...@@ -496,7 +501,7 @@ static int jz4740_i2s_dev_remove(struct platform_device *pdev) ...@@ -496,7 +501,7 @@ static int jz4740_i2s_dev_remove(struct platform_device *pdev)
{ {
struct jz4740_i2s *i2s = platform_get_drvdata(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_i2s);
clk_put(i2s->clk_aic); clk_put(i2s->clk_aic);
......
...@@ -451,6 +451,10 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai_extclk = { ...@@ -451,6 +451,10 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai_extclk = {
.ops = &kirkwood_i2s_dai_ops, .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) static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
{ {
struct kirkwood_asoc_platform_data *data = pdev->dev.platform_data; struct kirkwood_asoc_platform_data *data = pdev->dev.platform_data;
...@@ -524,10 +528,11 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev) ...@@ -524,10 +528,11 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_128; 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) if (!err)
return 0; 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)) { if (!IS_ERR(priv->extclk)) {
clk_disable_unprepare(priv->extclk); clk_disable_unprepare(priv->extclk);
...@@ -542,7 +547,7 @@ static int kirkwood_i2s_dev_remove(struct platform_device *pdev) ...@@ -542,7 +547,7 @@ static int kirkwood_i2s_dev_remove(struct platform_device *pdev)
{ {
struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev); 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)) { if (!IS_ERR(priv->extclk)) {
clk_disable_unprepare(priv->extclk); clk_disable_unprepare(priv->extclk);
......
...@@ -165,6 +165,10 @@ static struct snd_soc_dai_driver sst_platform_dai[] = { ...@@ -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 */ /* helper functions */
static inline void sst_set_stream_status(struct sst_runtime_stream *stream, static inline void sst_set_stream_status(struct sst_runtime_stream *stream,
int state) int state)
...@@ -683,7 +687,7 @@ static int sst_platform_probe(struct platform_device *pdev) ...@@ -683,7 +687,7 @@ static int sst_platform_probe(struct platform_device *pdev)
return ret; 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)); sst_platform_dai, ARRAY_SIZE(sst_platform_dai));
if (ret) { if (ret) {
pr_err("registering cpu dais failed\n"); pr_err("registering cpu dais failed\n");
...@@ -695,7 +699,7 @@ static int sst_platform_probe(struct platform_device *pdev) ...@@ -695,7 +699,7 @@ static int sst_platform_probe(struct platform_device *pdev)
static int sst_platform_remove(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); snd_soc_unregister_platform(&pdev->dev);
pr_debug("sst_platform_remove success\n"); pr_debug("sst_platform_remove success\n");
return 0; return 0;
......
...@@ -627,6 +627,10 @@ static struct snd_soc_dai_driver mxs_saif_dai = { ...@@ -627,6 +627,10 @@ static struct snd_soc_dai_driver mxs_saif_dai = {
.ops = &mxs_saif_dai_ops, .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) static irqreturn_t mxs_saif_irq(int irq, void *dev_id)
{ {
struct mxs_saif *saif = dev_id; struct mxs_saif *saif = dev_id;
...@@ -763,7 +767,8 @@ static int mxs_saif_probe(struct platform_device *pdev) ...@@ -763,7 +767,8 @@ static int mxs_saif_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, saif); 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) { if (ret) {
dev_err(&pdev->dev, "register DAI failed\n"); dev_err(&pdev->dev, "register DAI failed\n");
return ret; return ret;
...@@ -778,7 +783,7 @@ static int mxs_saif_probe(struct platform_device *pdev) ...@@ -778,7 +783,7 @@ static int mxs_saif_probe(struct platform_device *pdev)
return 0; return 0;
failed_pdev_alloc: failed_pdev_alloc:
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
return ret; return ret;
} }
...@@ -786,7 +791,7 @@ static int mxs_saif_probe(struct platform_device *pdev) ...@@ -786,7 +791,7 @@ static int mxs_saif_probe(struct platform_device *pdev)
static int mxs_saif_remove(struct platform_device *pdev) static int mxs_saif_remove(struct platform_device *pdev)
{ {
mxs_pcm_platform_unregister(&pdev->dev); mxs_pcm_platform_unregister(&pdev->dev);
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
return 0; return 0;
} }
......
...@@ -314,6 +314,10 @@ static struct snd_soc_dai_driver nuc900_ac97_dai = { ...@@ -314,6 +314,10 @@ static struct snd_soc_dai_driver nuc900_ac97_dai = {
.ops = &nuc900_ac97_dai_ops, .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) static int nuc900_ac97_drvprobe(struct platform_device *pdev)
{ {
struct nuc900_audio *nuc900_audio; struct nuc900_audio *nuc900_audio;
...@@ -361,7 +365,8 @@ static int nuc900_ac97_drvprobe(struct platform_device *pdev) ...@@ -361,7 +365,8 @@ static int nuc900_ac97_drvprobe(struct platform_device *pdev)
nuc900_ac97_data = nuc900_audio; 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) if (ret)
goto out3; goto out3;
...@@ -384,7 +389,7 @@ static int nuc900_ac97_drvprobe(struct platform_device *pdev) ...@@ -384,7 +389,7 @@ static int nuc900_ac97_drvprobe(struct platform_device *pdev)
static int nuc900_ac97_drvremove(struct platform_device *pdev) 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); clk_put(nuc900_ac97_data->clk);
iounmap(nuc900_ac97_data->mmio); iounmap(nuc900_ac97_data->mmio);
......
...@@ -448,6 +448,10 @@ static struct snd_soc_dai_driver omap_dmic_dai = { ...@@ -448,6 +448,10 @@ static struct snd_soc_dai_driver omap_dmic_dai = {
.ops = &omap_dmic_dai_ops, .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) static int asoc_dmic_probe(struct platform_device *pdev)
{ {
struct omap_dmic *dmic; struct omap_dmic *dmic;
...@@ -507,7 +511,8 @@ static int asoc_dmic_probe(struct platform_device *pdev) ...@@ -507,7 +511,8 @@ static int asoc_dmic_probe(struct platform_device *pdev)
goto err_put_clk; 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) if (ret)
goto err_put_clk; goto err_put_clk;
...@@ -522,7 +527,7 @@ static int asoc_dmic_remove(struct platform_device *pdev) ...@@ -522,7 +527,7 @@ static int asoc_dmic_remove(struct platform_device *pdev)
{ {
struct omap_dmic *dmic = platform_get_drvdata(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); clk_put(dmic->fclk);
return 0; return 0;
......
...@@ -264,6 +264,10 @@ static struct snd_soc_dai_driver omap_hdmi_dai = { ...@@ -264,6 +264,10 @@ static struct snd_soc_dai_driver omap_hdmi_dai = {
.ops = &omap_hdmi_dai_ops, .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) static int omap_hdmi_probe(struct platform_device *pdev)
{ {
int ret; int ret;
...@@ -321,7 +325,8 @@ static int omap_hdmi_probe(struct platform_device *pdev) ...@@ -321,7 +325,8 @@ static int omap_hdmi_probe(struct platform_device *pdev)
} }
dev_set_drvdata(&pdev->dev, hdmi_data); 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; return ret;
} }
...@@ -330,7 +335,7 @@ static int omap_hdmi_remove(struct platform_device *pdev) ...@@ -330,7 +335,7 @@ static int omap_hdmi_remove(struct platform_device *pdev)
{ {
struct hdmi_priv *hdmi_data = dev_get_drvdata(&pdev->dev); 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) { if (hdmi_data == NULL) {
dev_err(&pdev->dev, "cannot obtain HDMi data\n"); dev_err(&pdev->dev, "cannot obtain HDMi data\n");
......
...@@ -586,6 +586,10 @@ static struct snd_soc_dai_driver omap_mcbsp_dai = { ...@@ -586,6 +586,10 @@ static struct snd_soc_dai_driver omap_mcbsp_dai = {
.ops = &mcbsp_dai_ops, .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, static int omap_mcbsp_st_info_volsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) struct snd_ctl_elem_info *uinfo)
{ {
...@@ -793,7 +797,8 @@ static int asoc_mcbsp_probe(struct platform_device *pdev) ...@@ -793,7 +797,8 @@ static int asoc_mcbsp_probe(struct platform_device *pdev)
ret = omap_mcbsp_init(pdev); ret = omap_mcbsp_init(pdev);
if (!ret) 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; return ret;
} }
...@@ -802,7 +807,7 @@ static int asoc_mcbsp_remove(struct platform_device *pdev) ...@@ -802,7 +807,7 @@ static int asoc_mcbsp_remove(struct platform_device *pdev)
{ {
struct omap_mcbsp *mcbsp = platform_get_drvdata(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) if (mcbsp->pdata->ops && mcbsp->pdata->ops->free)
mcbsp->pdata->ops->free(mcbsp->id); mcbsp->pdata->ops->free(mcbsp->id);
......
...@@ -420,6 +420,10 @@ static struct snd_soc_dai_driver omap_mcpdm_dai = { ...@@ -420,6 +420,10 @@ static struct snd_soc_dai_driver omap_mcpdm_dai = {
.ops = &omap_mcpdm_dai_ops, .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, void omap_mcpdm_configure_dn_offsets(struct snd_soc_pcm_runtime *rtd,
u8 rx1, u8 rx2) u8 rx1, u8 rx2)
{ {
...@@ -480,12 +484,13 @@ static int asoc_mcpdm_probe(struct platform_device *pdev) ...@@ -480,12 +484,13 @@ static int asoc_mcpdm_probe(struct platform_device *pdev)
mcpdm->dev = &pdev->dev; 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) static int asoc_mcpdm_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
return 0; return 0;
} }
......
...@@ -405,6 +405,10 @@ struct snd_soc_dai_driver mmp_sspa_dai = { ...@@ -405,6 +405,10 @@ struct snd_soc_dai_driver mmp_sspa_dai = {
.ops = &mmp_sspa_dai_ops, .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) static int asoc_mmp_sspa_probe(struct platform_device *pdev)
{ {
struct sspa_priv *priv; struct sspa_priv *priv;
...@@ -450,7 +454,8 @@ static int asoc_mmp_sspa_probe(struct platform_device *pdev) ...@@ -450,7 +454,8 @@ static int asoc_mmp_sspa_probe(struct platform_device *pdev)
priv->dai_fmt = (unsigned int) -1; priv->dai_fmt = (unsigned int) -1;
platform_set_drvdata(pdev, priv); 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) static int asoc_mmp_sspa_remove(struct platform_device *pdev)
...@@ -460,7 +465,7 @@ 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_disable(priv->audio_clk);
clk_put(priv->audio_clk); clk_put(priv->audio_clk);
clk_put(priv->sysclk); clk_put(priv->sysclk);
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
return 0; return 0;
} }
......
...@@ -794,14 +794,19 @@ static struct snd_soc_dai_driver pxa_ssp_dai = { ...@@ -794,14 +794,19 @@ static struct snd_soc_dai_driver pxa_ssp_dai = {
.ops = &pxa_ssp_dai_ops, .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) 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) static int asoc_ssp_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
return 0; return 0;
} }
......
...@@ -47,6 +47,7 @@ struct snd_ac97_bus_ops soc_ac97_ops = { ...@@ -47,6 +47,7 @@ struct snd_ac97_bus_ops soc_ac97_ops = {
.warm_reset = pxa2xx_ac97_warm_reset, .warm_reset = pxa2xx_ac97_warm_reset,
.reset = pxa2xx_ac97_cold_reset, .reset = pxa2xx_ac97_cold_reset,
}; };
EXPORT_SYMBOL_GPL(soc_ac97_ops);
static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_stereo_out = { static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_stereo_out = {
.name = "AC97 PCM Stereo out", .name = "AC97 PCM Stereo out",
...@@ -232,7 +233,9 @@ static struct snd_soc_dai_driver pxa_ac97_dai_driver[] = { ...@@ -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) static int pxa2xx_ac97_dev_probe(struct platform_device *pdev)
{ {
...@@ -245,13 +248,13 @@ 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 * driver to do interesting things with the clocking to get us up
* and running. * and running.
*/ */
return snd_soc_register_dais(&pdev->dev, pxa_ac97_dai_driver, return snd_soc_register_component(&pdev->dev, &pxa_ac97_component,
ARRAY_SIZE(pxa_ac97_dai_driver)); pxa_ac97_dai_driver, ARRAY_SIZE(pxa_ac97_dai_driver));
} }
static int pxa2xx_ac97_dev_remove(struct platform_device *pdev) 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; return 0;
} }
......
...@@ -360,14 +360,19 @@ static struct snd_soc_dai_driver pxa_i2s_dai = { ...@@ -360,14 +360,19 @@ static struct snd_soc_dai_driver pxa_i2s_dai = {
.symmetric_rates = 1, .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) 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) static int pxa2xx_i2s_drv_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
return 0; return 0;
} }
......
...@@ -436,6 +436,10 @@ static struct snd_soc_dai_driver s6000_i2s_dai = { ...@@ -436,6 +436,10 @@ static struct snd_soc_dai_driver s6000_i2s_dai = {
.ops = &s6000_i2s_dai_ops, .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) static int s6000_i2s_probe(struct platform_device *pdev)
{ {
struct s6000_i2s_dev *dev; struct s6000_i2s_dev *dev;
...@@ -543,7 +547,8 @@ static int s6000_i2s_probe(struct platform_device *pdev) ...@@ -543,7 +547,8 @@ static int s6000_i2s_probe(struct platform_device *pdev)
S6_I2S_INT_UNDERRUN | S6_I2S_INT_UNDERRUN |
S6_I2S_INT_OVERRUN); 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) if (ret)
goto err_release_dev; goto err_release_dev;
...@@ -572,7 +577,7 @@ static void s6000_i2s_remove(struct platform_device *pdev) ...@@ -572,7 +577,7 @@ static void s6000_i2s_remove(struct platform_device *pdev)
struct resource *region; struct resource *region;
void __iomem *mmio = dev->scbbase; 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, 0);
s6000_i2s_stop_channel(dev, 1); s6000_i2s_stop_channel(dev, 1);
......
...@@ -370,6 +370,10 @@ static struct snd_soc_dai_driver s3c_ac97_dai[] = { ...@@ -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) static int s3c_ac97_probe(struct platform_device *pdev)
{ {
struct resource *mem_res, *dmatx_res, *dmarx_res, *dmamic_res, *irq_res; 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) ...@@ -457,8 +461,8 @@ static int s3c_ac97_probe(struct platform_device *pdev)
goto err4; goto err4;
} }
ret = snd_soc_register_dais(&pdev->dev, s3c_ac97_dai, ret = snd_soc_register_component(&pdev->dev, &s3c_ac97_component,
ARRAY_SIZE(s3c_ac97_dai)); s3c_ac97_dai, ARRAY_SIZE(s3c_ac97_dai));
if (ret) if (ret)
goto err5; goto err5;
...@@ -470,7 +474,7 @@ static int s3c_ac97_probe(struct platform_device *pdev) ...@@ -470,7 +474,7 @@ static int s3c_ac97_probe(struct platform_device *pdev)
return 0; return 0;
err6: err6:
snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(s3c_ac97_dai)); snd_soc_unregister_component(&pdev->dev);
err5: err5:
free_irq(irq_res->start, NULL); free_irq(irq_res->start, NULL);
err4: err4:
...@@ -490,7 +494,7 @@ static int s3c_ac97_remove(struct platform_device *pdev) ...@@ -490,7 +494,7 @@ static int s3c_ac97_remove(struct platform_device *pdev)
struct resource *mem_res, *irq_res; struct resource *mem_res, *irq_res;
asoc_dma_platform_unregister(&pdev->dev); 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); irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (irq_res) if (irq_res)
......
...@@ -218,6 +218,10 @@ static struct snd_soc_dai_driver voice_dai = { ...@@ -218,6 +218,10 @@ static struct snd_soc_dai_driver voice_dai = {
.formats = SNDRV_PCM_FMTBIT_S16_LE,}, .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 = { static struct snd_soc_ops goni_voice_ops = {
.hw_params = goni_voice_hw_params, .hw_params = goni_voice_hw_params,
}; };
...@@ -270,7 +274,8 @@ static int __init goni_init(void) ...@@ -270,7 +274,8 @@ static int __init goni_init(void)
return -ENOMEM; return -ENOMEM;
/* register voice DAI here */ /* 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) { if (ret) {
platform_device_put(goni_snd_device); platform_device_put(goni_snd_device);
return ret; return ret;
...@@ -280,7 +285,7 @@ static int __init goni_init(void) ...@@ -280,7 +285,7 @@ static int __init goni_init(void)
ret = platform_device_add(goni_snd_device); ret = platform_device_add(goni_snd_device);
if (ret) { if (ret) {
snd_soc_unregister_dai(&goni_snd_device->dev); snd_soc_unregister_component(&goni_snd_device->dev);
platform_device_put(goni_snd_device); platform_device_put(goni_snd_device);
} }
...@@ -289,7 +294,7 @@ static int __init goni_init(void) ...@@ -289,7 +294,7 @@ static int __init goni_init(void)
static void __exit goni_exit(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); platform_device_unregister(goni_snd_device);
} }
......
...@@ -963,6 +963,10 @@ static const struct snd_soc_dai_ops samsung_i2s_dai_ops = { ...@@ -963,6 +963,10 @@ static const struct snd_soc_dai_ops samsung_i2s_dai_ops = {
.delay = i2s_delay, .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_RATES SNDRV_PCM_RATE_8000_96000
#define SAMSUNG_I2S_FMTS (SNDRV_PCM_FMTBIT_S8 | \ #define SAMSUNG_I2S_FMTS (SNDRV_PCM_FMTBIT_S8 | \
...@@ -1114,8 +1118,9 @@ static int samsung_i2s_probe(struct platform_device *pdev) ...@@ -1114,8 +1118,9 @@ static int samsung_i2s_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "Unable to get drvdata\n"); dev_err(&pdev->dev, "Unable to get drvdata\n");
return -EFAULT; return -EFAULT;
} }
snd_soc_register_dai(&sec_dai->pdev->dev, snd_soc_register_component(&sec_dai->pdev->dev,
&sec_dai->i2s_dai_drv); &samsung_i2s_component,
&sec_dai->i2s_dai_drv, 1);
asoc_dma_platform_register(&pdev->dev); asoc_dma_platform_register(&pdev->dev);
return 0; return 0;
} }
...@@ -1244,7 +1249,8 @@ static int samsung_i2s_probe(struct platform_device *pdev) ...@@ -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); pm_runtime_enable(&pdev->dev);
...@@ -1283,7 +1289,7 @@ static int samsung_i2s_remove(struct platform_device *pdev) ...@@ -1283,7 +1289,7 @@ static int samsung_i2s_remove(struct platform_device *pdev)
i2s->sec_dai = NULL; i2s->sec_dai = NULL;
asoc_dma_platform_unregister(&pdev->dev); asoc_dma_platform_unregister(&pdev->dev);
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
return 0; return 0;
} }
......
...@@ -490,6 +490,10 @@ static struct snd_soc_dai_driver s3c_pcm_dai[] = { ...@@ -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) static int s3c_pcm_dev_probe(struct platform_device *pdev)
{ {
struct s3c_pcm_info *pcm; struct s3c_pcm_info *pcm;
...@@ -583,7 +587,8 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev) ...@@ -583,7 +587,8 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev); 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) { if (ret != 0) {
dev_err(&pdev->dev, "failed to get register DAI: %d\n", ret); dev_err(&pdev->dev, "failed to get register DAI: %d\n", ret);
goto err5; goto err5;
...@@ -598,7 +603,7 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev) ...@@ -598,7 +603,7 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
return 0; return 0;
err6: err6:
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
err5: err5:
clk_disable_unprepare(pcm->pclk); clk_disable_unprepare(pcm->pclk);
clk_put(pcm->pclk); clk_put(pcm->pclk);
...@@ -619,7 +624,7 @@ static int s3c_pcm_dev_remove(struct platform_device *pdev) ...@@ -619,7 +624,7 @@ static int s3c_pcm_dev_remove(struct platform_device *pdev)
struct resource *mem_res; struct resource *mem_res;
asoc_dma_platform_unregister(&pdev->dev); asoc_dma_platform_unregister(&pdev->dev);
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
......
...@@ -731,8 +731,9 @@ static int s3c2412_i2s_resume(struct snd_soc_dai *dai) ...@@ -731,8 +731,9 @@ static int s3c2412_i2s_resume(struct snd_soc_dai *dai)
#define s3c2412_i2s_resume NULL #define s3c2412_i2s_resume NULL
#endif #endif
int s3c_i2sv2_register_dai(struct device *dev, int id, int s3c_i2sv2_register_component(struct device *dev, int id,
struct snd_soc_dai_driver *drv) struct snd_soc_component_driver *cmp_drv,
struct snd_soc_dai_driver *dai_drv)
{ {
struct snd_soc_dai_ops *ops = drv->ops; struct snd_soc_dai_ops *ops = drv->ops;
...@@ -750,8 +751,8 @@ int s3c_i2sv2_register_dai(struct device *dev, int id, ...@@ -750,8 +751,8 @@ int s3c_i2sv2_register_dai(struct device *dev, int id,
drv->suspend = s3c2412_i2s_suspend; drv->suspend = s3c2412_i2s_suspend;
drv->resume = s3c2412_i2s_resume; 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"); MODULE_LICENSE("GPL");
...@@ -92,7 +92,7 @@ extern int s3c_i2sv2_probe(struct snd_soc_dai *dai, ...@@ -92,7 +92,7 @@ extern int s3c_i2sv2_probe(struct snd_soc_dai *dai,
unsigned long base); 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 * @dev: DAI device
* @id: DAI ID * @id: DAI ID
* @drv: The driver structure to register * @drv: The driver structure to register
...@@ -100,7 +100,8 @@ extern int s3c_i2sv2_probe(struct snd_soc_dai *dai, ...@@ -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 * Fill in any missing fields and then register the given dai with the
* soc core. * soc core.
*/ */
extern int s3c_i2sv2_register_dai(struct device *dev, int id, extern int s3c_i2sv2_register_component(struct device *dev, int id,
struct snd_soc_dai_driver *drv); struct snd_soc_component_driver *cmp_drv,
struct snd_soc_dai_driver *dai_drv);
#endif /* __SND_SOC_S3C24XX_S3C_I2SV2_I2S_H */ #endif /* __SND_SOC_S3C24XX_S3C_I2SV2_I2S_H */
...@@ -160,11 +160,17 @@ static struct snd_soc_dai_driver s3c2412_i2s_dai = { ...@@ -160,11 +160,17 @@ static struct snd_soc_dai_driver s3c2412_i2s_dai = {
.ops = &s3c2412_i2s_dai_ops, .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) static int s3c2412_iis_dev_probe(struct platform_device *pdev)
{ {
int ret = 0; 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) { if (ret) {
pr_err("failed to register the dai\n"); pr_err("failed to register the dai\n");
return ret; return ret;
...@@ -178,14 +184,14 @@ static int s3c2412_iis_dev_probe(struct platform_device *pdev) ...@@ -178,14 +184,14 @@ static int s3c2412_iis_dev_probe(struct platform_device *pdev)
return 0; return 0;
err: err:
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
return ret; return ret;
} }
static int s3c2412_iis_dev_remove(struct platform_device *pdev) static int s3c2412_iis_dev_remove(struct platform_device *pdev)
{ {
asoc_dma_platform_unregister(&pdev->dev); asoc_dma_platform_unregister(&pdev->dev);
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
return 0; return 0;
} }
......
...@@ -465,11 +465,16 @@ static struct snd_soc_dai_driver s3c24xx_i2s_dai = { ...@@ -465,11 +465,16 @@ static struct snd_soc_dai_driver s3c24xx_i2s_dai = {
.ops = &s3c24xx_i2s_dai_ops, .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) static int s3c24xx_iis_dev_probe(struct platform_device *pdev)
{ {
int ret = 0; 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) { if (ret) {
pr_err("failed to register the dai\n"); pr_err("failed to register the dai\n");
return ret; return ret;
...@@ -483,14 +488,14 @@ static int s3c24xx_iis_dev_probe(struct platform_device *pdev) ...@@ -483,14 +488,14 @@ static int s3c24xx_iis_dev_probe(struct platform_device *pdev)
return 0; return 0;
err: err:
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
return ret; return ret;
} }
static int s3c24xx_iis_dev_remove(struct platform_device *pdev) static int s3c24xx_iis_dev_remove(struct platform_device *pdev)
{ {
asoc_dma_platform_unregister(&pdev->dev); asoc_dma_platform_unregister(&pdev->dev);
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
return 0; return 0;
} }
......
...@@ -357,6 +357,10 @@ static struct snd_soc_dai_driver samsung_spdif_dai = { ...@@ -357,6 +357,10 @@ static struct snd_soc_dai_driver samsung_spdif_dai = {
.resume = spdif_resume, .resume = spdif_resume,
}; };
static const struct snd_soc_component_driver samsung_spdif_component = {
.name = "samsung-spdif",
};
static int spdif_probe(struct platform_device *pdev) static int spdif_probe(struct platform_device *pdev)
{ {
struct s3c_audio_pdata *spdif_pdata; struct s3c_audio_pdata *spdif_pdata;
...@@ -424,7 +428,8 @@ static int spdif_probe(struct platform_device *pdev) ...@@ -424,7 +428,8 @@ static int spdif_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, spdif); 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) { if (ret != 0) {
dev_err(&pdev->dev, "fail to register dai\n"); dev_err(&pdev->dev, "fail to register dai\n");
goto err4; goto err4;
...@@ -445,7 +450,7 @@ static int spdif_probe(struct platform_device *pdev) ...@@ -445,7 +450,7 @@ static int spdif_probe(struct platform_device *pdev)
return 0; return 0;
err5: err5:
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
err4: err4:
iounmap(spdif->regs); iounmap(spdif->regs);
err3: err3:
...@@ -466,7 +471,7 @@ static int spdif_remove(struct platform_device *pdev) ...@@ -466,7 +471,7 @@ static int spdif_remove(struct platform_device *pdev)
struct resource *mem_res; struct resource *mem_res;
asoc_dma_platform_unregister(&pdev->dev); asoc_dma_platform_unregister(&pdev->dev);
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
iounmap(spdif->regs); iounmap(spdif->regs);
......
...@@ -1886,6 +1886,10 @@ static struct snd_soc_platform_driver fsi_soc_platform = { ...@@ -1886,6 +1886,10 @@ static struct snd_soc_platform_driver fsi_soc_platform = {
.pcm_free = fsi_pcm_free, .pcm_free = fsi_pcm_free,
}; };
static const struct snd_soc_component_driver fsi_soc_component = {
.name = "fsi",
};
/* /*
* platform function * platform function
*/ */
...@@ -2046,10 +2050,10 @@ static int fsi_probe(struct platform_device *pdev) ...@@ -2046,10 +2050,10 @@ static int fsi_probe(struct platform_device *pdev)
goto exit_fsib; goto exit_fsib;
} }
ret = snd_soc_register_dais(&pdev->dev, fsi_soc_dai, ret = snd_soc_register_component(&pdev->dev, &fsi_soc_component,
ARRAY_SIZE(fsi_soc_dai)); fsi_soc_dai, ARRAY_SIZE(fsi_soc_dai));
if (ret < 0) { 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; goto exit_snd_soc;
} }
...@@ -2074,7 +2078,7 @@ static int fsi_remove(struct platform_device *pdev) ...@@ -2074,7 +2078,7 @@ static int fsi_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev); 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); snd_soc_unregister_platform(&pdev->dev);
fsi_stream_remove(&master->fsia); fsi_stream_remove(&master->fsia);
......
...@@ -310,15 +310,19 @@ static struct snd_soc_dai_driver sh4_hac_dai[] = { ...@@ -310,15 +310,19 @@ static struct snd_soc_dai_driver sh4_hac_dai[] = {
#endif #endif
}; };
static const struct snd_soc_component_driver sh4_hac_component = {
.name = "sh4-hac",
};
static int hac_soc_platform_probe(struct platform_device *pdev) static int hac_soc_platform_probe(struct platform_device *pdev)
{ {
return snd_soc_register_dais(&pdev->dev, sh4_hac_dai, return snd_soc_register_component(&pdev->dev, &sh4_hac_component,
ARRAY_SIZE(sh4_hac_dai)); sh4_hac_dai, ARRAY_SIZE(sh4_hac_dai));
} }
static int hac_soc_platform_remove(struct platform_device *pdev) 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; return 0;
} }
......
...@@ -153,7 +153,7 @@ static int migor_dai_init(struct snd_soc_pcm_runtime *rtd) ...@@ -153,7 +153,7 @@ static int migor_dai_init(struct snd_soc_pcm_runtime *rtd)
static struct snd_soc_dai_link migor_dai = { static struct snd_soc_dai_link migor_dai = {
.name = "wm8978", .name = "wm8978",
.stream_name = "WM8978", .stream_name = "WM8978",
.cpu_dai_name = "siu-i2s-dai", .cpu_dai_name = "siu-pcm-audio",
.codec_dai_name = "wm8978-hifi", .codec_dai_name = "wm8978-hifi",
.platform_name = "siu-pcm-audio", .platform_name = "siu-pcm-audio",
.codec_name = "wm8978.0-001a", .codec_name = "wm8978.0-001a",
......
...@@ -726,6 +726,10 @@ static struct snd_soc_dai_driver siu_i2s_dai = { ...@@ -726,6 +726,10 @@ static struct snd_soc_dai_driver siu_i2s_dai = {
.ops = &siu_dai_ops, .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) static int siu_probe(struct platform_device *pdev)
{ {
const struct firmware *fw_entry; const struct firmware *fw_entry;
...@@ -783,7 +787,8 @@ static int siu_probe(struct platform_device *pdev) ...@@ -783,7 +787,8 @@ static int siu_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, info); dev_set_drvdata(&pdev->dev, info);
/* register using ARRAY version so we can keep dai name */ /* 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) if (ret < 0)
goto edaiinit; goto edaiinit;
...@@ -796,7 +801,7 @@ static int siu_probe(struct platform_device *pdev) ...@@ -796,7 +801,7 @@ static int siu_probe(struct platform_device *pdev)
return ret; return ret;
esocregp: esocregp:
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
edaiinit: edaiinit:
iounmap(info->reg); iounmap(info->reg);
emapreg: emapreg:
...@@ -823,7 +828,7 @@ static int siu_remove(struct platform_device *pdev) ...@@ -823,7 +828,7 @@ static int siu_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
snd_soc_unregister_platform(&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->reg);
iounmap(info->yram); iounmap(info->yram);
......
...@@ -379,15 +379,19 @@ static struct snd_soc_dai_driver sh4_ssi_dai[] = { ...@@ -379,15 +379,19 @@ static struct snd_soc_dai_driver sh4_ssi_dai[] = {
#endif #endif
}; };
static const struct snd_soc_component_driver sh4_ssi_component = {
.name = "sh4-ssi",
};
static int sh4_soc_dai_probe(struct platform_device *pdev) static int sh4_soc_dai_probe(struct platform_device *pdev)
{ {
return snd_soc_register_dais(&pdev->dev, sh4_ssi_dai, return snd_soc_register_component(&pdev->dev, &sh4_ssi_component,
ARRAY_SIZE(sh4_ssi_dai)); sh4_ssi_dai, ARRAY_SIZE(sh4_ssi_dai));
} }
static int sh4_soc_dai_remove(struct platform_device *pdev) 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; return 0;
} }
......
...@@ -58,6 +58,7 @@ static DEFINE_MUTEX(client_mutex); ...@@ -58,6 +58,7 @@ static DEFINE_MUTEX(client_mutex);
static LIST_HEAD(dai_list); static LIST_HEAD(dai_list);
static LIST_HEAD(platform_list); static LIST_HEAD(platform_list);
static LIST_HEAD(codec_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(). * 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, ...@@ -3740,7 +3741,7 @@ static inline char *fmt_multiple_name(struct device *dev,
* *
* @dai: DAI to register * @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_dai_driver *dai_drv)
{ {
struct snd_soc_codec *codec; struct snd_soc_codec *codec;
...@@ -3787,14 +3788,13 @@ int snd_soc_register_dai(struct device *dev, ...@@ -3787,14 +3788,13 @@ int snd_soc_register_dai(struct device *dev,
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_soc_register_dai);
/** /**
* snd_soc_unregister_dai - Unregister a DAI from the ASoC core * snd_soc_unregister_dai - Unregister a DAI from the ASoC core
* *
* @dai: DAI to unregister * @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; struct snd_soc_dai *dai;
...@@ -3813,7 +3813,6 @@ void snd_soc_unregister_dai(struct device *dev) ...@@ -3813,7 +3813,6 @@ void snd_soc_unregister_dai(struct device *dev)
kfree(dai->name); kfree(dai->name);
kfree(dai); kfree(dai);
} }
EXPORT_SYMBOL_GPL(snd_soc_unregister_dai);
/** /**
* snd_soc_register_dais - Register multiple DAIs with the ASoC core * snd_soc_register_dais - Register multiple DAIs with the ASoC core
...@@ -3821,7 +3820,7 @@ EXPORT_SYMBOL_GPL(snd_soc_unregister_dai); ...@@ -3821,7 +3820,7 @@ EXPORT_SYMBOL_GPL(snd_soc_unregister_dai);
* @dai: Array of DAIs to register * @dai: Array of DAIs to register
* @count: Number of DAIs * @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_dai_driver *dai_drv, size_t count)
{ {
struct snd_soc_codec *codec; struct snd_soc_codec *codec;
...@@ -3885,7 +3884,6 @@ int snd_soc_register_dais(struct device *dev, ...@@ -3885,7 +3884,6 @@ int snd_soc_register_dais(struct device *dev,
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(snd_soc_register_dais);
/** /**
* snd_soc_unregister_dais - Unregister multiple DAIs from the ASoC core * snd_soc_unregister_dais - Unregister multiple DAIs from the ASoC core
...@@ -3893,14 +3891,13 @@ EXPORT_SYMBOL_GPL(snd_soc_register_dais); ...@@ -3893,14 +3891,13 @@ EXPORT_SYMBOL_GPL(snd_soc_register_dais);
* @dai: Array of DAIs to unregister * @dai: Array of DAIs to unregister
* @count: Number of DAIs * @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; int i;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
snd_soc_unregister_dai(dev); snd_soc_unregister_dai(dev);
} }
EXPORT_SYMBOL_GPL(snd_soc_unregister_dais);
/** /**
* snd_soc_register_platform - Register a platform with the ASoC core * snd_soc_register_platform - Register a platform with the ASoC core
...@@ -4139,6 +4136,92 @@ void snd_soc_unregister_codec(struct device *dev) ...@@ -4139,6 +4136,92 @@ void snd_soc_unregister_codec(struct device *dev)
} }
EXPORT_SYMBOL_GPL(snd_soc_unregister_codec); 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 */ /* Retrieve a card's name from device tree */
int snd_soc_of_parse_card_name(struct snd_soc_card *card, int snd_soc_of_parse_card_name(struct snd_soc_card *card,
const char *propname) const char *propname)
......
...@@ -170,6 +170,10 @@ struct snd_soc_dai_driver spdif_in_dai = { ...@@ -170,6 +170,10 @@ struct snd_soc_dai_driver spdif_in_dai = {
.ops = &spdif_in_dai_ops, .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) static irqreturn_t spdif_in_irq(int irq, void *arg)
{ {
struct spdif_in_dev *host = (struct spdif_in_dev *)arg; struct spdif_in_dev *host = (struct spdif_in_dev *)arg;
...@@ -258,7 +262,8 @@ static int spdif_in_probe(struct platform_device *pdev) ...@@ -258,7 +262,8 @@ static int spdif_in_probe(struct platform_device *pdev)
return ret; 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) { if (ret != 0) {
clk_put(host->clk); clk_put(host->clk);
return ret; return ret;
...@@ -271,7 +276,7 @@ static int spdif_in_remove(struct platform_device *pdev) ...@@ -271,7 +276,7 @@ static int spdif_in_remove(struct platform_device *pdev)
{ {
struct spdif_in_dev *host = dev_get_drvdata(&pdev->dev); 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); dev_set_drvdata(&pdev->dev, NULL);
clk_put(host->clk); clk_put(host->clk);
......
...@@ -270,6 +270,10 @@ static struct snd_soc_dai_driver spdif_out_dai = { ...@@ -270,6 +270,10 @@ static struct snd_soc_dai_driver spdif_out_dai = {
.ops = &spdif_out_dai_ops, .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) static int spdif_out_probe(struct platform_device *pdev)
{ {
struct spdif_out_dev *host; struct spdif_out_dev *host;
...@@ -314,7 +318,8 @@ static int spdif_out_probe(struct platform_device *pdev) ...@@ -314,7 +318,8 @@ static int spdif_out_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, host); 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) { if (ret != 0) {
clk_put(host->clk); clk_put(host->clk);
return ret; return ret;
...@@ -327,7 +332,7 @@ static int spdif_out_remove(struct platform_device *pdev) ...@@ -327,7 +332,7 @@ static int spdif_out_remove(struct platform_device *pdev)
{ {
struct spdif_out_dev *host = dev_get_drvdata(&pdev->dev); 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); dev_set_drvdata(&pdev->dev, NULL);
clk_put(host->clk); clk_put(host->clk);
......
...@@ -248,6 +248,10 @@ static struct snd_soc_dai_driver tegra20_ac97_dai = { ...@@ -248,6 +248,10 @@ static struct snd_soc_dai_driver tegra20_ac97_dai = {
.ops = &tegra20_ac97_dai_ops, .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) static bool tegra20_ac97_wr_rd_reg(struct device *dev, unsigned int reg)
{ {
switch (reg) { switch (reg) {
...@@ -398,7 +402,8 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) ...@@ -398,7 +402,8 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev)
ac97->playback_dma_data.width = 32; ac97->playback_dma_data.width = 32;
ac97->playback_dma_data.req_sel = of_dma[1]; 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) { if (ret) {
dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
ret = -ENOMEM; ret = -ENOMEM;
...@@ -408,7 +413,7 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) ...@@ -408,7 +413,7 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev)
ret = tegra_pcm_platform_register(&pdev->dev); ret = tegra_pcm_platform_register(&pdev->dev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Could not register PCM: %d\n", 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); ret = tegra_asoc_utils_init(&ac97->util_data, &pdev->dev);
...@@ -434,8 +439,8 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) ...@@ -434,8 +439,8 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev)
tegra_asoc_utils_fini(&ac97->util_data); tegra_asoc_utils_fini(&ac97->util_data);
err_unregister_pcm: err_unregister_pcm:
tegra_pcm_platform_unregister(&pdev->dev); tegra_pcm_platform_unregister(&pdev->dev);
err_unregister_dai: err_unregister_component:
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
err_clk_put: err_clk_put:
clk_put(ac97->clk_ac97); clk_put(ac97->clk_ac97);
err: err:
...@@ -447,7 +452,7 @@ static int tegra20_ac97_platform_remove(struct platform_device *pdev) ...@@ -447,7 +452,7 @@ static int tegra20_ac97_platform_remove(struct platform_device *pdev)
struct tegra20_ac97 *ac97 = dev_get_drvdata(&pdev->dev); struct tegra20_ac97 *ac97 = dev_get_drvdata(&pdev->dev);
tegra_pcm_platform_unregister(&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); tegra_asoc_utils_fini(&ac97->util_data);
......
...@@ -276,6 +276,10 @@ static const struct snd_soc_dai_driver tegra20_i2s_dai_template = { ...@@ -276,6 +276,10 @@ static const struct snd_soc_dai_driver tegra20_i2s_dai_template = {
.symmetric_rates = 1, .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) static bool tegra20_i2s_wr_rd_reg(struct device *dev, unsigned int reg)
{ {
switch (reg) { switch (reg) {
...@@ -419,7 +423,8 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev) ...@@ -419,7 +423,8 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev)
goto err_pm_disable; 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) { if (ret) {
dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
ret = -ENOMEM; ret = -ENOMEM;
...@@ -429,13 +434,13 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev) ...@@ -429,13 +434,13 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev)
ret = tegra_pcm_platform_register(&pdev->dev); ret = tegra_pcm_platform_register(&pdev->dev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Could not register PCM: %d\n", ret); dev_err(&pdev->dev, "Could not register PCM: %d\n", ret);
goto err_unregister_dai; goto err_unregister_component;
} }
return 0; return 0;
err_unregister_dai: err_unregister_component:
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
err_suspend: err_suspend:
if (!pm_runtime_status_suspended(&pdev->dev)) if (!pm_runtime_status_suspended(&pdev->dev))
tegra20_i2s_runtime_suspend(&pdev->dev); tegra20_i2s_runtime_suspend(&pdev->dev);
...@@ -456,7 +461,7 @@ static int tegra20_i2s_platform_remove(struct platform_device *pdev) ...@@ -456,7 +461,7 @@ static int tegra20_i2s_platform_remove(struct platform_device *pdev)
tegra20_i2s_runtime_suspend(&pdev->dev); tegra20_i2s_runtime_suspend(&pdev->dev);
tegra_pcm_platform_unregister(&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); clk_put(i2s->clk_i2s);
......
...@@ -182,6 +182,10 @@ static struct snd_soc_dai_driver tegra20_spdif_dai = { ...@@ -182,6 +182,10 @@ static struct snd_soc_dai_driver tegra20_spdif_dai = {
.ops = &tegra20_spdif_dai_ops, .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) static bool tegra20_spdif_wr_rd_reg(struct device *dev, unsigned int reg)
{ {
switch (reg) { switch (reg) {
...@@ -329,7 +333,8 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev) ...@@ -329,7 +333,8 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev)
goto err_pm_disable; 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) { if (ret) {
dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
ret = -ENOMEM; ret = -ENOMEM;
...@@ -339,13 +344,13 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev) ...@@ -339,13 +344,13 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev)
ret = tegra_pcm_platform_register(&pdev->dev); ret = tegra_pcm_platform_register(&pdev->dev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Could not register PCM: %d\n", ret); dev_err(&pdev->dev, "Could not register PCM: %d\n", ret);
goto err_unregister_dai; goto err_unregister_component;
} }
return 0; return 0;
err_unregister_dai: err_unregister_component:
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
err_suspend: err_suspend:
if (!pm_runtime_status_suspended(&pdev->dev)) if (!pm_runtime_status_suspended(&pdev->dev))
tegra20_spdif_runtime_suspend(&pdev->dev); tegra20_spdif_runtime_suspend(&pdev->dev);
...@@ -366,7 +371,7 @@ static int tegra20_spdif_platform_remove(struct platform_device *pdev) ...@@ -366,7 +371,7 @@ static int tegra20_spdif_platform_remove(struct platform_device *pdev)
tegra20_spdif_runtime_suspend(&pdev->dev); tegra20_spdif_runtime_suspend(&pdev->dev);
tegra_pcm_platform_unregister(&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); clk_put(spdif->clk_spdif_out);
......
...@@ -336,6 +336,10 @@ static const struct snd_soc_dai_driver tegra30_i2s_dai_template = { ...@@ -336,6 +336,10 @@ static const struct snd_soc_dai_driver tegra30_i2s_dai_template = {
.symmetric_rates = 1, .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) static bool tegra30_i2s_wr_rd_reg(struct device *dev, unsigned int reg)
{ {
switch (reg) { switch (reg) {
...@@ -464,7 +468,8 @@ static int tegra30_i2s_platform_probe(struct platform_device *pdev) ...@@ -464,7 +468,8 @@ static int tegra30_i2s_platform_probe(struct platform_device *pdev)
goto err_pm_disable; 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) { if (ret) {
dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
ret = -ENOMEM; ret = -ENOMEM;
...@@ -474,13 +479,13 @@ static int tegra30_i2s_platform_probe(struct platform_device *pdev) ...@@ -474,13 +479,13 @@ static int tegra30_i2s_platform_probe(struct platform_device *pdev)
ret = tegra_pcm_platform_register(&pdev->dev); ret = tegra_pcm_platform_register(&pdev->dev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Could not register PCM: %d\n", ret); dev_err(&pdev->dev, "Could not register PCM: %d\n", ret);
goto err_unregister_dai; goto err_unregister_component;
} }
return 0; return 0;
err_unregister_dai: err_unregister_component:
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
err_suspend: err_suspend:
if (!pm_runtime_status_suspended(&pdev->dev)) if (!pm_runtime_status_suspended(&pdev->dev))
tegra30_i2s_runtime_suspend(&pdev->dev); tegra30_i2s_runtime_suspend(&pdev->dev);
...@@ -501,7 +506,7 @@ static int tegra30_i2s_platform_remove(struct platform_device *pdev) ...@@ -501,7 +506,7 @@ static int tegra30_i2s_platform_remove(struct platform_device *pdev)
tegra30_i2s_runtime_suspend(&pdev->dev); tegra30_i2s_runtime_suspend(&pdev->dev);
tegra_pcm_platform_unregister(&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); clk_put(i2s->clk_i2s);
......
...@@ -55,7 +55,7 @@ static int tegra_wm9712_init(struct snd_soc_pcm_runtime *rtd) ...@@ -55,7 +55,7 @@ static int tegra_wm9712_init(struct snd_soc_pcm_runtime *rtd)
static struct snd_soc_dai_link tegra_wm9712_dai = { static struct snd_soc_dai_link tegra_wm9712_dai = {
.name = "AC97 HiFi", .name = "AC97 HiFi",
.stream_name = "AC97 HiFi", .stream_name = "AC97 HiFi",
.cpu_dai_name = "tegra-ac97-pcm", .cpu_dai_name = "tegra20-ac97",
.codec_dai_name = "wm9712-hifi", .codec_dai_name = "wm9712-hifi",
.codec_name = "wm9712-codec", .codec_name = "wm9712-codec",
.init = tegra_wm9712_init, .init = tegra_wm9712_init,
......
...@@ -170,6 +170,10 @@ static struct snd_soc_dai_driver txx9aclc_ac97_dai = { ...@@ -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) static int txx9aclc_ac97_dev_probe(struct platform_device *pdev)
{ {
struct txx9aclc_plat_drvdata *drvdata; struct txx9aclc_plat_drvdata *drvdata;
...@@ -205,12 +209,13 @@ static int txx9aclc_ac97_dev_probe(struct platform_device *pdev) ...@@ -205,12 +209,13 @@ static int txx9aclc_ac97_dev_probe(struct platform_device *pdev)
if (err < 0) if (err < 0)
return err; 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) static int txx9aclc_ac97_dev_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
return 0; return 0;
} }
......
...@@ -768,6 +768,11 @@ static struct snd_soc_dai_driver ux500_msp_dai_drv[UX500_NBR_OF_DAI] = { ...@@ -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) static int ux500_msp_drv_probe(struct platform_device *pdev)
{ {
struct ux500_msp_i2s_drvdata *drvdata; struct ux500_msp_i2s_drvdata *drvdata;
...@@ -825,8 +830,8 @@ static int ux500_msp_drv_probe(struct platform_device *pdev) ...@@ -825,8 +830,8 @@ static int ux500_msp_drv_probe(struct platform_device *pdev)
} }
dev_set_drvdata(&pdev->dev, drvdata); dev_set_drvdata(&pdev->dev, drvdata);
ret = snd_soc_register_dai(&pdev->dev, ret = snd_soc_register_component(&pdev->dev, &ux500_msp_component,
&ux500_msp_dai_drv[drvdata->msp->id]); &ux500_msp_dai_drv[drvdata->msp->id], 1);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "Error: %s: Failed to register MSP%d!\n", dev_err(&pdev->dev, "Error: %s: Failed to register MSP%d!\n",
__func__, drvdata->msp->id); __func__, drvdata->msp->id);
...@@ -844,7 +849,7 @@ static int ux500_msp_drv_probe(struct platform_device *pdev) ...@@ -844,7 +849,7 @@ static int ux500_msp_drv_probe(struct platform_device *pdev)
return 0; return 0;
err_reg_plat: err_reg_plat:
snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(ux500_msp_dai_drv)); snd_soc_unregister_component(&pdev->dev);
err_init_msp: err_init_msp:
clk_put(drvdata->clk); clk_put(drvdata->clk);
err_clk: err_clk:
...@@ -861,7 +866,7 @@ static int ux500_msp_drv_remove(struct platform_device *pdev) ...@@ -861,7 +866,7 @@ static int ux500_msp_drv_remove(struct platform_device *pdev)
ux500_pcm_unregister_platform(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); devm_regulator_put(drvdata->reg_vape);
prcmu_qos_remove_requirement(PRCMU_QOS_APE_OPP, "ux500_msp_i2s"); prcmu_qos_remove_requirement(PRCMU_QOS_APE_OPP, "ux500_msp_i2s");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment