All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ASoC: davinci-mcasp/edma: Switch AM335x/43xx to edma-pcm
@ 2014-07-16 12:12 Peter Ujfalusi
  2014-07-16 12:12 ` [PATCH 1/3] ASoC: edma-pcm: Remove PCM_INFO_BATCH and add PCM_INFO_NO_PERIOD_WAKEUP flag Peter Ujfalusi
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Peter Ujfalusi @ 2014-07-16 12:12 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, jsarha, zonque

Hi,

This series will switch the AM335x/AM43xx SoCs to use the edma-pcm as platform
driver instead of the old davinic-pcm.
Doing this we can benefit improvements within the dmaengine driver stack and are
going to rely on standard interfaces towards the DMA.

Regards,
Peter
---
Peter Ujfalusi (3):
  ASoC: edma-pcm: Remove PCM_INFO_BATCH and add
    PCM_INFO_NO_PERIOD_WAKEUP flag
  ASoC: edma-pcm: Add empty functions for !CONFIG_SND_EDMA_SOC builds
  ASoC: davinci-mcasp: Use dmaengine based platform driver for
    AM335x/447x

 sound/soc/davinci/Kconfig         | 18 ++++++++++++++----
 sound/soc/davinci/Makefile        |  2 ++
 sound/soc/davinci/davinci-mcasp.c | 11 +++++++++--
 sound/soc/davinci/edma-pcm.c      |  2 +-
 sound/soc/davinci/edma-pcm.h      |  7 +++++++
 5 files changed, 33 insertions(+), 7 deletions(-)

-- 
2.0.0

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

* [PATCH 1/3] ASoC: edma-pcm: Remove PCM_INFO_BATCH and add PCM_INFO_NO_PERIOD_WAKEUP flag
  2014-07-16 12:12 [PATCH 0/3] ASoC: davinci-mcasp/edma: Switch AM335x/43xx to edma-pcm Peter Ujfalusi
@ 2014-07-16 12:12 ` Peter Ujfalusi
  2014-07-16 12:12 ` [PATCH 2/3] ASoC: edma-pcm: Add empty functions for !CONFIG_SND_EDMA_SOC builds Peter Ujfalusi
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Ujfalusi @ 2014-07-16 12:12 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, jsarha, zonque

The SNDRV_PCM_INFO_BATCH will be added back based on the dmaengine driver's
capabilities.
Patches for edma dmaengine driver has been prepared to suppress the
interrupts. We can add this flag right away and have the benefit of not
having interrupts during audio activity when the edma and ASoC patches
are in the same tree.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/davinci/edma-pcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/davinci/edma-pcm.c b/sound/soc/davinci/edma-pcm.c
index d38afb1c61ae..605e643133db 100644
--- a/sound/soc/davinci/edma-pcm.c
+++ b/sound/soc/davinci/edma-pcm.c
@@ -28,8 +28,8 @@
 static const struct snd_pcm_hardware edma_pcm_hardware = {
 	.info			= SNDRV_PCM_INFO_MMAP |
 				  SNDRV_PCM_INFO_MMAP_VALID |
-				  SNDRV_PCM_INFO_BATCH |
 				  SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME |
+				  SNDRV_PCM_INFO_NO_PERIOD_WAKEUP |
 				  SNDRV_PCM_INFO_INTERLEAVED,
 	.buffer_bytes_max	= 128 * 1024,
 	.period_bytes_min	= 32,
-- 
2.0.0

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

* [PATCH 2/3] ASoC: edma-pcm: Add empty functions for !CONFIG_SND_EDMA_SOC builds
  2014-07-16 12:12 [PATCH 0/3] ASoC: davinci-mcasp/edma: Switch AM335x/43xx to edma-pcm Peter Ujfalusi
  2014-07-16 12:12 ` [PATCH 1/3] ASoC: edma-pcm: Remove PCM_INFO_BATCH and add PCM_INFO_NO_PERIOD_WAKEUP flag Peter Ujfalusi
@ 2014-07-16 12:12 ` Peter Ujfalusi
  2014-07-16 12:12 ` [PATCH 3/3] ASoC: davinci-mcasp: Use dmaengine based platform driver for AM335x/447x Peter Ujfalusi
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Ujfalusi @ 2014-07-16 12:12 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, jsarha, zonque

So drivers mixing with other platform drivers, like davinci-mcasp do not
need to fiddle with CONFIG_SND_EDMA_SOC in their code.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/davinci/edma-pcm.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/soc/davinci/edma-pcm.h b/sound/soc/davinci/edma-pcm.h
index 894c378c0f74..b0957744851c 100644
--- a/sound/soc/davinci/edma-pcm.h
+++ b/sound/soc/davinci/edma-pcm.h
@@ -20,6 +20,13 @@
 #ifndef __EDMA_PCM_H__
 #define __EDMA_PCM_H__
 
+#if IS_ENABLED(CONFIG_SND_EDMA_SOC)
 int edma_pcm_platform_register(struct device *dev);
+#else
+static inline int edma_pcm_platform_register(struct device *dev)
+{
+	return 0;
+}
+#endif /* CONFIG_SND_EDMA_SOC */
 
 #endif /* __EDMA_PCM_H__ */
-- 
2.0.0

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

* [PATCH 3/3] ASoC: davinci-mcasp: Use dmaengine based platform driver for AM335x/447x
  2014-07-16 12:12 [PATCH 0/3] ASoC: davinci-mcasp/edma: Switch AM335x/43xx to edma-pcm Peter Ujfalusi
  2014-07-16 12:12 ` [PATCH 1/3] ASoC: edma-pcm: Remove PCM_INFO_BATCH and add PCM_INFO_NO_PERIOD_WAKEUP flag Peter Ujfalusi
  2014-07-16 12:12 ` [PATCH 2/3] ASoC: edma-pcm: Add empty functions for !CONFIG_SND_EDMA_SOC builds Peter Ujfalusi
@ 2014-07-16 12:12 ` Peter Ujfalusi
  2014-07-16 14:11 ` [PATCH 0/3] ASoC: davinci-mcasp/edma: Switch AM335x/43xx to edma-pcm Daniel Mack
  2014-07-16 21:09 ` Mark Brown
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Ujfalusi @ 2014-07-16 12:12 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, jsarha, zonque

Use the edma-pcm with AM335x and AM437x SoCs.
Keep using the davinci-pcm for daVinci devices, they can be switched to use
the dmaengine based driver later when they are verified to work correctly.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/davinci/Kconfig         | 18 ++++++++++++++----
 sound/soc/davinci/Makefile        |  2 ++
 sound/soc/davinci/davinci-mcasp.c | 11 +++++++++--
 3 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/sound/soc/davinci/Kconfig b/sound/soc/davinci/Kconfig
index fdbb16fffd30..b310dd3489ac 100644
--- a/sound/soc/davinci/Kconfig
+++ b/sound/soc/davinci/Kconfig
@@ -1,12 +1,22 @@
 config SND_DAVINCI_SOC
-	tristate "SoC Audio for TI DAVINCI or AM33XX/AM43XX chips"
-	depends on ARCH_DAVINCI || SOC_AM33XX || SOC_AM43XX
+	tristate "SoC Audio for TI DAVINCI"
+	depends on ARCH_DAVINCI
+
+config SND_EDMA_SOC
+	tristate "SoC Audio for Texas Instruments chips using eDMA (AM33XX/43XX)"
+	depends on SOC_AM33XX || SOC_AM43XX
+	select SND_SOC_GENERIC_DMAENGINE_PCM
+	help
+	  Say Y or M here if you want audio support for TI SoC which uses eDMA.
+	  The following line of SoCs are supported by this platform driver:
+	  - AM335x
+	  - AM437x/AM438x
 
 config SND_DAVINCI_SOC_I2S
 	tristate
 
 config SND_DAVINCI_SOC_MCASP
-	depends on SND_DAVINCI_SOC || SND_OMAP_SOC
+	depends on SND_DAVINCI_SOC || SND_OMAP_SOC || SND_EDMA_SOC
 	tristate
 
 config SND_DAVINCI_SOC_VCIF
@@ -19,7 +29,7 @@ config SND_DAVINCI_SOC_GENERIC_EVM
 
 config SND_AM33XX_SOC_EVM
 	tristate "SoC Audio for the AM33XX chip based boards"
-	depends on SND_DAVINCI_SOC && SOC_AM33XX && I2C
+	depends on SND_EDMA_SOC && SOC_AM33XX && I2C
 	select SND_DAVINCI_SOC_GENERIC_EVM
 	help
 	  Say Y or M if you want to add support for SoC audio on AM33XX
diff --git a/sound/soc/davinci/Makefile b/sound/soc/davinci/Makefile
index 744d4d9a0184..09bf2ba92d38 100644
--- a/sound/soc/davinci/Makefile
+++ b/sound/soc/davinci/Makefile
@@ -1,10 +1,12 @@
 # DAVINCI Platform Support
 snd-soc-davinci-objs := davinci-pcm.o
+snd-soc-edma-objs := edma-pcm.o
 snd-soc-davinci-i2s-objs := davinci-i2s.o
 snd-soc-davinci-mcasp-objs:= davinci-mcasp.o
 snd-soc-davinci-vcif-objs:= davinci-vcif.o
 
 obj-$(CONFIG_SND_DAVINCI_SOC) += snd-soc-davinci.o
+obj-$(CONFIG_SND_EDMA_SOC) += snd-soc-edma.o
 obj-$(CONFIG_SND_DAVINCI_SOC_I2S) += snd-soc-davinci-i2s.o
 obj-$(CONFIG_SND_DAVINCI_SOC_MCASP) += snd-soc-davinci-mcasp.o
 obj-$(CONFIG_SND_DAVINCI_SOC_VCIF) += snd-soc-davinci-vcif.o
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index f7dc538679b1..02421d4275f5 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -37,6 +37,7 @@
 #include <sound/omap-pcm.h>
 
 #include "davinci-pcm.h"
+#include "edma-pcm.h"
 #include "davinci-mcasp.h"
 
 #define MCASP_MAX_AFIFO_DEPTH	64
@@ -831,7 +832,7 @@ static int davinci_mcasp_dai_probe(struct snd_soc_dai *dai)
 {
 	struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai);
 
-	if (mcasp->version == MCASP_VERSION_4) {
+	if (mcasp->version >= MCASP_VERSION_3) {
 		/* Using dmaengine PCM */
 		dai->playback_dma_data =
 				&mcasp->dma_data[SNDRV_PCM_STREAM_PLAYBACK];
@@ -1281,10 +1282,16 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 	 IS_MODULE(CONFIG_SND_DAVINCI_SOC))
 	case MCASP_VERSION_1:
 	case MCASP_VERSION_2:
-	case MCASP_VERSION_3:
 		ret = davinci_soc_platform_register(&pdev->dev);
 		break;
 #endif
+#if IS_BUILTIN(CONFIG_SND_EDMA_SOC) || \
+	(IS_MODULE(CONFIG_SND_DAVINCI_SOC_MCASP) && \
+	 IS_MODULE(CONFIG_SND_EDMA_SOC))
+	case MCASP_VERSION_3:
+		ret = edma_pcm_platform_register(&pdev->dev);
+		break;
+#endif
 #if IS_BUILTIN(CONFIG_SND_OMAP_SOC) || \
 	(IS_MODULE(CONFIG_SND_DAVINCI_SOC_MCASP) && \
 	 IS_MODULE(CONFIG_SND_OMAP_SOC))
-- 
2.0.0

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

* Re: [PATCH 0/3] ASoC: davinci-mcasp/edma: Switch AM335x/43xx to edma-pcm
  2014-07-16 12:12 [PATCH 0/3] ASoC: davinci-mcasp/edma: Switch AM335x/43xx to edma-pcm Peter Ujfalusi
                   ` (2 preceding siblings ...)
  2014-07-16 12:12 ` [PATCH 3/3] ASoC: davinci-mcasp: Use dmaengine based platform driver for AM335x/447x Peter Ujfalusi
@ 2014-07-16 14:11 ` Daniel Mack
  2014-07-16 21:09 ` Mark Brown
  4 siblings, 0 replies; 6+ messages in thread
From: Daniel Mack @ 2014-07-16 14:11 UTC (permalink / raw)
  To: Peter Ujfalusi, Mark Brown, Liam Girdwood; +Cc: alsa-devel, jsarha

Hi Peter,

On 07/16/2014 02:12 PM, Peter Ujfalusi wrote:
> This series will switch the AM335x/AM43xx SoCs to use the edma-pcm as platform
> driver instead of the old davinic-pcm.
> Doing this we can benefit improvements within the dmaengine driver stack and are
> going to rely on standard interfaces towards the DMA.

FWIW, this works fine on our AM335x based custom design.


Thanks,
Daniel


> 
> Regards,
> Peter
> ---
> Peter Ujfalusi (3):
>   ASoC: edma-pcm: Remove PCM_INFO_BATCH and add
>     PCM_INFO_NO_PERIOD_WAKEUP flag
>   ASoC: edma-pcm: Add empty functions for !CONFIG_SND_EDMA_SOC builds
>   ASoC: davinci-mcasp: Use dmaengine based platform driver for
>     AM335x/447x
> 
>  sound/soc/davinci/Kconfig         | 18 ++++++++++++++----
>  sound/soc/davinci/Makefile        |  2 ++
>  sound/soc/davinci/davinci-mcasp.c | 11 +++++++++--
>  sound/soc/davinci/edma-pcm.c      |  2 +-
>  sound/soc/davinci/edma-pcm.h      |  7 +++++++
>  5 files changed, 33 insertions(+), 7 deletions(-)
> 

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

* Re: [PATCH 0/3] ASoC: davinci-mcasp/edma: Switch AM335x/43xx to edma-pcm
  2014-07-16 12:12 [PATCH 0/3] ASoC: davinci-mcasp/edma: Switch AM335x/43xx to edma-pcm Peter Ujfalusi
                   ` (3 preceding siblings ...)
  2014-07-16 14:11 ` [PATCH 0/3] ASoC: davinci-mcasp/edma: Switch AM335x/43xx to edma-pcm Daniel Mack
@ 2014-07-16 21:09 ` Mark Brown
  4 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2014-07-16 21:09 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: alsa-devel, Liam Girdwood, jsarha, zonque


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

On Wed, Jul 16, 2014 at 03:12:01PM +0300, Peter Ujfalusi wrote:
> Hi,
> 
> This series will switch the AM335x/AM43xx SoCs to use the edma-pcm as platform
> driver instead of the old davinic-pcm.

Applied all, thanks.

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

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



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

end of thread, other threads:[~2014-07-16 21:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-16 12:12 [PATCH 0/3] ASoC: davinci-mcasp/edma: Switch AM335x/43xx to edma-pcm Peter Ujfalusi
2014-07-16 12:12 ` [PATCH 1/3] ASoC: edma-pcm: Remove PCM_INFO_BATCH and add PCM_INFO_NO_PERIOD_WAKEUP flag Peter Ujfalusi
2014-07-16 12:12 ` [PATCH 2/3] ASoC: edma-pcm: Add empty functions for !CONFIG_SND_EDMA_SOC builds Peter Ujfalusi
2014-07-16 12:12 ` [PATCH 3/3] ASoC: davinci-mcasp: Use dmaengine based platform driver for AM335x/447x Peter Ujfalusi
2014-07-16 14:11 ` [PATCH 0/3] ASoC: davinci-mcasp/edma: Switch AM335x/43xx to edma-pcm Daniel Mack
2014-07-16 21:09 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.