ASoC: switch over to use snd_soc_register_component() on s3c i2s

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Kuninori Morimoto 2013-03-21 03:35:22 -07:00 committed by Mark Brown
parent 5642ddff27
commit eca3b01d08
3 changed files with 18 additions and 10 deletions

View File

@ -731,8 +731,9 @@ static int s3c2412_i2s_resume(struct snd_soc_dai *dai)
#define s3c2412_i2s_resume NULL
#endif
int s3c_i2sv2_register_dai(struct device *dev, int id,
struct snd_soc_dai_driver *drv)
int s3c_i2sv2_register_component(struct device *dev, int id,
struct snd_soc_component_driver *cmp_drv,
struct snd_soc_dai_driver *dai_drv)
{
struct snd_soc_dai_ops *ops = drv->ops;
@ -750,8 +751,8 @@ int s3c_i2sv2_register_dai(struct device *dev, int id,
drv->suspend = s3c2412_i2s_suspend;
drv->resume = s3c2412_i2s_resume;
return snd_soc_register_dai(dev, drv);
return snd_soc_register_component(dev, cmp_drv, dai_drv, 1);
}
EXPORT_SYMBOL_GPL(s3c_i2sv2_register_dai);
EXPORT_SYMBOL_GPL(s3c_i2sv2_register_component);
MODULE_LICENSE("GPL");

View File

@ -92,7 +92,7 @@ extern int s3c_i2sv2_probe(struct snd_soc_dai *dai,
unsigned long base);
/**
* s3c_i2sv2_register_dai - register dai with soc core
* s3c_i2sv2_register_component - register component and dai with soc core
* @dev: DAI device
* @id: DAI ID
* @drv: The driver structure to register
@ -100,7 +100,8 @@ extern int s3c_i2sv2_probe(struct snd_soc_dai *dai,
* Fill in any missing fields and then register the given dai with the
* soc core.
*/
extern int s3c_i2sv2_register_dai(struct device *dev, int id,
struct snd_soc_dai_driver *drv);
extern int s3c_i2sv2_register_component(struct device *dev, int id,
struct snd_soc_component_driver *cmp_drv,
struct snd_soc_dai_driver *dai_drv);
#endif /* __SND_SOC_S3C24XX_S3C_I2SV2_I2S_H */

View File

@ -160,11 +160,17 @@ static struct snd_soc_dai_driver s3c2412_i2s_dai = {
.ops = &s3c2412_i2s_dai_ops,
};
static const struct snd_soc_component_driver s3c2412_i2s_component = {
.name = "s3c2412-i2s",
};
static int s3c2412_iis_dev_probe(struct platform_device *pdev)
{
int ret = 0;
ret = s3c_i2sv2_register_dai(&pdev->dev, -1, &s3c2412_i2s_dai);
ret = s3c_i2sv2_register_component(&pdev->dev, -1,
&s3c2412_i2s_component,
&s3c2412_i2s_dai);
if (ret) {
pr_err("failed to register the dai\n");
return ret;
@ -178,14 +184,14 @@ static int s3c2412_iis_dev_probe(struct platform_device *pdev)
return 0;
err:
snd_soc_unregister_dai(&pdev->dev);
snd_soc_unregister_component(&pdev->dev);
return ret;
}
static int s3c2412_iis_dev_remove(struct platform_device *pdev)
{
asoc_dma_platform_unregister(&pdev->dev);
snd_soc_unregister_dai(&pdev->dev);
snd_soc_unregister_component(&pdev->dev);
return 0;
}