[alsa-devel] [PATCH 00/18] ASoC: omap: Bind the omap-pcm platform driver to dai device
Hi,
This should have been done a long time ago... Add support for binding the omap-pcm platform to a dai device. IN this way we can remove the 'omap-pcm-audio' platform device/driver need. The change will also going to simplify cases when we boot with DT and we can use the same node for cpu_dai and platform.
Regards, Peter --- Peter Ujfalusi (18): ASoC: omap-pcm: Support for binding the platform driver to dai devices ASoC: omap-mcpdm: Assign the dai DMA data at earlier time ASoC: omap-mcpdm: Bind the platform driver to the dai driver when loading ASoC: omap-mcbsp: Assign the dai DMA data at earlier time ASoC: omap-mcbsp: Bind the platform driver to the dai driver when loading ASoC: omap-dmic: Assign the dai DMA data at earlier time ASoC: omap-dmic: Bind the platform driver to the dai driver when loading ASoC: omap-hdmi: Bind the platform driver to the dai driver when loading ASoC: omap-abe-twl6040: Use the cpu_dai node to specify the platform driver ASoC: omap-twl4030: Use the same name/node for platform as the cpu_dai ASoC: am3517evm: Use the same name for platform as the cpu_dai ASoC: ams-delta: Use the same name for platform as the cpu_dai ASoC: n810: Use the same name for platform as the cpu_dai ASoC: omap3pandora: Use the same name for platform as the cpu_dai ASoC: osk5912: Use the same name for platform as the cpu_dai ASoC: rx51: Use the same name for platform as the cpu_dai ASoC: omap-hdmi-card: Use the same name for platform as the cpu_dai ASoC: omap-pcm: Drop the platform driver init code
sound/soc/omap/am3517evm.c | 2 +- sound/soc/omap/ams-delta.c | 2 +- sound/soc/omap/n810.c | 2 +- sound/soc/omap/omap-abe-twl6040.c | 8 ++------ sound/soc/omap/omap-dmic.c | 10 +++++++++- sound/soc/omap/omap-hdmi-card.c | 2 +- sound/soc/omap/omap-hdmi.c | 7 ++++++- sound/soc/omap/omap-mcbsp.c | 19 ++++++++++++------- sound/soc/omap/omap-mcpdm.c | 15 +++++++++++---- sound/soc/omap/omap-pcm.c | 25 ++++++------------------- sound/soc/omap/omap-pcm.h | 35 +++++++++++++++++++++++++++++++++++ sound/soc/omap/omap-twl4030.c | 10 ++++++++-- sound/soc/omap/omap3pandora.c | 4 ++-- sound/soc/omap/osk5912.c | 2 +- sound/soc/omap/rx51.c | 2 +- 15 files changed, 97 insertions(+), 48 deletions(-) create mode 100644 sound/soc/omap/omap-pcm.h
With the new calls it is going to be possible to bind the platform driver to a dai device which makes it easier for us in a long run to handle DT boots, and opens the possibility to move machine driver to generic simple card.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/omap-pcm.c | 12 ++++++++++++ sound/soc/omap/omap-pcm.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 sound/soc/omap/omap-pcm.h
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index 07b8b7bc9d20..5c4bc9ae974b 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c @@ -232,6 +232,18 @@ static struct snd_soc_platform_driver omap_soc_platform = { .pcm_free = omap_pcm_free_dma_buffers, };
+int omap_pcm_platform_register(struct device *dev) +{ + return snd_soc_register_platform(dev, &omap_soc_platform); +} +EXPORT_SYMBOL_GPL(omap_pcm_platform_register); + +void omap_pcm_platform_unregister(struct device *dev) +{ + snd_soc_unregister_platform(dev); +} +EXPORT_SYMBOL_GPL(omap_pcm_platform_unregister); + static int omap_pcm_probe(struct platform_device *pdev) { return snd_soc_register_platform(&pdev->dev, diff --git a/sound/soc/omap/omap-pcm.h b/sound/soc/omap/omap-pcm.h new file mode 100644 index 000000000000..148509eb4b63 --- /dev/null +++ b/sound/soc/omap/omap-pcm.h @@ -0,0 +1,35 @@ +/* + * omap-pcm.h - OMAP PCM driver + * + * Copyright (C) 2014 Texas Instruments, Inc. + * + * Author: Peter Ujfalusi peter.ujfalusi@ti.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + */ + +#ifndef __OMAP_PCM_H__ +#define __OMAP_PCM_H__ + +#if IS_ENABLED(CONFIG_SND_OMAP_SOC) +int omap_pcm_platform_register(struct device *dev); +void omap_pcm_platform_unregister(struct device *dev); +#else +static inline int omap_pcm_platform_register(struct device *dev) +{ + return 0; +} + +static inline void omap_pcm_platform_unregister(struct device *dev) +{ +} +#endif /* CONFIG_SND_OMAP_SOC */ + +#endif /* __OMAP_PCM_H__ */
On 04/16/2014 12:23 PM, Peter Ujfalusi wrote:
With the new calls it is going to be possible to bind the platform driver to a dai device which makes it easier for us in a long run to handle DT boots, and opens the possibility to move machine driver to generic simple card.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com
sound/soc/omap/omap-pcm.c | 12 ++++++++++++ sound/soc/omap/omap-pcm.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 sound/soc/omap/omap-pcm.h
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index 07b8b7bc9d20..5c4bc9ae974b 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c @@ -232,6 +232,18 @@ static struct snd_soc_platform_driver omap_soc_platform = { .pcm_free = omap_pcm_free_dma_buffers, };
+int omap_pcm_platform_register(struct device *dev) +{
- return snd_soc_register_platform(dev, &omap_soc_platform);
Aargh, I meant to use the devm_snd_soc_register_platform() so the unregister is not going to be needed and the subsequent patches are expecting that this is devm_* Will resend soon.
+} +EXPORT_SYMBOL_GPL(omap_pcm_platform_register);
+void omap_pcm_platform_unregister(struct device *dev) +{
- snd_soc_unregister_platform(dev);
+} +EXPORT_SYMBOL_GPL(omap_pcm_platform_unregister);
static int omap_pcm_probe(struct platform_device *pdev) { return snd_soc_register_platform(&pdev->dev, diff --git a/sound/soc/omap/omap-pcm.h b/sound/soc/omap/omap-pcm.h new file mode 100644 index 000000000000..148509eb4b63 --- /dev/null +++ b/sound/soc/omap/omap-pcm.h @@ -0,0 +1,35 @@ +/*
- omap-pcm.h - OMAP PCM driver
- Copyright (C) 2014 Texas Instruments, Inc.
- Author: Peter Ujfalusi peter.ujfalusi@ti.com
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
- */
+#ifndef __OMAP_PCM_H__ +#define __OMAP_PCM_H__
+#if IS_ENABLED(CONFIG_SND_OMAP_SOC) +int omap_pcm_platform_register(struct device *dev); +void omap_pcm_platform_unregister(struct device *dev); +#else +static inline int omap_pcm_platform_register(struct device *dev) +{
- return 0;
+}
+static inline void omap_pcm_platform_unregister(struct device *dev) +{ +} +#endif /* CONFIG_SND_OMAP_SOC */
+#endif /* __OMAP_PCM_H__ */
On 04/16/2014 12:30 PM, Peter Ujfalusi wrote:
+int omap_pcm_platform_register(struct device *dev) +{
- return snd_soc_register_platform(dev, &omap_soc_platform);
Aargh, I meant to use the devm_snd_soc_register_platform() so the unregister is not going to be needed and the subsequent patches are expecting that this is devm_* Will resend soon.
There's no devm variant for snd_soc_register_platform() Mark: would it make sens to add it? I can add a patch to v2 of this series for it.
Assign the dai dma data at dai driver probe time, not in startup.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/omap-mcpdm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c index 2f5b1536477e..489cb1f972a6 100644 --- a/sound/soc/omap/omap-mcpdm.c +++ b/sound/soc/omap/omap-mcpdm.c @@ -265,9 +265,6 @@ static int omap_mcpdm_dai_startup(struct snd_pcm_substream *substream, } mutex_unlock(&mcpdm->mutex);
- snd_soc_dai_set_dma_data(dai, substream, - &mcpdm->dma_data[substream->stream]); - return 0; }
@@ -406,6 +403,10 @@ static int omap_mcpdm_probe(struct snd_soc_dai *dai) mcpdm->config[SNDRV_PCM_STREAM_PLAYBACK].threshold = 2; mcpdm->config[SNDRV_PCM_STREAM_CAPTURE].threshold = MCPDM_UP_THRES_MAX - 3; + + dai->playback_dma_data = &mcpdm->dma_data[SNDRV_PCM_STREAM_PLAYBACK]; + dai->capture_dma_data = &mcpdm->dma_data[SNDRV_PCM_STREAM_CAPTURE]; + return ret; }
On Wed, Apr 16, 2014 at 12:23:15PM +0300, Peter Ujfalusi wrote:
- snd_soc_dai_set_dma_data(dai, substream,
&mcpdm->dma_data[substream->stream]);
- return 0;
}
@@ -406,6 +403,10 @@ static int omap_mcpdm_probe(struct snd_soc_dai *dai) mcpdm->config[SNDRV_PCM_STREAM_PLAYBACK].threshold = 2; mcpdm->config[SNDRV_PCM_STREAM_CAPTURE].threshold = MCPDM_UP_THRES_MAX - 3;
- dai->playback_dma_data = &mcpdm->dma_data[SNDRV_PCM_STREAM_PLAYBACK];
- dai->capture_dma_data = &mcpdm->dma_data[SNDRV_PCM_STREAM_CAPTURE];
Any reason to stop using _set_dma_data()?
On 04/16/2014 01:15 PM, Mark Brown wrote:
On Wed, Apr 16, 2014 at 12:23:15PM +0300, Peter Ujfalusi wrote:
- snd_soc_dai_set_dma_data(dai, substream,
&mcpdm->dma_data[substream->stream]);
- return 0;
}
@@ -406,6 +403,10 @@ static int omap_mcpdm_probe(struct snd_soc_dai *dai) mcpdm->config[SNDRV_PCM_STREAM_PLAYBACK].threshold = 2; mcpdm->config[SNDRV_PCM_STREAM_CAPTURE].threshold = MCPDM_UP_THRES_MAX - 3;
- dai->playback_dma_data = &mcpdm->dma_data[SNDRV_PCM_STREAM_PLAYBACK];
- dai->capture_dma_data = &mcpdm->dma_data[SNDRV_PCM_STREAM_CAPTURE];
Any reason to stop using _set_dma_data()?
At dai driver probe we do not have substream and snd_soc_dai_set_dma_data() relies on that (substream->stream) to figure out which dma_data to set.
This change is not a must for omap right now, but I have seen on davinci that we need to have the playback/capture_dma_data set at this time if we are using the ASoC generic dmaengine pcm for platform (I use edma-pcm on davinci right now).
On 04/16/2014 12:25 PM, Peter Ujfalusi wrote:
On 04/16/2014 01:15 PM, Mark Brown wrote:
On Wed, Apr 16, 2014 at 12:23:15PM +0300, Peter Ujfalusi wrote:
- snd_soc_dai_set_dma_data(dai, substream,
&mcpdm->dma_data[substream->stream]);
- return 0; }
@@ -406,6 +403,10 @@ static int omap_mcpdm_probe(struct snd_soc_dai *dai) mcpdm->config[SNDRV_PCM_STREAM_PLAYBACK].threshold = 2; mcpdm->config[SNDRV_PCM_STREAM_CAPTURE].threshold = MCPDM_UP_THRES_MAX - 3;
- dai->playback_dma_data = &mcpdm->dma_data[SNDRV_PCM_STREAM_PLAYBACK];
- dai->capture_dma_data = &mcpdm->dma_data[SNDRV_PCM_STREAM_CAPTURE];
Any reason to stop using _set_dma_data()?
At dai driver probe we do not have substream and snd_soc_dai_set_dma_data() relies on that (substream->stream) to figure out which dma_data to set.
You can use snd_soc_dai_init_dma_data(). Not that it saves much code, but it hides the implementation, which makes it easier to change things if we ever have to.
- Lars
Use the same device for the platform driver when registering as the dai driver. This will enable us to clean up some DT booted cases.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/omap-mcpdm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c index 489cb1f972a6..f008eec9dd4b 100644 --- a/sound/soc/omap/omap-mcpdm.c +++ b/sound/soc/omap/omap-mcpdm.c @@ -42,6 +42,7 @@ #include <sound/dmaengine_pcm.h>
#include "omap-mcpdm.h" +#include "omap-pcm.h"
struct mcpdm_link_config { u32 link_mask; /* channel mask for the direction */ @@ -461,6 +462,7 @@ static int asoc_mcpdm_probe(struct platform_device *pdev) { struct omap_mcpdm *mcpdm; struct resource *res; + int ret;
mcpdm = devm_kzalloc(&pdev->dev, sizeof(struct omap_mcpdm), GFP_KERNEL); if (!mcpdm) @@ -491,9 +493,13 @@ static int asoc_mcpdm_probe(struct platform_device *pdev)
mcpdm->dev = &pdev->dev;
- return devm_snd_soc_register_component(&pdev->dev, + ret = devm_snd_soc_register_component(&pdev->dev, &omap_mcpdm_component, &omap_mcpdm_dai, 1); + if (ret) + return ret; + + return omap_pcm_platform_register(&pdev->dev); }
static const struct of_device_id omap_mcpdm_of_match[] = {
Assign the dai dma data at dai driver probe time, not in startup.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/omap-mcbsp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index 6c19bba23570..c01a64619661 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c @@ -149,9 +149,6 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 2); }
- snd_soc_dai_set_dma_data(cpu_dai, substream, - &mcbsp->dma_data[substream->stream]); - return err; }
@@ -559,6 +556,9 @@ static int omap_mcbsp_probe(struct snd_soc_dai *dai)
pm_runtime_enable(mcbsp->dev);
+ dai->playback_dma_data = &mcbsp->dma_data[SNDRV_PCM_STREAM_PLAYBACK]; + dai->capture_dma_data = &mcbsp->dma_data[SNDRV_PCM_STREAM_CAPTURE]; + return 0; }
Use the same device for the platform driver when registering as the dai driver. This will enable us to clean up some DT booted cases.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/omap-mcbsp.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index c01a64619661..89843ea4bbf6 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c @@ -38,6 +38,7 @@ #include <linux/platform_data/asoc-ti-mcbsp.h> #include "mcbsp.h" #include "omap-mcbsp.h" +#include "omap-pcm.h"
#define OMAP_MCBSP_RATES (SNDRV_PCM_RATE_8000_96000)
@@ -799,11 +800,15 @@ static int asoc_mcbsp_probe(struct platform_device *pdev) platform_set_drvdata(pdev, mcbsp);
ret = omap_mcbsp_init(pdev); - if (!ret) - return snd_soc_register_component(&pdev->dev, &omap_mcbsp_component, - &omap_mcbsp_dai, 1); + if (ret) + return ret;
- return ret; + ret = snd_soc_register_component(&pdev->dev, &omap_mcbsp_component, + &omap_mcbsp_dai, 1); + if (ret) + return ret; + + return omap_pcm_platform_register(&pdev->dev); }
static int asoc_mcbsp_remove(struct platform_device *pdev)
Assign the dai dma data at dai driver probe time, not in startup.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/omap-dmic.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c index 1bd531d718f9..350b4d524c86 100644 --- a/sound/soc/omap/omap-dmic.c +++ b/sound/soc/omap/omap-dmic.c @@ -113,7 +113,6 @@ static int omap_dmic_dai_startup(struct snd_pcm_substream *substream,
mutex_unlock(&dmic->mutex);
- snd_soc_dai_set_dma_data(dai, substream, &dmic->dma_data); return ret; }
@@ -417,6 +416,10 @@ static int omap_dmic_probe(struct snd_soc_dai *dai)
/* Configure DMIC threshold value */ dmic->threshold = OMAP_DMIC_THRES_MAX - 3; + + dai->playback_dma_data = NULL; + dai->capture_dma_data = &dmic->dma_data; + return 0; }
Use the same device for the platform driver when registering as the dai driver. This will enable us to clean up some DT booted cases.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/omap-dmic.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c index 350b4d524c86..054dfa8b05c4 100644 --- a/sound/soc/omap/omap-dmic.c +++ b/sound/soc/omap/omap-dmic.c @@ -42,6 +42,7 @@ #include <sound/dmaengine_pcm.h>
#include "omap-dmic.h" +#include "omap-pcm.h"
struct omap_dmic { struct device *dev; @@ -495,6 +496,10 @@ static int asoc_dmic_probe(struct platform_device *pdev) if (ret) goto err_put_clk;
+ ret = omap_pcm_platform_register(&pdev->dev); + if (ret) + goto err_put_clk; + return 0;
err_put_clk:
Use the same device for the platform driver when registering as the dai driver. This will enable us to clean up some DT booted cases.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/omap-hdmi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sound/soc/omap/omap-hdmi.c b/sound/soc/omap/omap-hdmi.c index ced3b88b44d4..32614b49653c 100644 --- a/sound/soc/omap/omap-hdmi.c +++ b/sound/soc/omap/omap-hdmi.c @@ -36,6 +36,7 @@ #include <video/omapdss.h>
#include "omap-hdmi.h" +#include "omap-pcm.h"
#define DRV_NAME "omap-hdmi-audio-dai"
@@ -324,7 +325,11 @@ static int omap_hdmi_probe(struct platform_device *pdev) ret = snd_soc_register_component(&pdev->dev, &omap_hdmi_component, &omap_hdmi_dai, 1);
- return ret; + if (ret) + return ret; + + return omap_pcm_platform_register(&pdev->dev); +} }
static int omap_hdmi_remove(struct platform_device *pdev)
Now that the platform driver is registered with the cpu_dai's device we can use the same node for it instead of the hardwired name. We can also remove the cpu_dai_name and platform_name from the dai_link struct since we only support DT boot on OMAP4/5
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/omap-abe-twl6040.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c index 024dafc3e298..1a89e5b1be16 100644 --- a/sound/soc/omap/omap-abe-twl6040.c +++ b/sound/soc/omap/omap-abe-twl6040.c @@ -214,9 +214,7 @@ static struct snd_soc_dai_link abe_twl6040_dai_links[] = { { .name = "TWL6040", .stream_name = "TWL6040", - .cpu_dai_name = "omap-mcpdm", .codec_dai_name = "twl6040-legacy", - .platform_name = "omap-pcm-audio", .codec_name = "twl6040-codec", .init = omap_abe_twl6040_init, .ops = &omap_abe_ops, @@ -224,9 +222,7 @@ static struct snd_soc_dai_link abe_twl6040_dai_links[] = { { .name = "DMIC", .stream_name = "DMIC Capture", - .cpu_dai_name = "omap-dmic", .codec_dai_name = "dmic-hifi", - .platform_name = "omap-pcm-audio", .codec_name = "dmic-codec", .init = omap_abe_dmic_init, .ops = &omap_abe_dmic_ops, @@ -281,14 +277,14 @@ static int omap_abe_probe(struct platform_device *pdev) dev_err(&pdev->dev, "McPDM node is not provided\n"); return -EINVAL; } - abe_twl6040_dai_links[0].cpu_dai_name = NULL; abe_twl6040_dai_links[0].cpu_of_node = dai_node; + abe_twl6040_dai_links[0].platform_of_node = dai_node;
dai_node = of_parse_phandle(node, "ti,dmic", 0); if (dai_node) { num_links = 2; - abe_twl6040_dai_links[1].cpu_dai_name = NULL; abe_twl6040_dai_links[1].cpu_of_node = dai_node; + abe_twl6040_dai_links[1].platform_of_node = dai_node;
priv->dmic_codec_dev = platform_device_register_simple( "dmic-codec", -1, NULL, 0);
Now that the platform driver is registered with the cpu_dai's device we can use the same name/node for it.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/omap-twl4030.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/sound/soc/omap/omap-twl4030.c b/sound/soc/omap/omap-twl4030.c index 6a8d6b5f160d..0c83e206e957 100644 --- a/sound/soc/omap/omap-twl4030.c +++ b/sound/soc/omap/omap-twl4030.c @@ -239,7 +239,7 @@ static struct snd_soc_dai_link omap_twl4030_dai_links[] = { .stream_name = "TWL4030 HiFi", .cpu_dai_name = "omap-mcbsp.2", .codec_dai_name = "twl4030-hifi", - .platform_name = "omap-pcm-audio", + .platform_name = "omap-mcbsp.2", .codec_name = "twl4030-codec", .init = omap_twl4030_init, .ops = &omap_twl4030_ops, @@ -249,7 +249,7 @@ static struct snd_soc_dai_link omap_twl4030_dai_links[] = { .stream_name = "TWL4030 Voice", .cpu_dai_name = "omap-mcbsp.3", .codec_dai_name = "twl4030-voice", - .platform_name = "omap-pcm-audio", + .platform_name = "omap-mcbsp.2", .codec_name = "twl4030-codec", .dai_fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_IB_NF | SND_SOC_DAIFMT_CBM_CFM, @@ -299,12 +299,18 @@ static int omap_twl4030_probe(struct platform_device *pdev) omap_twl4030_dai_links[0].cpu_dai_name = NULL; omap_twl4030_dai_links[0].cpu_of_node = dai_node;
+ omap_twl4030_dai_links[0].platform_name = NULL; + omap_twl4030_dai_links[0].platform_of_node = dai_node; + dai_node = of_parse_phandle(node, "ti,mcbsp-voice", 0); if (!dai_node) { card->num_links = 1; } else { omap_twl4030_dai_links[1].cpu_dai_name = NULL; omap_twl4030_dai_links[1].cpu_of_node = dai_node; + + omap_twl4030_dai_links[1].platform_name = NULL; + omap_twl4030_dai_links[1].platform_of_node = dai_node; }
priv->jack_detect = of_get_named_gpio(node,
Now that the platform driver is registered with the cpu_dai's device we can use the same name for it.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/am3517evm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/omap/am3517evm.c b/sound/soc/omap/am3517evm.c index 994dcf345975..25a33e9d417a 100644 --- a/sound/soc/omap/am3517evm.c +++ b/sound/soc/omap/am3517evm.c @@ -77,7 +77,7 @@ static struct snd_soc_dai_link am3517evm_dai = { .stream_name = "AIC23", .cpu_dai_name = "omap-mcbsp.1", .codec_dai_name = "tlv320aic23-hifi", - .platform_name = "omap-pcm-audio", + .platform_name = "omap-mcbsp.1", .codec_name = "tlv320aic23-codec.2-001a", .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM,
Now that the platform driver is registered with the cpu_dai's device we can use the same name for it.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/ams-delta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c index 56a5219c0a00..5928a811ffd0 100644 --- a/sound/soc/omap/ams-delta.c +++ b/sound/soc/omap/ams-delta.c @@ -565,7 +565,7 @@ static struct snd_soc_dai_link ams_delta_dai_link = { .cpu_dai_name = "omap-mcbsp.1", .codec_dai_name = "cx20442-voice", .init = ams_delta_cx20442_init, - .platform_name = "omap-pcm-audio", + .platform_name = "omap-mcbsp.1", .codec_name = "cx20442-codec", .ops = &ams_delta_ops, };
Now that the platform driver is registered with the cpu_dai's device we can use the same name for it.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/n810.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c index fd4d9c809e50..5d7f9cebe041 100644 --- a/sound/soc/omap/n810.c +++ b/sound/soc/omap/n810.c @@ -278,7 +278,7 @@ static struct snd_soc_dai_link n810_dai = { .name = "TLV320AIC33", .stream_name = "AIC33", .cpu_dai_name = "omap-mcbsp.2", - .platform_name = "omap-pcm-audio", + .platform_name = "omap-mcbsp.2", .codec_name = "tlv320aic3x-codec.2-0018", .codec_dai_name = "tlv320aic3x-hifi", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
Now that the platform driver is registered with the cpu_dai's device we can use the same name for it.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/omap3pandora.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c index cf604a2faa18..3b7c39c93e78 100644 --- a/sound/soc/omap/omap3pandora.c +++ b/sound/soc/omap/omap3pandora.c @@ -215,7 +215,7 @@ static struct snd_soc_dai_link omap3pandora_dai[] = { .stream_name = "HiFi Out", .cpu_dai_name = "omap-mcbsp.2", .codec_dai_name = "twl4030-hifi", - .platform_name = "omap-pcm-audio", + .platform_name = "omap-mcbsp.2", .codec_name = "twl4030-codec", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, @@ -226,7 +226,7 @@ static struct snd_soc_dai_link omap3pandora_dai[] = { .stream_name = "Line/Mic In", .cpu_dai_name = "omap-mcbsp.4", .codec_dai_name = "twl4030-hifi", - .platform_name = "omap-pcm-audio", + .platform_name = "omap-mcbsp.4", .codec_name = "twl4030-codec", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS,
Now that the platform driver is registered with the cpu_dai's device we can use the same name for it.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/osk5912.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c index d03e57da7708..aa4053bf6710 100644 --- a/sound/soc/omap/osk5912.c +++ b/sound/soc/omap/osk5912.c @@ -96,7 +96,7 @@ static struct snd_soc_dai_link osk_dai = { .stream_name = "AIC23", .cpu_dai_name = "omap-mcbsp.1", .codec_dai_name = "tlv320aic23-hifi", - .platform_name = "omap-pcm-audio", + .platform_name = "omap-mcbsp.1", .codec_name = "tlv320aic23-codec", .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM,
Now that the platform driver is registered with the cpu_dai's device we can use the same name for it.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/rx51.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c index 7fb3d4b10370..9aac6054da3c 100644 --- a/sound/soc/omap/rx51.c +++ b/sound/soc/omap/rx51.c @@ -358,7 +358,7 @@ static struct snd_soc_dai_link rx51_dai[] = { .stream_name = "AIC34", .cpu_dai_name = "omap-mcbsp.2", .codec_dai_name = "tlv320aic3x-hifi", - .platform_name = "omap-pcm-audio", + .platform_name = "omap-mcbsp.2", .codec_name = "tlv320aic3x-codec.2-0018", .dai_fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_IB_NF | SND_SOC_DAIFMT_CBM_CFM,
Now that the platform driver is registered with the cpu_dai's device we can use the same name for it.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/omap-hdmi-card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/omap/omap-hdmi-card.c b/sound/soc/omap/omap-hdmi-card.c index 7e66e9cba5a8..f649fe84b629 100644 --- a/sound/soc/omap/omap-hdmi-card.c +++ b/sound/soc/omap/omap-hdmi-card.c @@ -33,7 +33,7 @@ static struct snd_soc_dai_link omap_hdmi_dai = { .name = "HDMI", .stream_name = "HDMI", .cpu_dai_name = "omap-hdmi-audio-dai", - .platform_name = "omap-pcm-audio", + .platform_name = "omap-hdmi-audio-dai", .codec_name = "hdmi-audio-codec", .codec_dai_name = "hdmi-hifi", };
The omap-pcm no longer need to be a platform driver since all cpu_dai will bind the platform to it's own device which we can use.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/omap-pcm.c | 25 ------------------------- 1 file changed, 25 deletions(-)
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index 5c4bc9ae974b..4da8b542b87a 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c @@ -244,31 +244,6 @@ void omap_pcm_platform_unregister(struct device *dev) } EXPORT_SYMBOL_GPL(omap_pcm_platform_unregister);
-static int omap_pcm_probe(struct platform_device *pdev) -{ - return snd_soc_register_platform(&pdev->dev, - &omap_soc_platform); -} - -static int omap_pcm_remove(struct platform_device *pdev) -{ - snd_soc_unregister_platform(&pdev->dev); - return 0; -} - -static struct platform_driver omap_pcm_driver = { - .driver = { - .name = "omap-pcm-audio", - .owner = THIS_MODULE, - }, - - .probe = omap_pcm_probe, - .remove = omap_pcm_remove, -}; - -module_platform_driver(omap_pcm_driver); - MODULE_AUTHOR("Jarkko Nikula jarkko.nikula@bitmer.com"); MODULE_DESCRIPTION("OMAP PCM DMA module"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:omap-pcm-audio");
participants (3)
-
Lars-Peter Clausen
-
Mark Brown
-
Peter Ujfalusi