On 03/18/2013 07:25 AM, Kuninori Morimoto wrote:
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
sound/soc/omap/omap-mcbsp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index 8d2defd..f51685d 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c @@ -586,6 +586,10 @@ static struct snd_soc_dai_driver omap_mcbsp_dai = { .ops = &mcbsp_dai_ops, };
+static const struct snd_soc_component_driver omap_mcbsp_component = {
- .name = "omap-mcbsp",
+};
static int omap_mcbsp_st_info_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { @@ -793,7 +797,8 @@ static int asoc_mcbsp_probe(struct platform_device *pdev)
ret = omap_mcbsp_init(pdev); if (!ret)
return snd_soc_register_dai(&pdev->dev, &omap_mcbsp_dai);
return snd_soc_register_component(&pdev->dev, &omap_mcbsp_component,
&omap_mcbsp_dai, 1);
This certainly breaks OMAP audio without the 'ASoC: snd_soc_register_component() uses properly snd_soc_register_dai[s]()' patch sent within the thread. But the comment from Lars stands for the users who registers 1 dai with snd_soc_register_dais() call.
On the other hand I'm not sure what is the long time aim with the snd_soc_register_component(). In essence it is just a wrapper for snd_soc_register_dai/s() without any advantage, except that we register the DAIs with a new api which does not give clue what it is doing.
Or is the aim is to eventually merge the snd_soc_codec_driver struct into snd_soc_component_driver struct and use the same structure for the CPU/DAI and CODEC/DAI registration and share the same code to do it?
I'm sure this had been discussed at some conference but unfortunately I could not attend to them lately.
All in all this is not going to break OMAP, but as of now I don't know the reasoning why this is a good thing...
return ret; } @@ -802,7 +807,7 @@ static int asoc_mcbsp_remove(struct platform_device *pdev) { struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev);
- snd_soc_unregister_dai(&pdev->dev);
snd_soc_unregister_component(&pdev->dev);
if (mcbsp->pdata->ops && mcbsp->pdata->ops->free) mcbsp->pdata->ops->free(mcbsp->id);