Skip to contentSkip to conversation

ASoc: samsung: update s3c24xx to dmaengine and common clk framework

PATCH Applied Vasily Khoruzhick 2 participants 6 messages Jun 23, 2014 – Jun 24, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v3 cover ASoc: samsung: update s3c24xx to dmaengine and common clk framework

This series updates s3c24{xx,12}-i2s driver to use newer DMA and CLK APIs.

v2: use hardcoded dma channel number
v3: rebase onto v3.16-rc1, add common clk framework-related changes

Vasily Khoruzhick (4):
ASoC: samsung: s3c24{xx,12}-i2s: port to use generic dmaengine API
ASoC: samsung: drop support for legacy S3C24XX DMA API
ASoC: samsung: s3c2412-i2s: Move to
clk_prepare_enable/clk_disable_unprepare
ASoC: samsung: s3c24xx-i2s: Move to
clk_prepare_enable/clk_disable_unprepare

 sound/soc/samsung/Kconfig       |  12 +-
 sound/soc/samsung/Makefile      |   2 -
 sound/soc/samsung/dma.c         | 454 ----------------------------------------
 sound/soc/samsung/dmaengine.c   |   3 +
 sound/soc/samsung/s3c-i2s-v2.c  |  17 +-
 sound/soc/samsung/s3c2412-i2s.c |  51 +++--
 sound/soc/samsung/s3c24xx-i2s.c |  62 +++---
 7 files changed, 61 insertions(+), 540 deletions(-)
 delete mode 100644 sound/soc/samsung/dma.c
Signature · 1 line
2.0.0
#1 lore raw

PATCH v3 1/4 ASoC: samsung: s3c24{xx,12}-i2s: port to use generic dmaengine API

Use dmaengine instead of legacy s3c24xx DMA API for s3c24xx and s3c2412

---
 sound/soc/samsung/Kconfig       |  9 +++----
 sound/soc/samsung/dmaengine.c   |  3 +++
 sound/soc/samsung/s3c-i2s-v2.c  | 17 +------------
 sound/soc/samsung/s3c2412-i2s.c | 47 +++++++++++++++++-----------------
 sound/soc/samsung/s3c24xx-i2s.c | 56 +++++++++++++++++++----------------------
 5 files changed, 56 insertions(+), 76 deletions(-)
sound/soc/samsung/Kconfig +3 -6
index 753b8c9..98767d3 100644
@@ -1,11 +1,10 @@
 config SND_SOC_SAMSUNG
 	tristate "ASoC support for Samsung"
 	depends on PLAT_SAMSUNG
-	select S3C2410_DMA if ARCH_S3C24XX
+	select S3C24XX_DMAC if ARCH_S3C24XX
 	select S3C64XX_PL080 if ARCH_S3C64XX
-	select SND_S3C_DMA if !ARCH_S3C24XX
-	select SND_S3C_DMA_LEGACY if ARCH_S3C24XX
-	select SND_SOC_GENERIC_DMAENGINE_PCM if !ARCH_S3C24XX
+	select SND_S3C_DMA
+	select SND_SOC_GENERIC_DMAENGINE_PCM
 	help
 	  Say Y or M if you want to add support for codecs attached to
 	  the Samsung SoCs' Audio interfaces. You will also need to
@@ -19,7 +18,6 @@ config SND_S3C_DMA_LEGACY
 
 config SND_S3C24XX_I2S
 	tristate
-	select S3C24XX_DMA
 
 config SND_S3C_I2SV2_SOC
 	tristate
@@ -27,7 +25,6 @@ config SND_S3C_I2SV2_SOC
 config SND_S3C2412_SOC_I2S
 	tristate
 	select SND_S3C_I2SV2_SOC
-	select S3C2410_DMA
 
 config SND_SAMSUNG_PCM
 	tristate
sound/soc/samsung/dmaengine.c +3 -0
index a0e4e79..506f5bf 100644
@@ -17,6 +17,7 @@
 
 #include <linux/module.h>
 #include <linux/amba/pl08x.h>
+#include <linux/platform_data/dma-s3c24xx.h>
 
 #include <sound/core.h>
 #include <sound/pcm.h>
@@ -29,6 +30,8 @@
 
 #ifdef CONFIG_ARCH_S3C64XX
 #define filter_fn pl08x_filter_id
+#elif defined(CONFIG_ARCH_S3C24XX)
+#define filter_fn s3c24xx_dma_filter
 #else
 #define filter_fn NULL
 #endif
sound/soc/samsung/s3c-i2s-v2.c +1 -16
index 0ff4bbe..de6c321 100644
@@ -392,8 +392,6 @@ static int s3c2412_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
 	int capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE);
 	unsigned long irqs;
 	int ret = 0;
-	struct s3c_dma_params *dma_data =
-		snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
 
 	pr_debug("Entered %s\n", __func__);
 
@@ -424,13 +422,6 @@ static int s3c2412_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
 
 		local_irq_restore(irqs);
 
-		/*
-		 * Load the next buffer to DMA to meet the reqirement
-		 * of the auto reload mechanism of S3C24XX.
-		 * This call won't bother S3C64XX.
-		 */
-		s3c2410_dma_ctrl(dma_data->channel, S3C2410_DMAOP_STARTED);
-
 		break;
 
 	case SNDRV_PCM_TRIGGER_STOP:
@@ -644,12 +635,6 @@ int s3c_i2sv2_probe(struct snd_soc_dai *dai,
 	/* record our i2s structure for later use in the callbacks */
 	snd_soc_dai_set_drvdata(dai, i2s);
 
-	i2s->regs = ioremap(base, 0x100);
-	if (i2s->regs == NULL) {
-		dev_err(dev, "cannot ioremap registers\n");
-		return -ENXIO;
-	}
-
 	i2s->iis_pclk = clk_get(dev, "iis");
 	if (IS_ERR(i2s->iis_pclk)) {
 		dev_err(dev, "failed to get iis_clock\n");
@@ -729,7 +714,7 @@ int s3c_i2sv2_register_component(struct device *dev, int id,
 			   struct snd_soc_component_driver *cmp_drv,
 			   struct snd_soc_dai_driver *dai_drv)
 {
-	struct snd_soc_dai_ops *ops = dai_drv->ops;
+	struct snd_soc_dai_ops *ops = (struct snd_soc_dai_ops *)dai_drv->ops;
 
 	ops->trigger = s3c2412_i2s_trigger;
 	if (!ops->hw_params)
sound/soc/samsung/s3c2412-i2s.c +23 -24

96 lines not on this page · raw message

sound/soc/samsung/s3c24xx-i2s.c +26 -30

115 lines not on this page · raw message

Signature · 1 line
2.0.0
#2 lore raw

PATCH v3 2/4 ASoC: samsung: drop support for legacy S3C24XX DMA API

In reply to Vasily Khoruzhick
---
 sound/soc/samsung/Kconfig  |   3 -
 sound/soc/samsung/Makefile |   2 -
 sound/soc/samsung/dma.c    | 454 ---------------------------------------------
 3 files changed, 459 deletions(-)
sound/soc/samsung/Kconfig +0 -3
index 98767d3..17547a4 100644
@@ -13,9 +13,6 @@ config SND_SOC_SAMSUNG
 config SND_S3C_DMA
 	tristate
 
-config SND_S3C_DMA_LEGACY
-	tristate
-
 config SND_S3C24XX_I2S
 	tristate
 
sound/soc/samsung/Makefile +0 -2
index 6d0212b..6469199 100644
@@ -1,6 +1,5 @@
 # S3c24XX Platform Support
 snd-soc-s3c-dma-objs := dmaengine.o
-snd-soc-s3c-dma-legacy-objs := dma.o
 snd-soc-idma-objs := idma.o
 snd-soc-s3c24xx-i2s-objs := s3c24xx-i2s.o
 snd-soc-s3c2412-i2s-objs := s3c2412-i2s.o
@@ -11,7 +10,6 @@ snd-soc-pcm-objs := pcm.o
 snd-soc-i2s-objs := i2s.o
 
 obj-$(CONFIG_SND_S3C_DMA) += snd-soc-s3c-dma.o
-obj-$(CONFIG_SND_S3C_DMA_LEGACY) += snd-soc-s3c-dma-legacy.o
 obj-$(CONFIG_SND_S3C24XX_I2S) += snd-soc-s3c24xx-i2s.o
 obj-$(CONFIG_SND_SAMSUNG_AC97) += snd-soc-ac97.o
 obj-$(CONFIG_SND_S3C2412_SOC_I2S) += snd-soc-s3c2412-i2s.o
sound/soc/samsung/dma.c deleted +0 -454

454 lines not on this page · raw message

Signature · 1 line
2.0.0
#3 lore raw

PATCH v3 3/4 ASoC: samsung: s3c2412-i2s: Move to clk_prepare_enable/clk_disable_unprepare

In reply to Vasily Khoruzhick

Use clk_prepare_enable/clk_disable_unprepare to make the driver work properly with common clock framework.

---
 sound/soc/samsung/s3c2412-i2s.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/samsung/s3c2412-i2s.c +2 -2
index d9d27cc..d6bc6dc 100644
@@ -76,7 +76,7 @@ static int s3c2412_i2s_probe(struct snd_soc_dai *dai)
 	/* Set MPLL as the source for IIS CLK */
 
 	clk_set_parent(s3c2412_i2s.iis_cclk, clk_get(NULL, "mpll"));
-	clk_enable(s3c2412_i2s.iis_cclk);
+	clk_prepare_enable(s3c2412_i2s.iis_cclk);
 
 	s3c2412_i2s.iis_cclk = s3c2412_i2s.iis_pclk;
 
@@ -89,7 +89,7 @@ static int s3c2412_i2s_probe(struct snd_soc_dai *dai)
 
 static int s3c2412_i2s_remove(struct snd_soc_dai *dai)
 {
-	clk_disable(s3c2412_i2s.iis_cclk);
+	clk_disable_unprepare(s3c2412_i2s.iis_cclk);
 
 	return 0;
 }
Signature · 1 line
2.0.0
#4 lore raw

PATCH v3 4/4 ASoC: samsung: s3c24xx-i2s: Move to clk_prepare_enable/clk_disable_unprepare

In reply to Vasily Khoruzhick

Use clk_prepare_enable/clk_disable_unprepare to make the driver work properly with common clock framework.

---
 sound/soc/samsung/s3c24xx-i2s.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/samsung/s3c24xx-i2s.c +3 -3
index 6f3ee87..e8b9852 100644
@@ -373,7 +373,7 @@ static int s3c24xx_i2s_probe(struct snd_soc_dai *dai)
 		pr_err("failed to get iis_clock\n");
 		return PTR_ERR(s3c24xx_i2s.iis_clk);
 	}
-	clk_enable(s3c24xx_i2s.iis_clk);
+	clk_prepare_enable(s3c24xx_i2s.iis_clk);
 
 	/* Configure the I2S pins (GPE0...GPE4) in correct mode */
 	s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2),
@@ -397,7 +397,7 @@ static int s3c24xx_i2s_suspend(struct snd_soc_dai *cpu_dai)
 	s3c24xx_i2s.iisfcon = readl(s3c24xx_i2s.regs + S3C2410_IISFCON);
 	s3c24xx_i2s.iispsr = readl(s3c24xx_i2s.regs + S3C2410_IISPSR);
 
-	clk_disable(s3c24xx_i2s.iis_clk);
+	clk_disable_unprepare(s3c24xx_i2s.iis_clk);
 
 	return 0;
 }
@@ -405,7 +405,7 @@ static int s3c24xx_i2s_suspend(struct snd_soc_dai *cpu_dai)
 static int s3c24xx_i2s_resume(struct snd_soc_dai *cpu_dai)
 {
 	pr_debug("Entered %s\n", __func__);
-	clk_enable(s3c24xx_i2s.iis_clk);
+	clk_prepare_enable(s3c24xx_i2s.iis_clk);
 
 	writel(s3c24xx_i2s.iiscon, s3c24xx_i2s.regs + S3C2410_IISCON);
 	writel(s3c24xx_i2s.iismod, s3c24xx_i2s.regs + S3C2410_IISMOD);
Signature · 1 line
2.0.0