linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm
@ 2018-04-25  6:18 Peter Ujfalusi
  2018-04-25  6:18 ` [PATCH 1/7] ASoC: omap: Introduce the generic_dmaengine_pcm based sdma-pcm Peter Ujfalusi
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Peter Ujfalusi @ 2018-04-25  6:18 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, jarkko.nikula
  Cc: alsa-devel, linux-omap, aaro.koskinen

Hi,

omap-pcm served us well over the years, but there is no reason to keep it around
as we can rely on generic dmaengine_pcm code without the need to maintain custom
code.

The series has been tested on:
omap3 beagle-xm, omap4 PandaES, omap4 Blaze (SDP), am57xx beagle-x15, dra7 evm.

McBSP, McASP, McPDM, DMIC and HDMI audio was tested and I have found no issue
with them.

I was not able to test on OMAP1 or OMAP2 for various reasons, but mainly because
neither Nokia 770 or Nokia n810 audio probes with linux-next. It does not matter
if I have omap-pcm or sdma-pcm...

I would be grateful if someone can give tested-by or pointers on how to get
770/n810 audio working.

Regards,
Peter
---
Peter Ujfalusi (7):
  ASoC: omap: Introduce the generic_dmaengine_pcm based sdma-pcm
  ASoC: davinci-mcasp: Convert to use the sdma-pcm instead of omap-pcm
  ASoC: omap-hdmi-audio: Convert to use the sdma-pcm instead of omap-pcm
  ASoC: omap-dmic: Convert to use the sdma-pcm instead of omap-pcm
  ASoC: omap-mcpdm: Convert to use the sdma-pcm instead of omap-pcm
  ASoC: omap-mcbsp: Convert to use the sdma-pcm instead of omap-pcm
  ASoC: omap: Mark the omap-pcm as deprecated, but keep it in the tree

 sound/soc/davinci/Kconfig         |  2 +-
 sound/soc/davinci/davinci-mcasp.c |  8 ++--
 sound/soc/omap/Kconfig            | 33 ++++++++-------
 sound/soc/omap/Makefile           |  4 +-
 sound/soc/omap/omap-dmic.c        |  4 +-
 sound/soc/omap/omap-hdmi-audio.c  |  5 ++-
 sound/soc/omap/omap-mcbsp.c       |  4 +-
 sound/soc/omap/omap-mcpdm.c       |  4 +-
 sound/soc/omap/sdma-pcm.c         | 68 +++++++++++++++++++++++++++++++
 sound/soc/omap/sdma-pcm.h         | 21 ++++++++++
 10 files changed, 124 insertions(+), 29 deletions(-)
 create mode 100644 sound/soc/omap/sdma-pcm.c
 create mode 100644 sound/soc/omap/sdma-pcm.h

-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH 1/7] ASoC: omap: Introduce the generic_dmaengine_pcm based sdma-pcm
  2018-04-25  6:18 [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm Peter Ujfalusi
@ 2018-04-25  6:18 ` Peter Ujfalusi
  2018-04-25  6:18 ` [PATCH 2/7] ASoC: davinci-mcasp: Convert to use the sdma-pcm instead of omap-pcm Peter Ujfalusi
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 18+ messages in thread
From: Peter Ujfalusi @ 2018-04-25  6:18 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, jarkko.nikula
  Cc: alsa-devel, linux-omap, aaro.koskinen

With the generic dmaengine_pcm support the omap-cpm can be replaced with a
much smaller wrapper.

CPU DAI drivers can use the:
int sdma_pcm_platform_register(struct device *dev,
			       char *txdmachan, char *rxdmachan);

To register the platform driver, txdmachan/rxdmachan is only needed to be
provided if the DMA channel names are not standard tx/rx, like in case of
McPDM, or the DAI is only capable of one audio direction (DMIC, HDMI).

This patch only introduces the source file and changes to the
Kconfig/Makefile, but does not change any of the DAI drivers to use it.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/Kconfig    |  6 ++++
 sound/soc/omap/Makefile   |  2 ++
 sound/soc/omap/sdma-pcm.c | 68 +++++++++++++++++++++++++++++++++++++++
 sound/soc/omap/sdma-pcm.h | 21 ++++++++++++
 4 files changed, 97 insertions(+)
 create mode 100644 sound/soc/omap/sdma-pcm.c
 create mode 100644 sound/soc/omap/sdma-pcm.h

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index ba56d71c3ca7..656031401d58 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -2,6 +2,12 @@ config SND_OMAP_SOC
 	tristate "SoC Audio for Texas Instruments OMAP chips"
 	depends on (ARCH_OMAP && DMA_OMAP) || (ARM && COMPILE_TEST)
 	select SND_DMAENGINE_PCM
+	select SND_SDMA_SOC
+
+config SND_SDMA_SOC
+	tristate "SoC Audio for Texas Instruments chips using sDMA"
+	depends on DMA_OMAP
+	select SND_SOC_GENERIC_DMAENGINE_PCM
 
 config SND_OMAP_SOC_DMIC
 	tristate "TI Digital Microphone Module (DMIC) support"
diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
index a6785dc4fc90..0619a5b3bd9f 100644
--- a/sound/soc/omap/Makefile
+++ b/sound/soc/omap/Makefile
@@ -1,12 +1,14 @@
 # SPDX-License-Identifier: GPL-2.0
 # OMAP Platform Support
 snd-soc-omap-objs := omap-pcm.o
+snd-soc-sdma-objs := sdma-pcm.o
 snd-soc-omap-dmic-objs := omap-dmic.o
 snd-soc-omap-mcbsp-objs := omap-mcbsp.o mcbsp.o
 snd-soc-omap-mcpdm-objs := omap-mcpdm.o
 snd-soc-omap-hdmi-audio-objs := omap-hdmi-audio.o
 
 obj-$(CONFIG_SND_OMAP_SOC) += snd-soc-omap.o
+obj-$(CONFIG_SND_SDMA_SOC) += snd-soc-sdma.o
 obj-$(CONFIG_SND_OMAP_SOC_DMIC) += snd-soc-omap-dmic.o
 obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o
 obj-$(CONFIG_SND_OMAP_SOC_MCPDM) += snd-soc-omap-mcpdm.o
diff --git a/sound/soc/omap/sdma-pcm.c b/sound/soc/omap/sdma-pcm.c
new file mode 100644
index 000000000000..f7b2b5b69d27
--- /dev/null
+++ b/sound/soc/omap/sdma-pcm.c
@@ -0,0 +1,68 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ *  Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com
+ *  Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
+ */
+
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/dmaengine_pcm.h>
+#include <linux/omap-dma.h>
+
+#include "sdma-pcm.h"
+
+static const struct snd_pcm_hardware sdma_pcm_hardware = {
+	.info			= SNDRV_PCM_INFO_MMAP |
+				  SNDRV_PCM_INFO_MMAP_VALID |
+				  SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME |
+				  SNDRV_PCM_INFO_NO_PERIOD_WAKEUP |
+				  SNDRV_PCM_INFO_INTERLEAVED,
+	.period_bytes_min	= 32,
+	.period_bytes_max	= 64 * 1024,
+	.buffer_bytes_max	= 128 * 1024,
+	.periods_min		= 2,
+	.periods_max		= 255,
+};
+
+static const struct snd_dmaengine_pcm_config sdma_dmaengine_pcm_config = {
+	.pcm_hardware = &sdma_pcm_hardware,
+	.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
+	.compat_filter_fn = omap_dma_filter_fn,
+	.prealloc_buffer_size = 128 * 1024,
+};
+
+int sdma_pcm_platform_register(struct device *dev,
+			       char *txdmachan, char *rxdmachan)
+{
+	struct snd_dmaengine_pcm_config *config;
+	unsigned int flags = SND_DMAENGINE_PCM_FLAG_COMPAT;
+
+	/* Standard names for the directions: 'tx' and 'rx' */
+	if (!txdmachan && !rxdmachan)
+		return devm_snd_dmaengine_pcm_register(dev,
+						&sdma_dmaengine_pcm_config,
+						flags);
+
+	config = devm_kzalloc(dev, sizeof(*config), GFP_KERNEL);
+	if (!config)
+		return -ENOMEM;
+
+	*config = sdma_dmaengine_pcm_config;
+
+	if (!txdmachan || !rxdmachan) {
+		/* One direction only PCM */
+		flags |= SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX;
+		if (!txdmachan) {
+			txdmachan = rxdmachan;
+			rxdmachan = NULL;
+		}
+	}
+
+	config->chan_names[0] = txdmachan;
+	config->chan_names[1] = rxdmachan;
+
+	return devm_snd_dmaengine_pcm_register(dev, config, flags);
+}
+EXPORT_SYMBOL_GPL(sdma_pcm_platform_register);
diff --git a/sound/soc/omap/sdma-pcm.h b/sound/soc/omap/sdma-pcm.h
new file mode 100644
index 000000000000..ce13edfc52d8
--- /dev/null
+++ b/sound/soc/omap/sdma-pcm.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ *  Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com
+ *  Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
+ */
+
+#ifndef __SDMA_PCM_H__
+#define __SDMA_PCM_H__
+
+#if IS_ENABLED(CONFIG_SND_SDMA_SOC)
+int sdma_pcm_platform_register(struct device *dev,
+			       char *txdmachan, char *rxdmachan);
+#else
+static inline int sdma_pcm_platform_register(struct device *dev,
+					     char *txdmachan, char *rxdmachan)
+{
+	return 0;
+}
+#endif /* CONFIG_SND_SDMA_SOC */
+
+#endif /* __SDMA_PCM_H__ */
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH 2/7] ASoC: davinci-mcasp: Convert to use the sdma-pcm instead of omap-pcm
  2018-04-25  6:18 [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm Peter Ujfalusi
  2018-04-25  6:18 ` [PATCH 1/7] ASoC: omap: Introduce the generic_dmaengine_pcm based sdma-pcm Peter Ujfalusi
@ 2018-04-25  6:18 ` Peter Ujfalusi
  2018-04-25  6:18 ` [PATCH 3/7] ASoC: omap-hdmi-audio: " Peter Ujfalusi
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 18+ messages in thread
From: Peter Ujfalusi @ 2018-04-25  6:18 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, jarkko.nikula
  Cc: alsa-devel, linux-omap, aaro.koskinen

Use the new platform driver in case of sDMA.

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

diff --git a/sound/soc/davinci/Kconfig b/sound/soc/davinci/Kconfig
index 21bf301ba87a..792b75a25951 100644
--- a/sound/soc/davinci/Kconfig
+++ b/sound/soc/davinci/Kconfig
@@ -24,7 +24,7 @@ config SND_DAVINCI_SOC_I2S
 
 config SND_DAVINCI_SOC_MCASP
 	tristate "TI Multichannel Audio Serial Port (McASP) support"
-	depends on SND_OMAP_SOC || SND_EDMA_SOC
+	depends on SND_SDMA_SOC || SND_EDMA_SOC
 	help
 	  Say Y or M here if you want to have support for McASP IP found in
 	  various Texas Instruments SoCs like:
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index ba4da45902b8..90edd5a6880c 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -36,10 +36,10 @@
 #include <sound/initval.h>
 #include <sound/soc.h>
 #include <sound/dmaengine_pcm.h>
-#include <sound/omap-pcm.h>
 #include <dt-bindings/sound/ti-mcasp.h>
 
 #include "edma-pcm.h"
+#include "../omap/sdma-pcm.h"
 #include "davinci-mcasp.h"
 
 #define MCASP_MAX_AFIFO_DEPTH	64
@@ -2069,10 +2069,10 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 #endif
 		break;
 	case PCM_SDMA:
-#if IS_BUILTIN(CONFIG_SND_OMAP_SOC) || \
+#if IS_BUILTIN(CONFIG_SND_SDMA_SOC) || \
 	(IS_MODULE(CONFIG_SND_DAVINCI_SOC_MCASP) && \
-	 IS_MODULE(CONFIG_SND_OMAP_SOC))
-		ret = omap_pcm_platform_register(&pdev->dev);
+	 IS_MODULE(CONFIG_SND_SDMA_SOC))
+		ret = sdma_pcm_platform_register(&pdev->dev, NULL, NULL);
 #else
 		dev_err(&pdev->dev, "Missing SND_SDMA_SOC\n");
 		ret = -EINVAL;
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH 3/7] ASoC: omap-hdmi-audio: Convert to use the sdma-pcm instead of omap-pcm
  2018-04-25  6:18 [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm Peter Ujfalusi
  2018-04-25  6:18 ` [PATCH 1/7] ASoC: omap: Introduce the generic_dmaengine_pcm based sdma-pcm Peter Ujfalusi
  2018-04-25  6:18 ` [PATCH 2/7] ASoC: davinci-mcasp: Convert to use the sdma-pcm instead of omap-pcm Peter Ujfalusi
@ 2018-04-25  6:18 ` Peter Ujfalusi
  2018-05-09  9:31   ` Applied "ASoC: omap-hdmi-audio: Convert to use the sdma-pcm instead of omap-pcm" to the asoc tree Mark Brown
  2018-05-09  9:47   ` Mark Brown
  2018-04-25  6:18 ` [PATCH 4/7] ASoC: omap-dmic: Convert to use the sdma-pcm instead of omap-pcm Peter Ujfalusi
                   ` (4 subsequent siblings)
  7 siblings, 2 replies; 18+ messages in thread
From: Peter Ujfalusi @ 2018-04-25  6:18 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, jarkko.nikula
  Cc: alsa-devel, linux-omap, aaro.koskinen

Use the new platform driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/Kconfig           | 2 +-
 sound/soc/omap/omap-hdmi-audio.c | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 656031401d58..879a25299099 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -32,7 +32,7 @@ config SND_OMAP_SOC_MCPDM
 
 config SND_OMAP_SOC_HDMI_AUDIO
 	tristate "HDMI audio support for OMAP4+ based SoCs"
-	depends on SND_OMAP_SOC
+	depends on SND_SDMA_SOC
 	help
 	  For HDMI audio to work OMAPDSS HDMI support should be
 	  enabled.
diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-audio.c
index 8eeac7cab1c1..8a99a8837dc9 100644
--- a/sound/soc/omap/omap-hdmi-audio.c
+++ b/sound/soc/omap/omap-hdmi-audio.c
@@ -26,9 +26,10 @@
 #include <sound/dmaengine_pcm.h>
 #include <uapi/sound/asound.h>
 #include <sound/asoundef.h>
-#include <sound/omap-pcm.h>
 #include <sound/omap-hdmi-audio.h>
 
+#include "sdma-pcm.h"
+
 #define DRV_NAME "omap-hdmi-audio"
 
 struct hdmi_audio_data {
@@ -352,7 +353,7 @@ static int omap_hdmi_audio_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ret = omap_pcm_platform_register(ad->dssdev);
+	ret = sdma_pcm_platform_register(ad->dssdev, "audio_tx", NULL);
 	if (ret)
 		return ret;
 
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH 4/7] ASoC: omap-dmic: Convert to use the sdma-pcm instead of omap-pcm
  2018-04-25  6:18 [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm Peter Ujfalusi
                   ` (2 preceding siblings ...)
  2018-04-25  6:18 ` [PATCH 3/7] ASoC: omap-hdmi-audio: " Peter Ujfalusi
@ 2018-04-25  6:18 ` Peter Ujfalusi
  2018-04-25  6:18 ` [PATCH 5/7] ASoC: omap-mcpdm: " Peter Ujfalusi
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 18+ messages in thread
From: Peter Ujfalusi @ 2018-04-25  6:18 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, jarkko.nikula
  Cc: alsa-devel, linux-omap, aaro.koskinen

Use the new platform driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/Kconfig     | 4 ++--
 sound/soc/omap/omap-dmic.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 879a25299099..13a2849ede82 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -11,7 +11,7 @@ config SND_SDMA_SOC
 
 config SND_OMAP_SOC_DMIC
 	tristate "TI Digital Microphone Module (DMIC) support"
-	depends on SND_OMAP_SOC && (ARCH_OMAP4 || SOC_OMAP5)
+	depends on SND_SDMA_SOC && (ARCH_OMAP4 || SOC_OMAP5)
 	help
 	  Say Y or M here if you want to have support for DMIC IP found in
 	  OMAP4 and OMAP5.
@@ -118,7 +118,7 @@ config SND_OMAP_SOC_OMAP_TWL4030
 
 config SND_OMAP_SOC_OMAP_ABE_TWL6040
 	tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec"
-	depends on TWL6040_CORE && SND_OMAP_SOC && COMMON_CLK
+	depends on TWL6040_CORE && SND_OMAP_SOC && SND_SDMA_SOC && COMMON_CLK
 	depends on ARCH_OMAP4 || (SOC_OMAP5 && MFD_PALMAS) || COMPILE_TEST
 	select SND_OMAP_SOC_DMIC
 	select SND_OMAP_SOC_MCPDM
diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c
index b2f5d2fa354d..51dd7c65096b 100644
--- a/sound/soc/omap/omap-dmic.c
+++ b/sound/soc/omap/omap-dmic.c
@@ -40,9 +40,9 @@
 #include <sound/initval.h>
 #include <sound/soc.h>
 #include <sound/dmaengine_pcm.h>
-#include <sound/omap-pcm.h>
 
 #include "omap-dmic.h"
+#include "sdma-pcm.h"
 
 struct omap_dmic {
 	struct device *dev;
@@ -501,7 +501,7 @@ static int asoc_dmic_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ret = omap_pcm_platform_register(&pdev->dev);
+	ret = sdma_pcm_platform_register(&pdev->dev, NULL, "up_link");
 	if (ret)
 		return ret;
 
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH 5/7] ASoC: omap-mcpdm: Convert to use the sdma-pcm instead of omap-pcm
  2018-04-25  6:18 [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm Peter Ujfalusi
                   ` (3 preceding siblings ...)
  2018-04-25  6:18 ` [PATCH 4/7] ASoC: omap-dmic: Convert to use the sdma-pcm instead of omap-pcm Peter Ujfalusi
@ 2018-04-25  6:18 ` Peter Ujfalusi
  2018-04-25  6:18 ` [PATCH 6/7] ASoC: omap-mcbsp: " Peter Ujfalusi
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 18+ messages in thread
From: Peter Ujfalusi @ 2018-04-25  6:18 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, jarkko.nikula
  Cc: alsa-devel, linux-omap, aaro.koskinen

Use the new platform driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/Kconfig      | 4 ++--
 sound/soc/omap/omap-mcpdm.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 13a2849ede82..7c52f814491a 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -25,7 +25,7 @@ config SND_OMAP_SOC_MCBSP
 
 config SND_OMAP_SOC_MCPDM
 	tristate "TI Multichannel PDM Controller (McPDM) support"
-	depends on SND_OMAP_SOC && (ARCH_OMAP4 || SOC_OMAP5)
+	depends on SND_SDMA_SOC && (ARCH_OMAP4 || SOC_OMAP5)
 	help
 	  Say Y or M here if you want to have support for McPDM IP found in
 	  OMAP4 and OMAP5.
@@ -118,7 +118,7 @@ config SND_OMAP_SOC_OMAP_TWL4030
 
 config SND_OMAP_SOC_OMAP_ABE_TWL6040
 	tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec"
-	depends on TWL6040_CORE && SND_OMAP_SOC && SND_SDMA_SOC && COMMON_CLK
+	depends on TWL6040_CORE && SND_SDMA_SOC && COMMON_CLK
 	depends on ARCH_OMAP4 || (SOC_OMAP5 && MFD_PALMAS) || COMPILE_TEST
 	select SND_OMAP_SOC_DMIC
 	select SND_OMAP_SOC_MCPDM
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index 04f4f3cb0f46..3f3e7c4ee175 100644
--- a/sound/soc/omap/omap-mcpdm.c
+++ b/sound/soc/omap/omap-mcpdm.c
@@ -41,9 +41,9 @@
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
 #include <sound/dmaengine_pcm.h>
-#include <sound/omap-pcm.h>
 
 #include "omap-mcpdm.h"
+#include "sdma-pcm.h"
 
 struct mcpdm_link_config {
 	u32 link_mask; /* channel mask for the direction */
@@ -565,7 +565,7 @@ static int asoc_mcpdm_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	return omap_pcm_platform_register(&pdev->dev);
+	return sdma_pcm_platform_register(&pdev->dev, "dn_link", "up_link");
 }
 
 static const struct of_device_id omap_mcpdm_of_match[] = {
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH 6/7] ASoC: omap-mcbsp: Convert to use the sdma-pcm instead of omap-pcm
  2018-04-25  6:18 [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm Peter Ujfalusi
                   ` (4 preceding siblings ...)
  2018-04-25  6:18 ` [PATCH 5/7] ASoC: omap-mcpdm: " Peter Ujfalusi
@ 2018-04-25  6:18 ` Peter Ujfalusi
  2018-04-25  6:18 ` [PATCH 7/7] ASoC: omap: Mark the omap-pcm as deprecated, but keep it in the tree Peter Ujfalusi
  2018-04-25 10:10 ` [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm Jarkko Nikula
  7 siblings, 0 replies; 18+ messages in thread
From: Peter Ujfalusi @ 2018-04-25  6:18 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, jarkko.nikula
  Cc: alsa-devel, linux-omap, aaro.koskinen

Use the new platform driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/Kconfig      | 16 ++++++++--------
 sound/soc/omap/omap-mcbsp.c |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 7c52f814491a..f3059925d498 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -18,7 +18,7 @@ config SND_OMAP_SOC_DMIC
 
 config SND_OMAP_SOC_MCBSP
 	tristate "TI Multichannel Buffered Serial Port (McBSP) support"
-	depends on SND_OMAP_SOC
+	depends on SND_SDMA_SOC
 	help
 	  Say Y or M here if you want to have support for McBSP IP found in
 	  Texas Instruments OMAP1/2/3/4/5 SoCs.
@@ -47,7 +47,7 @@ config SND_OMAP_SOC_HDMI_AUDIO
 
 config SND_OMAP_SOC_N810
 	tristate "SoC Audio support for Nokia N810"
-	depends on SND_OMAP_SOC && MACH_NOKIA_N810 && I2C
+	depends on SND_SDMA_SOC && MACH_NOKIA_N810 && I2C
 	depends on OMAP_MUX
 	select SND_OMAP_SOC_MCBSP
 	select SND_SOC_TLV320AIC3X
@@ -56,7 +56,7 @@ config SND_OMAP_SOC_N810
 
 config SND_OMAP_SOC_RX51
 	tristate "SoC Audio support for Nokia N900 (RX-51)"
-	depends on SND_OMAP_SOC && ARM && I2C
+	depends on SND_SDMA_SOC && ARM && I2C
 	select SND_OMAP_SOC_MCBSP
 	select SND_SOC_TLV320AIC3X
 	select SND_SOC_TPA6130A2
@@ -67,7 +67,7 @@ config SND_OMAP_SOC_RX51
 
 config SND_OMAP_SOC_AMS_DELTA
 	tristate "SoC Audio support for Amstrad E3 (Delta) videophone"
-	depends on SND_OMAP_SOC && MACH_AMS_DELTA && TTY
+	depends on SND_SDMA_SOC && MACH_AMS_DELTA && TTY
 	select SND_OMAP_SOC_MCBSP
 	select SND_SOC_CX20442
 	help
@@ -86,7 +86,7 @@ config SND_OMAP_SOC_AMS_DELTA
 
 config SND_OMAP_SOC_OSK5912
 	tristate "SoC Audio support for omap osk5912"
-	depends on SND_OMAP_SOC && MACH_OMAP_OSK && I2C
+	depends on SND_SDMA_SOC && MACH_OMAP_OSK && I2C
 	select SND_OMAP_SOC_MCBSP
 	select SND_SOC_TLV320AIC23_I2C
 	help
@@ -94,7 +94,7 @@ config SND_OMAP_SOC_OSK5912
 
 config SND_OMAP_SOC_AM3517EVM
 	tristate "SoC Audio support for OMAP3517 / AM3517 EVM"
-	depends on SND_OMAP_SOC && MACH_OMAP3517EVM && I2C
+	depends on SND_SDMA_SOC && MACH_OMAP3517EVM && I2C
 	select SND_OMAP_SOC_MCBSP
 	select SND_SOC_TLV320AIC23_I2C
 	help
@@ -103,7 +103,7 @@ config SND_OMAP_SOC_AM3517EVM
 
 config SND_OMAP_SOC_OMAP_TWL4030
 	tristate "SoC Audio support for TI SoC based boards with twl4030 codec"
-	depends on TWL4030_CORE && SND_OMAP_SOC
+	depends on TWL4030_CORE && SND_SDMA_SOC
 	select SND_OMAP_SOC_MCBSP
 	select SND_SOC_TWL4030
 	help
@@ -136,7 +136,7 @@ config SND_OMAP_SOC_OMAP_ABE_TWL6040
 
 config SND_OMAP_SOC_OMAP3_PANDORA
 	tristate "SoC Audio support for OMAP3 Pandora"
-	depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_PANDORA
+	depends on TWL4030_CORE && SND_SDMA_SOC && MACH_OMAP3_PANDORA
 	select SND_OMAP_SOC_MCBSP
 	select SND_SOC_TWL4030
 	help
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index 6b40bdbef336..d0ebb6b9bfac 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -34,11 +34,11 @@
 #include <sound/initval.h>
 #include <sound/soc.h>
 #include <sound/dmaengine_pcm.h>
-#include <sound/omap-pcm.h>
 
 #include <linux/platform_data/asoc-ti-mcbsp.h>
 #include "mcbsp.h"
 #include "omap-mcbsp.h"
+#include "sdma-pcm.h"
 
 #define OMAP_MCBSP_RATES	(SNDRV_PCM_RATE_8000_96000)
 
@@ -868,7 +868,7 @@ static int asoc_mcbsp_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	return omap_pcm_platform_register(&pdev->dev);
+	return sdma_pcm_platform_register(&pdev->dev, NULL, NULL);
 }
 
 static int asoc_mcbsp_remove(struct platform_device *pdev)
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH 7/7] ASoC: omap: Mark the omap-pcm as deprecated, but keep it in the tree
  2018-04-25  6:18 [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm Peter Ujfalusi
                   ` (5 preceding siblings ...)
  2018-04-25  6:18 ` [PATCH 6/7] ASoC: omap-mcbsp: " Peter Ujfalusi
@ 2018-04-25  6:18 ` Peter Ujfalusi
  2018-04-25 10:10 ` [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm Jarkko Nikula
  7 siblings, 0 replies; 18+ messages in thread
From: Peter Ujfalusi @ 2018-04-25  6:18 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, jarkko.nikula
  Cc: alsa-devel, linux-omap, aaro.koskinen

All DAI drivers are now using the new sdma-pcm platform driver. Do not
build the omap-pcm, but keep the sources for one kernel cycle for easier
comparison of omap-pcm and sdma-pcm if there is an interest to do that.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/Kconfig  | 3 +--
 sound/soc/omap/Makefile | 2 --
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index f3059925d498..da81f730697c 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -1,7 +1,6 @@
 config SND_OMAP_SOC
-	tristate "SoC Audio for Texas Instruments OMAP chips"
+	tristate "SoC Audio for Texas Instruments OMAP chips (deprecated)"
 	depends on (ARCH_OMAP && DMA_OMAP) || (ARM && COMPILE_TEST)
-	select SND_DMAENGINE_PCM
 	select SND_SDMA_SOC
 
 config SND_SDMA_SOC
diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
index 0619a5b3bd9f..53eba3413485 100644
--- a/sound/soc/omap/Makefile
+++ b/sound/soc/omap/Makefile
@@ -1,13 +1,11 @@
 # SPDX-License-Identifier: GPL-2.0
 # OMAP Platform Support
-snd-soc-omap-objs := omap-pcm.o
 snd-soc-sdma-objs := sdma-pcm.o
 snd-soc-omap-dmic-objs := omap-dmic.o
 snd-soc-omap-mcbsp-objs := omap-mcbsp.o mcbsp.o
 snd-soc-omap-mcpdm-objs := omap-mcpdm.o
 snd-soc-omap-hdmi-audio-objs := omap-hdmi-audio.o
 
-obj-$(CONFIG_SND_OMAP_SOC) += snd-soc-omap.o
 obj-$(CONFIG_SND_SDMA_SOC) += snd-soc-sdma.o
 obj-$(CONFIG_SND_OMAP_SOC_DMIC) += snd-soc-omap-dmic.o
 obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* Re: [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm
  2018-04-25  6:18 [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm Peter Ujfalusi
                   ` (6 preceding siblings ...)
  2018-04-25  6:18 ` [PATCH 7/7] ASoC: omap: Mark the omap-pcm as deprecated, but keep it in the tree Peter Ujfalusi
@ 2018-04-25 10:10 ` Jarkko Nikula
  2018-04-25 13:50   ` Tony Lindgren
  7 siblings, 1 reply; 18+ messages in thread
From: Jarkko Nikula @ 2018-04-25 10:10 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: aaro.koskinen, alsa-devel, Mark Brown, Liam Girdwood, linux-omap

On Wed, Apr 25, 2018 at 09:18:30AM +0300, Peter Ujfalusi wrote:
> Hi,
> 
> omap-pcm served us well over the years, but there is no reason to keep it around
> as we can rely on generic dmaengine_pcm code without the need to maintain custom
> code.
> 
> The series has been tested on:
> omap3 beagle-xm, omap4 PandaES, omap4 Blaze (SDP), am57xx beagle-x15, dra7 evm.

For sound/soc/omap/

Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>

> I was not able to test on OMAP1 or OMAP2 for various reasons, but mainly because
> neither Nokia 770 or Nokia n810 audio probes with linux-next. It does not matter
> if I have omap-pcm or sdma-pcm...
> 
> I would be grateful if someone can give tested-by or pointers on how to get
> 770/n810 audio working.
> 
What I noticed some time ago on N810 but not time to fix it that OMAP mux
change dropped muxing audio McBSP pins. Those pins are muxed by reset or
bootloader to another function.

Probably a few lines to arch/arm/boot/dts/omap2420-n810.dts etc.

-- 
Jarkko

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

* Re: [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm
  2018-04-25 10:10 ` [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm Jarkko Nikula
@ 2018-04-25 13:50   ` Tony Lindgren
  2018-04-25 16:03     ` Peter Ujfalusi
  2018-04-25 16:31     ` Jarkko Nikula
  0 siblings, 2 replies; 18+ messages in thread
From: Tony Lindgren @ 2018-04-25 13:50 UTC (permalink / raw)
  To: Jarkko Nikula
  Cc: alsa-devel, aaro.koskinen, Liam Girdwood, Peter Ujfalusi,
	Mark Brown, linux-omap

* Jarkko Nikula <jarkko.nikula@bitmer.com> [180425 03:56]:
> What I noticed some time ago on N810 but not time to fix it that OMAP mux
> change dropped muxing audio McBSP pins. Those pins are muxed by reset or
> bootloader to another function.
> 
> Probably a few lines to arch/arm/boot/dts/omap2420-n810.dts etc.

Hmm do you have a link or commit id to a patch that does the muxing
to see which pins need to be muxed?

Regards,

Tony

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

* Re: [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm
  2018-04-25 13:50   ` Tony Lindgren
@ 2018-04-25 16:03     ` Peter Ujfalusi
  2018-04-25 16:56       ` Tony Lindgren
  2018-04-25 16:31     ` Jarkko Nikula
  1 sibling, 1 reply; 18+ messages in thread
From: Peter Ujfalusi @ 2018-04-25 16:03 UTC (permalink / raw)
  To: Tony Lindgren, Jarkko Nikula
  Cc: aaro.koskinen, alsa-devel, Mark Brown, Liam Girdwood, linux-omap

On 04/25/2018 04:50 PM, Tony Lindgren wrote:
> * Jarkko Nikula <jarkko.nikula@bitmer.com> [180425 03:56]:
>> What I noticed some time ago on N810 but not time to fix it that OMAP mux
>> change dropped muxing audio McBSP pins. Those pins are muxed by reset or
>> bootloader to another function.
>>
>> Probably a few lines to arch/arm/boot/dts/omap2420-n810.dts etc.
> 
> Hmm do you have a link or commit id to a patch that does the muxing
> to see which pins need to be muxed?

FWIW I have this at the moment:
https://pastebin.com/WNT9wnD5

I see that the card is there, but I'm fighting buildroot to have nfs
filesystem with aplay :o

There are few things going to be needed to get things in a shape, like
converting the sound/soc/omap/n810.c to platform driver to be probed via DT.
Proper bindings for the card,
support for mclk handling in aic3x codec driver (n810 is hackinig that in the
machine driver)

In theory audio _should_ work with the DT changes and the fixup in the n810.c...

Should...

-- 
Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm
  2018-04-25 13:50   ` Tony Lindgren
  2018-04-25 16:03     ` Peter Ujfalusi
@ 2018-04-25 16:31     ` Jarkko Nikula
  2018-04-25 16:52       ` Tony Lindgren
  1 sibling, 1 reply; 18+ messages in thread
From: Jarkko Nikula @ 2018-04-25 16:31 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: alsa-devel, aaro.koskinen, Liam Girdwood, Peter Ujfalusi,
	Mark Brown, linux-omap

On 04/25/2018 04:50 PM, Tony Lindgren wrote:
> * Jarkko Nikula <jarkko.nikula@bitmer.com> [180425 03:56]:
>> What I noticed some time ago on N810 but not time to fix it that OMAP mux
>> change dropped muxing audio McBSP pins. Those pins are muxed by reset or
>> bootloader to another function.
>>
>> Probably a few lines to arch/arm/boot/dts/omap2420-n810.dts etc.
> 
> Hmm do you have a link or commit id to a patch that does the muxing
> to see which pins need to be muxed?
> 
Could it have been as old as 5a87cde490e1 ("ARM: OMAP2+: Remove legacy
booting support for n8x0")? At least it is dropping the McBSP muxing
from board-n8x0.c.

-- 
Jarkko

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

* Re: [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm
  2018-04-25 16:31     ` Jarkko Nikula
@ 2018-04-25 16:52       ` Tony Lindgren
  0 siblings, 0 replies; 18+ messages in thread
From: Tony Lindgren @ 2018-04-25 16:52 UTC (permalink / raw)
  To: Jarkko Nikula
  Cc: alsa-devel, aaro.koskinen, Liam Girdwood, Peter Ujfalusi,
	Mark Brown, linux-omap

* Jarkko Nikula <jarkko.nikula@bitmer.com> [180425 16:33]:
> On 04/25/2018 04:50 PM, Tony Lindgren wrote:
> > * Jarkko Nikula <jarkko.nikula@bitmer.com> [180425 03:56]:
> >> What I noticed some time ago on N810 but not time to fix it that OMAP mux
> >> change dropped muxing audio McBSP pins. Those pins are muxed by reset or
> >> bootloader to another function.
> >>
> >> Probably a few lines to arch/arm/boot/dts/omap2420-n810.dts etc.
> > 
> > Hmm do you have a link or commit id to a patch that does the muxing
> > to see which pins need to be muxed?
> > 
> Could it have been as old as 5a87cde490e1 ("ARM: OMAP2+: Remove legacy
> booting support for n8x0")? At least it is dropping the McBSP muxing
> from board-n8x0.c.

Yup OK makes sense. I probably thought it's safe to do as I recall
the Nokia kernels doing all the muxing in the bootloader. But seems
I was wrong, sorry about that.

Regards,

Tony

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

* Re: [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm
  2018-04-25 16:03     ` Peter Ujfalusi
@ 2018-04-25 16:56       ` Tony Lindgren
  2018-04-25 18:18         ` Peter Ujfalusi
  0 siblings, 1 reply; 18+ messages in thread
From: Tony Lindgren @ 2018-04-25 16:56 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: alsa-devel, aaro.koskinen, Liam Girdwood, Mark Brown, linux-omap,
	Jarkko Nikula

* Peter Ujfalusi <peter.ujfalusi@ti.com> [180425 16:06]:
> On 04/25/2018 04:50 PM, Tony Lindgren wrote:
> > * Jarkko Nikula <jarkko.nikula@bitmer.com> [180425 03:56]:
> >> What I noticed some time ago on N810 but not time to fix it that OMAP mux
> >> change dropped muxing audio McBSP pins. Those pins are muxed by reset or
> >> bootloader to another function.
> >>
> >> Probably a few lines to arch/arm/boot/dts/omap2420-n810.dts etc.
> > 
> > Hmm do you have a link or commit id to a patch that does the muxing
> > to see which pins need to be muxed?
> 
> FWIW I have this at the moment:
> https://pastebin.com/WNT9wnD5
> 
> I see that the card is there, but I'm fighting buildroot to have nfs
> filesystem with aplay :o
> 
> There are few things going to be needed to get things in a shape, like
> converting the sound/soc/omap/n810.c to platform driver to be probed via DT.
> Proper bindings for the card,
> support for mclk handling in aic3x codec driver (n810 is hackinig that in the
> machine driver)
> 
> In theory audio _should_ work with the DT changes and the fixup in the n810.c...
> 
> Should...

Cool. The pinctrl fixes at least make sense to me, that could be
a separate patch maybe with Fixes: 5a87cde490e1 ("ARM: OMAP2+: Remove
legacy booting support for n8x0") as pointed out by Jarkko.

Regards,

Tony

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

* Re: [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm
  2018-04-25 16:56       ` Tony Lindgren
@ 2018-04-25 18:18         ` Peter Ujfalusi
  2018-04-26  9:46           ` Peter Ujfalusi
  0 siblings, 1 reply; 18+ messages in thread
From: Peter Ujfalusi @ 2018-04-25 18:18 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: alsa-devel, aaro.koskinen, Liam Girdwood, Mark Brown, linux-omap,
	Jarkko Nikula

On 04/25/2018 07:56 PM, Tony Lindgren wrote:
> * Peter Ujfalusi <peter.ujfalusi@ti.com> [180425 16:06]:
>> On 04/25/2018 04:50 PM, Tony Lindgren wrote:
>>> * Jarkko Nikula <jarkko.nikula@bitmer.com> [180425 03:56]:
>>>> What I noticed some time ago on N810 but not time to fix it that OMAP mux
>>>> change dropped muxing audio McBSP pins. Those pins are muxed by reset or
>>>> bootloader to another function.
>>>>
>>>> Probably a few lines to arch/arm/boot/dts/omap2420-n810.dts etc.
>>>
>>> Hmm do you have a link or commit id to a patch that does the muxing
>>> to see which pins need to be muxed?
>>
>> FWIW I have this at the moment:
>> https://pastebin.com/WNT9wnD5
>>
>> I see that the card is there, but I'm fighting buildroot to have nfs
>> filesystem with aplay :o
>>
>> There are few things going to be needed to get things in a shape, like
>> converting the sound/soc/omap/n810.c to platform driver to be probed via DT.
>> Proper bindings for the card,
>> support for mclk handling in aic3x codec driver (n810 is hackinig that in the
>> machine driver)
>>
>> In theory audio _should_ work with the DT changes and the fixup in the n810.c...
>>
>> Should...
> 
> Cool. The pinctrl fixes at least make sense to me, that could be
> a separate patch maybe with Fixes: 5a87cde490e1 ("ARM: OMAP2+: Remove
> legacy booting support for n8x0") as pointed out by Jarkko.

The two GPIO for the headphone and speaker amp might also need pinctrl entry.

The clock sys_clkout2 reparenting and rate setting is done with the
assigned-clock stuff.

As I mentioned the only thing that we will need is the mclk handling in the
codec driver.

Most likely we could have a series dealing with DT only, then rewrite the n810.c.

The only thing might cause issue is that if the aic3x driver starts to handle
the sys_clkout2 (mclk) and the n810.c also wants to grab it and control it...
That might break along the way.

> 
> Regards,
> 
> Tony
> 


-- 
Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm
  2018-04-25 18:18         ` Peter Ujfalusi
@ 2018-04-26  9:46           ` Peter Ujfalusi
  0 siblings, 0 replies; 18+ messages in thread
From: Peter Ujfalusi @ 2018-04-26  9:46 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: alsa-devel, aaro.koskinen, Liam Girdwood, Mark Brown, linux-omap,
	Jarkko Nikula



On 2018-04-25 21:18, Peter Ujfalusi wrote:
> On 04/25/2018 07:56 PM, Tony Lindgren wrote:
>> * Peter Ujfalusi <peter.ujfalusi@ti.com> [180425 16:06]:
>>> On 04/25/2018 04:50 PM, Tony Lindgren wrote:
>>>> * Jarkko Nikula <jarkko.nikula@bitmer.com> [180425 03:56]:
>>>>> What I noticed some time ago on N810 but not time to fix it that OMAP mux
>>>>> change dropped muxing audio McBSP pins. Those pins are muxed by reset or
>>>>> bootloader to another function.
>>>>>
>>>>> Probably a few lines to arch/arm/boot/dts/omap2420-n810.dts etc.
>>>>
>>>> Hmm do you have a link or commit id to a patch that does the muxing
>>>> to see which pins need to be muxed?
>>>
>>> FWIW I have this at the moment:
>>> https://pastebin.com/WNT9wnD5
>>>
>>> I see that the card is there, but I'm fighting buildroot to have nfs
>>> filesystem with aplay :o
>>>
>>> There are few things going to be needed to get things in a shape, like
>>> converting the sound/soc/omap/n810.c to platform driver to be probed via DT.
>>> Proper bindings for the card,
>>> support for mclk handling in aic3x codec driver (n810 is hackinig that in the
>>> machine driver)
>>>
>>> In theory audio _should_ work with the DT changes and the fixup in the n810.c...
>>>
>>> Should...
>>
>> Cool. The pinctrl fixes at least make sense to me, that could be
>> a separate patch maybe with Fixes: 5a87cde490e1 ("ARM: OMAP2+: Remove
>> legacy booting support for n8x0") as pointed out by Jarkko.
> 
> The two GPIO for the headphone and speaker amp might also need pinctrl entry.
> 
> The clock sys_clkout2 reparenting and rate setting is done with the
> assigned-clock stuff.
> 
> As I mentioned the only thing that we will need is the mclk handling in the
> codec driver.
> 
> Most likely we could have a series dealing with DT only, then rewrite the n810.c.
> 
> The only thing might cause issue is that if the aic3x driver starts to handle
> the sys_clkout2 (mclk) and the n810.c also wants to grab it and control it...
> That might break along the way.

The sdma-pcm is working fine on omap2 as well, audio playback and
recording is working on n810 here.

> 
>>
>> Regards,
>>
>> Tony
>>
> 
> 

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Applied "ASoC: omap-hdmi-audio: Convert to use the sdma-pcm instead of omap-pcm" to the asoc tree
  2018-04-25  6:18 ` [PATCH 3/7] ASoC: omap-hdmi-audio: " Peter Ujfalusi
@ 2018-05-09  9:31   ` Mark Brown
  2018-05-09  9:47   ` Mark Brown
  1 sibling, 0 replies; 18+ messages in thread
From: Mark Brown @ 2018-05-09  9:31 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: alsa-devel, aaro.koskinen, Liam Girdwood, Mark Brown, linux-omap,
	jarkko.nikula

The patch

   ASoC: omap-hdmi-audio: Convert to use the sdma-pcm instead of omap-pcm

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From b1a549c6be09243f20e597d8d3fa007ec412544a Mon Sep 17 00:00:00 2001
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
Date: Mon, 7 May 2018 11:49:56 +0300
Subject: [PATCH] ASoC: omap-hdmi-audio: Convert to use the sdma-pcm instead of
 omap-pcm

Use the new platform driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/omap/Kconfig           | 2 +-
 sound/soc/omap/omap-hdmi-audio.c | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 2576fc92bff7..829b5515b3c5 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -20,7 +20,7 @@ config SND_OMAP_SOC_MCPDM
 
 config SND_OMAP_SOC_HDMI_AUDIO
 	tristate "HDMI audio support for OMAP4+ based SoCs"
-	depends on SND_OMAP_SOC
+	depends on SND_SDMA_SOC
 	help
 	  For HDMI audio to work OMAPDSS HDMI support should be
 	  enabled.
diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-audio.c
index 8eeac7cab1c1..8a99a8837dc9 100644
--- a/sound/soc/omap/omap-hdmi-audio.c
+++ b/sound/soc/omap/omap-hdmi-audio.c
@@ -26,9 +26,10 @@
 #include <sound/dmaengine_pcm.h>
 #include <uapi/sound/asound.h>
 #include <sound/asoundef.h>
-#include <sound/omap-pcm.h>
 #include <sound/omap-hdmi-audio.h>
 
+#include "sdma-pcm.h"
+
 #define DRV_NAME "omap-hdmi-audio"
 
 struct hdmi_audio_data {
@@ -352,7 +353,7 @@ static int omap_hdmi_audio_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ret = omap_pcm_platform_register(ad->dssdev);
+	ret = sdma_pcm_platform_register(ad->dssdev, "audio_tx", NULL);
 	if (ret)
 		return ret;
 
-- 
2.17.0

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

* Applied "ASoC: omap-hdmi-audio: Convert to use the sdma-pcm instead of omap-pcm" to the asoc tree
  2018-04-25  6:18 ` [PATCH 3/7] ASoC: omap-hdmi-audio: " Peter Ujfalusi
  2018-05-09  9:31   ` Applied "ASoC: omap-hdmi-audio: Convert to use the sdma-pcm instead of omap-pcm" to the asoc tree Mark Brown
@ 2018-05-09  9:47   ` Mark Brown
  1 sibling, 0 replies; 18+ messages in thread
From: Mark Brown @ 2018-05-09  9:47 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: alsa-devel, aaro.koskinen, Liam Girdwood, Mark Brown, linux-omap,
	jarkko.nikula

The patch

   ASoC: omap-hdmi-audio: Convert to use the sdma-pcm instead of omap-pcm

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From b1a549c6be09243f20e597d8d3fa007ec412544a Mon Sep 17 00:00:00 2001
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
Date: Mon, 7 May 2018 11:49:56 +0300
Subject: [PATCH] ASoC: omap-hdmi-audio: Convert to use the sdma-pcm instead of
 omap-pcm

Use the new platform driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/omap/Kconfig           | 2 +-
 sound/soc/omap/omap-hdmi-audio.c | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 2576fc92bff7..829b5515b3c5 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -20,7 +20,7 @@ config SND_OMAP_SOC_MCPDM
 
 config SND_OMAP_SOC_HDMI_AUDIO
 	tristate "HDMI audio support for OMAP4+ based SoCs"
-	depends on SND_OMAP_SOC
+	depends on SND_SDMA_SOC
 	help
 	  For HDMI audio to work OMAPDSS HDMI support should be
 	  enabled.
diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-audio.c
index 8eeac7cab1c1..8a99a8837dc9 100644
--- a/sound/soc/omap/omap-hdmi-audio.c
+++ b/sound/soc/omap/omap-hdmi-audio.c
@@ -26,9 +26,10 @@
 #include <sound/dmaengine_pcm.h>
 #include <uapi/sound/asound.h>
 #include <sound/asoundef.h>
-#include <sound/omap-pcm.h>
 #include <sound/omap-hdmi-audio.h>
 
+#include "sdma-pcm.h"
+
 #define DRV_NAME "omap-hdmi-audio"
 
 struct hdmi_audio_data {
@@ -352,7 +353,7 @@ static int omap_hdmi_audio_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ret = omap_pcm_platform_register(ad->dssdev);
+	ret = sdma_pcm_platform_register(ad->dssdev, "audio_tx", NULL);
 	if (ret)
 		return ret;
 
-- 
2.17.0

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

end of thread, other threads:[~2018-05-09  9:47 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-25  6:18 [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm Peter Ujfalusi
2018-04-25  6:18 ` [PATCH 1/7] ASoC: omap: Introduce the generic_dmaengine_pcm based sdma-pcm Peter Ujfalusi
2018-04-25  6:18 ` [PATCH 2/7] ASoC: davinci-mcasp: Convert to use the sdma-pcm instead of omap-pcm Peter Ujfalusi
2018-04-25  6:18 ` [PATCH 3/7] ASoC: omap-hdmi-audio: " Peter Ujfalusi
2018-05-09  9:31   ` Applied "ASoC: omap-hdmi-audio: Convert to use the sdma-pcm instead of omap-pcm" to the asoc tree Mark Brown
2018-05-09  9:47   ` Mark Brown
2018-04-25  6:18 ` [PATCH 4/7] ASoC: omap-dmic: Convert to use the sdma-pcm instead of omap-pcm Peter Ujfalusi
2018-04-25  6:18 ` [PATCH 5/7] ASoC: omap-mcpdm: " Peter Ujfalusi
2018-04-25  6:18 ` [PATCH 6/7] ASoC: omap-mcbsp: " Peter Ujfalusi
2018-04-25  6:18 ` [PATCH 7/7] ASoC: omap: Mark the omap-pcm as deprecated, but keep it in the tree Peter Ujfalusi
2018-04-25 10:10 ` [PATCH 0/7] ASoC: omap: Deprecate omap-pcm for sdma-pcm Jarkko Nikula
2018-04-25 13:50   ` Tony Lindgren
2018-04-25 16:03     ` Peter Ujfalusi
2018-04-25 16:56       ` Tony Lindgren
2018-04-25 18:18         ` Peter Ujfalusi
2018-04-26  9:46           ` Peter Ujfalusi
2018-04-25 16:31     ` Jarkko Nikula
2018-04-25 16:52       ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).