Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device
@ 2014-04-16 12:46 Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 01/20] ASoC: Add resource managed snd_soc_register_platform() Peter Ujfalusi
                   ` (20 more replies)
  0 siblings, 21 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

Hi,

Changes since v1:
- Add resource managed snd_soc_register_platform()
- Use snd_soc_dai_init_dma_data()
- omap-pcm is using the devm_snd_soc_register_platform()
- Patch for davinci-mcasp since Version4 is using omap-pcm

Cover letter from v1:

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 (20):
  ASoC: Add resource managed snd_soc_register_platform()
  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: davinci-mcasp: Update MCASP_VERSION_4 platform driver
    registration
  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

 include/sound/soc.h               |  2 ++
 sound/soc/davinci/davinci-mcasp.c | 37 +++++++++++++++++++++++++++++++------
 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        |  9 ++++++++-
 sound/soc/omap/omap-hdmi-card.c   |  2 +-
 sound/soc/omap/omap-hdmi.c        |  7 ++++++-
 sound/soc/omap/omap-mcbsp.c       | 20 +++++++++++++-------
 sound/soc/omap/omap-mcpdm.c       | 16 ++++++++++++----
 sound/soc/omap/omap-pcm.c         | 25 +++----------------------
 sound/soc/omap/omap-pcm.h         | 30 ++++++++++++++++++++++++++++++
 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 +-
 sound/soc/soc-devres.c            | 34 ++++++++++++++++++++++++++++++++++
 18 files changed, 157 insertions(+), 57 deletions(-)
 create mode 100644 sound/soc/omap/omap-pcm.h

-- 
1.9.2

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v2 01/20] ASoC: Add resource managed snd_soc_register_platform()
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 02/20] ASoC: omap-pcm: Support for binding the platform driver to dai devices Peter Ujfalusi
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

Simplify error handling and remove repetitive (and rarely executed) code
for unregistration by providing a devm_snd_soc_register_platform()
platform.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 include/sound/soc.h    |  2 ++
 sound/soc/soc-devres.c | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 33965946656c..9e214ec70c8a 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -375,6 +375,8 @@ int snd_soc_resume(struct device *dev);
 int snd_soc_poweroff(struct device *dev);
 int snd_soc_register_platform(struct device *dev,
 		const struct snd_soc_platform_driver *platform_drv);
+int devm_snd_soc_register_platform(struct device *dev,
+		const struct snd_soc_platform_driver *platform_drv);
 void snd_soc_unregister_platform(struct device *dev);
 int snd_soc_add_platform(struct device *dev, struct snd_soc_platform *platform,
 		const struct snd_soc_platform_driver *platform_drv);
diff --git a/sound/soc/soc-devres.c b/sound/soc/soc-devres.c
index 7ac745df1412..e94aa0277250 100644
--- a/sound/soc/soc-devres.c
+++ b/sound/soc/soc-devres.c
@@ -52,6 +52,40 @@ int devm_snd_soc_register_component(struct device *dev,
 }
 EXPORT_SYMBOL_GPL(devm_snd_soc_register_component);
 
+static void devm_platform_release(struct device *dev, void *res)
+{
+	snd_soc_unregister_platform(*(struct device **)res);
+}
+
+/**
+ * devm_snd_soc_register_platform - resource managed platform registration
+ * @dev: Device used to manage platform
+ * @platform: platform to register
+ *
+ * Register a platform driver with automatic unregistration when the device is
+ * unregistered.
+ */
+int devm_snd_soc_register_platform(struct device *dev,
+			const struct snd_soc_platform_driver *platform_drv)
+{
+	struct device **ptr;
+	int ret;
+
+	ptr = devres_alloc(devm_platform_release, sizeof(*ptr), GFP_KERNEL);
+	if (!ptr)
+		return -ENOMEM;
+
+	ret = snd_soc_register_platform(dev, platform_drv);
+	if (ret == 0) {
+		*ptr = dev;
+		devres_add(dev, ptr);
+	} else {
+		devres_free(ptr);
+	}
+
+	return ret;
+}
+
 static void devm_card_release(struct device *dev, void *res)
 {
 	snd_soc_unregister_card(*(struct snd_soc_card **)res);
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 02/20] ASoC: omap-pcm: Support for binding the platform driver to dai devices
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 01/20] ASoC: Add resource managed snd_soc_register_platform() Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 03/20] ASoC: omap-mcpdm: Assign the dai DMA data at earlier time Peter Ujfalusi
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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 |  6 ++++++
 sound/soc/omap/omap-pcm.h | 30 ++++++++++++++++++++++++++++++
 2 files changed, 36 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..c3711b582d5f 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -232,6 +232,12 @@ 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 devm_snd_soc_register_platform(dev, &omap_soc_platform);
+}
+EXPORT_SYMBOL_GPL(omap_pcm_platform_register);
+
 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..c1d2f31d71e9
--- /dev/null
+++ b/sound/soc/omap/omap-pcm.h
@@ -0,0 +1,30 @@
+/*
+ * 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);
+#else
+static inline int omap_pcm_platform_register(struct device *dev)
+{
+	return 0;
+}
+#endif /* CONFIG_SND_OMAP_SOC */
+
+#endif /* __OMAP_PCM_H__ */
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 03/20] ASoC: omap-mcpdm: Assign the dai DMA data at earlier time
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 01/20] ASoC: Add resource managed snd_soc_register_platform() Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 02/20] ASoC: omap-pcm: Support for binding the platform driver to dai devices Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 04/20] ASoC: omap-mcpdm: Bind the platform driver to the dai driver when loading Peter Ujfalusi
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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 | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index 2f5b1536477e..e984b0485e92 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,11 @@ 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;
+
+	snd_soc_dai_init_dma_data(dai,
+				  &mcpdm->dma_data[SNDRV_PCM_STREAM_PLAYBACK],
+				  &mcpdm->dma_data[SNDRV_PCM_STREAM_CAPTURE]);
+
 	return ret;
 }
 
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 04/20] ASoC: omap-mcpdm: Bind the platform driver to the dai driver when loading
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (2 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 03/20] ASoC: omap-mcpdm: Assign the dai DMA data at earlier time Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 05/20] ASoC: omap-mcbsp: Assign the dai DMA data at earlier time Peter Ujfalusi
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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 e984b0485e92..d8ebb52645a9 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 */
@@ -462,6 +463,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)
@@ -492,9 +494,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[] = {
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 05/20] ASoC: omap-mcbsp: Assign the dai DMA data at earlier time
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (3 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 04/20] ASoC: omap-mcpdm: Bind the platform driver to the dai driver when loading Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 06/20] ASoC: omap-mcbsp: Bind the platform driver to the dai driver when loading Peter Ujfalusi
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index 6c19bba23570..4525190d5599 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,10 @@ static int omap_mcbsp_probe(struct snd_soc_dai *dai)
 
 	pm_runtime_enable(mcbsp->dev);
 
+	snd_soc_dai_init_dma_data(dai,
+				  &mcbsp->dma_data[SNDRV_PCM_STREAM_PLAYBACK],
+				  &mcbsp->dma_data[SNDRV_PCM_STREAM_CAPTURE]);
+
 	return 0;
 }
 
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 06/20] ASoC: omap-mcbsp: Bind the platform driver to the dai driver when loading
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (4 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 05/20] ASoC: omap-mcbsp: Assign the dai DMA data at earlier time Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 07/20] ASoC: omap-dmic: Assign the dai DMA data at earlier time Peter Ujfalusi
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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 4525190d5599..af2764adf252 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)
 
@@ -800,11 +801,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)
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 07/20] ASoC: omap-dmic: Assign the dai DMA data at earlier time
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (5 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 06/20] ASoC: omap-mcbsp: Bind the platform driver to the dai driver when loading Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 08/20] ASoC: omap-dmic: Bind the platform driver to the dai driver when loading Peter Ujfalusi
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c
index 1bd531d718f9..7fb7703264fa 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,9 @@ static int omap_dmic_probe(struct snd_soc_dai *dai)
 
 	/* Configure DMIC threshold value */
 	dmic->threshold = OMAP_DMIC_THRES_MAX - 3;
+
+	snd_soc_dai_init_dma_data(dai, NULL, &dmic->dma_data);
+
 	return 0;
 }
 
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 08/20] ASoC: omap-dmic: Bind the platform driver to the dai driver when loading
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (6 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 07/20] ASoC: omap-dmic: Assign the dai DMA data at earlier time Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 09/20] ASoC: omap-hdmi: " Peter Ujfalusi
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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 7fb7703264fa..53da041896c4 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;
@@ -494,6 +495,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:
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 09/20] ASoC: omap-hdmi: Bind the platform driver to the dai driver when loading
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (7 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 08/20] ASoC: omap-dmic: Bind the platform driver to the dai driver when loading Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-21 12:54   ` Lars-Peter Clausen
  2014-04-16 12:46 ` [PATCH v2 10/20] ASoC: davinci-mcasp: Update MCASP_VERSION_4 platform driver registration Peter Ujfalusi
                   ` (11 subsequent siblings)
  20 siblings, 1 reply; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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)
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 10/20] ASoC: davinci-mcasp: Update MCASP_VERSION_4 platform driver registration
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (8 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 09/20] ASoC: omap-hdmi: " Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 11/20] ASoC: omap-abe-twl6040: Use the cpu_dai node to specify the platform driver Peter Ujfalusi
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

Version 4 of McASP is using omap-pcm as platform driver and the omap-pcm
platform need to be registered using the cpu dai's device.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/davinci/davinci-mcasp.c | 37 +++++++++++++++++++++++++++++++------
 1 file changed, 31 insertions(+), 6 deletions(-)

diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index af92d3e8671d..d505fe7292a4 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -36,6 +36,7 @@
 
 #include "davinci-pcm.h"
 #include "davinci-mcasp.h"
+#include "../omap/omap-pcm.h"
 
 #define MCASP_MAX_AFIFO_DEPTH	64
 
@@ -1220,12 +1221,25 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 	if (ret != 0)
 		goto err_release_clk;
 
-	if (mcasp->version != MCASP_VERSION_4) {
+	switch (mcasp->version) {
+	case MCASP_VERSION_1:
+	case MCASP_VERSION_2:
+	case MCASP_VERSION_3:
 		ret = davinci_soc_platform_register(&pdev->dev);
-		if (ret) {
-			dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
-			goto err_unregister_component;
-		}
+		break;
+	case MCASP_VERSION_4:
+		ret = omap_pcm_platform_register(&pdev->dev);
+		break;
+	default:
+		dev_err(&pdev->dev, "Invalid McASP version: %d\n",
+			mcasp->version);
+		ret = -EINVAL;
+		break;
+	}
+
+	if (ret) {
+		dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
+		goto err_unregister_component;
 	}
 
 	return 0;
@@ -1243,8 +1257,19 @@ static int davinci_mcasp_remove(struct platform_device *pdev)
 	struct davinci_mcasp *mcasp = dev_get_drvdata(&pdev->dev);
 
 	snd_soc_unregister_component(&pdev->dev);
-	if (mcasp->version != MCASP_VERSION_4)
+
+	switch (mcasp->version) {
+	case MCASP_VERSION_1:
+	case MCASP_VERSION_2:
+	case MCASP_VERSION_3:
 		davinci_soc_platform_unregister(&pdev->dev);
+		break;
+	case MCASP_VERSION_4:
+		/* Using the resource managed omap-pcm as platform driver */
+		break;
+	default:
+		break;
+	}
 
 	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 11/20] ASoC: omap-abe-twl6040: Use the cpu_dai node to specify the platform driver
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (9 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 10/20] ASoC: davinci-mcasp: Update MCASP_VERSION_4 platform driver registration Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 12/20] ASoC: omap-twl4030: Use the same name/node for platform as the cpu_dai Peter Ujfalusi
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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);
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 12/20] ASoC: omap-twl4030: Use the same name/node for platform as the cpu_dai
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (10 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 11/20] ASoC: omap-abe-twl6040: Use the cpu_dai node to specify the platform driver Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 13/20] ASoC: am3517evm: Use the same name " Peter Ujfalusi
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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,
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 13/20] ASoC: am3517evm: Use the same name for platform as the cpu_dai
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (11 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 12/20] ASoC: omap-twl4030: Use the same name/node for platform as the cpu_dai Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 14/20] ASoC: ams-delta: " Peter Ujfalusi
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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,
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 14/20] ASoC: ams-delta: Use the same name for platform as the cpu_dai
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (12 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 13/20] ASoC: am3517evm: Use the same name " Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 15/20] ASoC: n810: " Peter Ujfalusi
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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 2ac0a0c3b570..b0f8dbc1f635 100644
--- a/sound/soc/omap/ams-delta.c
+++ b/sound/soc/omap/ams-delta.c
@@ -536,7 +536,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,
 };
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 15/20] ASoC: n810: Use the same name for platform as the cpu_dai
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (13 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 14/20] ASoC: ams-delta: " Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 16/20] ASoC: omap3pandora: " Peter Ujfalusi
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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 |
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 16/20] ASoC: omap3pandora: Use the same name for platform as the cpu_dai
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (14 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 15/20] ASoC: n810: " Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 17/20] ASoC: osk5912: " Peter Ujfalusi
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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 02181bb70400..076bec606d78 100644
--- a/sound/soc/omap/omap3pandora.c
+++ b/sound/soc/omap/omap3pandora.c
@@ -197,7 +197,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,
@@ -208,7 +208,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,
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 17/20] ASoC: osk5912: Use the same name for platform as the cpu_dai
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (15 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 16/20] ASoC: omap3pandora: " Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 18/20] ASoC: rx51: " Peter Ujfalusi
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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,
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 18/20] ASoC: rx51: Use the same name for platform as the cpu_dai
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (16 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 17/20] ASoC: osk5912: " Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 19/20] ASoC: omap-hdmi-card: " Peter Ujfalusi
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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 2b4641123142..add0047ea6c5 100644
--- a/sound/soc/omap/rx51.c
+++ b/sound/soc/omap/rx51.c
@@ -319,7 +319,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,
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 19/20] ASoC: omap-hdmi-card: Use the same name for platform as the cpu_dai
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (17 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 18/20] ASoC: rx51: " Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-16 12:46 ` [PATCH v2 20/20] ASoC: omap-pcm: Drop the platform driver init code Peter Ujfalusi
  2014-04-18 17:05 ` [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Mark Brown
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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",
 };
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 20/20] ASoC: omap-pcm: Drop the platform driver init code
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (18 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 19/20] ASoC: omap-hdmi-card: " Peter Ujfalusi
@ 2014-04-16 12:46 ` Peter Ujfalusi
  2014-04-18 17:05 ` [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Mark Brown
  20 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-16 12:46 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, lars, Jyri Sarha, Jarkko Nikula, notasas

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 c3711b582d5f..8d809f8509c8 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -238,31 +238,6 @@ int omap_pcm_platform_register(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(omap_pcm_platform_register);
 
-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");
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device
  2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
                   ` (19 preceding siblings ...)
  2014-04-16 12:46 ` [PATCH v2 20/20] ASoC: omap-pcm: Drop the platform driver init code Peter Ujfalusi
@ 2014-04-18 17:05 ` Mark Brown
  20 siblings, 0 replies; 24+ messages in thread
From: Mark Brown @ 2014-04-18 17:05 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: alsa-devel, lars, Liam Girdwood, Jyri Sarha, notasas,
	Jarkko Nikula


[-- Attachment #1.1: Type: text/plain, Size: 121 bytes --]

On Wed, Apr 16, 2014 at 03:46:10PM +0300, Peter Ujfalusi wrote:
> Hi,
> 
> Changes since v1:

Applied all, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 09/20] ASoC: omap-hdmi: Bind the platform driver to the dai driver when loading
  2014-04-16 12:46 ` [PATCH v2 09/20] ASoC: omap-hdmi: " Peter Ujfalusi
@ 2014-04-21 12:54   ` Lars-Peter Clausen
  2014-04-22  7:26     ` Peter Ujfalusi
  0 siblings, 1 reply; 24+ messages in thread
From: Lars-Peter Clausen @ 2014-04-21 12:54 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: alsa-devel, Liam Girdwood, Jyri Sarha, Mark Brown, notasas,
	Jarkko Nikula

On 04/16/2014 02:46 PM, Peter Ujfalusi wrote:
[...]
> +	return omap_pcm_platform_register(&pdev->dev);
> +}
>   }
There is a excess } here.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 09/20] ASoC: omap-hdmi: Bind the platform driver to the dai driver when loading
  2014-04-21 12:54   ` Lars-Peter Clausen
@ 2014-04-22  7:26     ` Peter Ujfalusi
  0 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2014-04-22  7:26 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: alsa-devel, Liam Girdwood, Jyri Sarha, Mark Brown, notasas,
	Jarkko Nikula

On 04/21/2014 03:54 PM, Lars-Peter Clausen wrote:
> On 04/16/2014 02:46 PM, Peter Ujfalusi wrote:
> [...]
>> +    return omap_pcm_platform_register(&pdev->dev);
>> +}
>>   }
> There is a excess } here.

Aargh, true. I don't have omap-hdmi available to build in my config since I do
not have display support enabled for omap4/omap5.

Will send a patch to fix it asap.

Thanks,
Péter

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2014-04-22  7:26 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-16 12:46 [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 01/20] ASoC: Add resource managed snd_soc_register_platform() Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 02/20] ASoC: omap-pcm: Support for binding the platform driver to dai devices Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 03/20] ASoC: omap-mcpdm: Assign the dai DMA data at earlier time Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 04/20] ASoC: omap-mcpdm: Bind the platform driver to the dai driver when loading Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 05/20] ASoC: omap-mcbsp: Assign the dai DMA data at earlier time Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 06/20] ASoC: omap-mcbsp: Bind the platform driver to the dai driver when loading Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 07/20] ASoC: omap-dmic: Assign the dai DMA data at earlier time Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 08/20] ASoC: omap-dmic: Bind the platform driver to the dai driver when loading Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 09/20] ASoC: omap-hdmi: " Peter Ujfalusi
2014-04-21 12:54   ` Lars-Peter Clausen
2014-04-22  7:26     ` Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 10/20] ASoC: davinci-mcasp: Update MCASP_VERSION_4 platform driver registration Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 11/20] ASoC: omap-abe-twl6040: Use the cpu_dai node to specify the platform driver Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 12/20] ASoC: omap-twl4030: Use the same name/node for platform as the cpu_dai Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 13/20] ASoC: am3517evm: Use the same name " Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 14/20] ASoC: ams-delta: " Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 15/20] ASoC: n810: " Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 16/20] ASoC: omap3pandora: " Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 17/20] ASoC: osk5912: " Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 18/20] ASoC: rx51: " Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 19/20] ASoC: omap-hdmi-card: " Peter Ujfalusi
2014-04-16 12:46 ` [PATCH v2 20/20] ASoC: omap-pcm: Drop the platform driver init code Peter Ujfalusi
2014-04-18 17:05 ` [PATCH v2 00/20] ASoC: omap: Bind the omap-pcm platform driver to dai device Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox