All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/7] DMA: S3C64XX: Conversion to the new channel request API
@ 2016-11-04 16:14 ` Sylwester Nawrocki
  0 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-samsung-soc, linux-arm-kernel, dmaengine
  Cc: vinod.koul, broonie, ckeepax, ym0914, arnd, kgene, javier,
	andi.shyti, sbkim73, Sylwester Nawrocki

This patch series aims to convert the s3c64xx platform to use
the new universal DMA channel request API, i.e. this is only
meaningful for non-dt systems using s3c64xx SoCs.

I'm sending the whole series as RFC since I didn't test it
yet, I'm going to prepare smdk6410 for testing this series.
It would be great if someone else could also test it,
either SPI or sound functionality verification would be 
useful.

Then we could queue the first two patches in this series
for v4.10-rc1 and the remaining patches for subsequent
release.

The whole series can be pulled from git repository:
 git://linuxtv.org/snawrocki/samsung.git 
 branch: for-v4.10/dma/pl080-s3c64xx

Thanks.

Sylwester Nawrocki (7):
  dma: pl08x: Add support for the DMA slave map
  ARM: S3C64XX: Add DMA slave maps for PL080 devices
  spi: s3c64xx: Do not use platform_data for DMA parameters
  ASoC: samsung: i2s: Do not use platform_data for DMA parameters
  ASoC: samsung: pcm: Do not use platform_data for DMA parameters
  ARM: S3C64XX: Drop unused DMA fields from struct s3c64xx_spi_csinfo
  ARM: S3C64XX: Drop initialization of unused struct s3c_audio_pdata
    fields

 arch/arm/mach-s3c64xx/dev-audio.c         | 19 ------------------
 arch/arm/mach-s3c64xx/pl080.c             | 32 +++++++++++++++++++++++++++++++
 arch/arm/plat-samsung/devs.c              |  9 ---------
 drivers/dma/amba-pl08x.c                  |  3 +++
 drivers/spi/spi-s3c64xx.c                 | 21 ++++----------------
 include/linux/amba/pl08x.h                |  4 ++++
 include/linux/platform_data/asoc-s3c.h    |  5 -----
 include/linux/platform_data/spi-s3c64xx.h |  3 ---
 sound/soc/samsung/i2s.c                   | 14 ++------------
 sound/soc/samsung/pcm.c                   | 14 +++++---------
 10 files changed, 50 insertions(+), 74 deletions(-)

-- 
1.9.1

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

* [PATCH RFC 0/7] DMA: S3C64XX: Conversion to the new channel request API
@ 2016-11-04 16:14 ` Sylwester Nawrocki
  0 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series aims to convert the s3c64xx platform to use
the new universal DMA channel request API, i.e. this is only
meaningful for non-dt systems using s3c64xx SoCs.

I'm sending the whole series as RFC since I didn't test it
yet, I'm going to prepare smdk6410 for testing this series.
It would be great if someone else could also test it,
either SPI or sound functionality verification would be 
useful.

Then we could queue the first two patches in this series
for v4.10-rc1 and the remaining patches for subsequent
release.

The whole series can be pulled from git repository:
 git://linuxtv.org/snawrocki/samsung.git 
 branch: for-v4.10/dma/pl080-s3c64xx

Thanks.

Sylwester Nawrocki (7):
  dma: pl08x: Add support for the DMA slave map
  ARM: S3C64XX: Add DMA slave maps for PL080 devices
  spi: s3c64xx: Do not use platform_data for DMA parameters
  ASoC: samsung: i2s: Do not use platform_data for DMA parameters
  ASoC: samsung: pcm: Do not use platform_data for DMA parameters
  ARM: S3C64XX: Drop unused DMA fields from struct s3c64xx_spi_csinfo
  ARM: S3C64XX: Drop initialization of unused struct s3c_audio_pdata
    fields

 arch/arm/mach-s3c64xx/dev-audio.c         | 19 ------------------
 arch/arm/mach-s3c64xx/pl080.c             | 32 +++++++++++++++++++++++++++++++
 arch/arm/plat-samsung/devs.c              |  9 ---------
 drivers/dma/amba-pl08x.c                  |  3 +++
 drivers/spi/spi-s3c64xx.c                 | 21 ++++----------------
 include/linux/amba/pl08x.h                |  4 ++++
 include/linux/platform_data/asoc-s3c.h    |  5 -----
 include/linux/platform_data/spi-s3c64xx.h |  3 ---
 sound/soc/samsung/i2s.c                   | 14 ++------------
 sound/soc/samsung/pcm.c                   | 14 +++++---------
 10 files changed, 50 insertions(+), 74 deletions(-)

-- 
1.9.1

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

* [PATCH RFC 0/7] DMA: S3C64XX: Conversion to the new channel request API
  2016-11-04 16:14 ` Sylwester Nawrocki
@ 2016-11-04 16:14   ` Sylwester Nawrocki
  -1 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-samsung-soc, linux-arm-kernel, dmaengine
  Cc: vinod.koul, broonie, ckeepax, ym0914, arnd, kgene, javier,
	andi.shyti, sbkim73, Sylwester Nawrocki

This patch series aims to convert the s3c64xx platform to use
the new universal DMA channel request API, i.e. this is only
meaningful for non-dt systems using s3c64xx SoCs.

I'm sending the whole series as RFC since I didn't test it
yet, I'm going to prepare smd6410 for testing this series.
It would be great if someone else could also test it,
either SPI or sound functionality verification would be 
useful.

Then we could queue the first two patches in this series
for v4.10-rc1 and the remaining patches for subsequent
release.

The whole series can be pulled from git repository:
 git://linuxtv.org/snawrocki/samsung.git 
 branch: for-v4.10/dma/pl080-s3c64xx

Thanks.

Sylwester Nawrocki (7):
  dma: pl08x: Add support for the DMA slave map
  ARM: S3C64XX: Add DMA slave maps for PL080 devices
  spi: s3c64xx: Do not use platform_data for DMA parameters
  ASoC: samsung: i2s: Do not use platform_data for DMA parameters
  ASoC: samsung: pcm: Do not use platform_data for DMA parameters
  ARM: S3C64XX: Drop unused DMA fields from struct s3c64xx_spi_csinfo
  ARM: S3C64XX: Drop initialization of unused struct s3c_audio_pdata
    fields

 arch/arm/mach-s3c64xx/dev-audio.c         | 19 ------------------
 arch/arm/mach-s3c64xx/pl080.c             | 32 +++++++++++++++++++++++++++++++
 arch/arm/plat-samsung/devs.c              |  9 ---------
 drivers/dma/amba-pl08x.c                  |  3 +++
 drivers/spi/spi-s3c64xx.c                 | 21 ++++----------------
 include/linux/amba/pl08x.h                |  4 ++++
 include/linux/platform_data/asoc-s3c.h    |  5 -----
 include/linux/platform_data/spi-s3c64xx.h |  3 ---
 sound/soc/samsung/i2s.c                   | 14 ++------------
 sound/soc/samsung/pcm.c                   | 14 +++++---------
 10 files changed, 50 insertions(+), 74 deletions(-)

-- 
1.9.1

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

* [PATCH RFC 0/7] DMA: S3C64XX: Conversion to the new channel request API
@ 2016-11-04 16:14   ` Sylwester Nawrocki
  0 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series aims to convert the s3c64xx platform to use
the new universal DMA channel request API, i.e. this is only
meaningful for non-dt systems using s3c64xx SoCs.

I'm sending the whole series as RFC since I didn't test it
yet, I'm going to prepare smd6410 for testing this series.
It would be great if someone else could also test it,
either SPI or sound functionality verification would be 
useful.

Then we could queue the first two patches in this series
for v4.10-rc1 and the remaining patches for subsequent
release.

The whole series can be pulled from git repository:
 git://linuxtv.org/snawrocki/samsung.git 
 branch: for-v4.10/dma/pl080-s3c64xx

Thanks.

Sylwester Nawrocki (7):
  dma: pl08x: Add support for the DMA slave map
  ARM: S3C64XX: Add DMA slave maps for PL080 devices
  spi: s3c64xx: Do not use platform_data for DMA parameters
  ASoC: samsung: i2s: Do not use platform_data for DMA parameters
  ASoC: samsung: pcm: Do not use platform_data for DMA parameters
  ARM: S3C64XX: Drop unused DMA fields from struct s3c64xx_spi_csinfo
  ARM: S3C64XX: Drop initialization of unused struct s3c_audio_pdata
    fields

 arch/arm/mach-s3c64xx/dev-audio.c         | 19 ------------------
 arch/arm/mach-s3c64xx/pl080.c             | 32 +++++++++++++++++++++++++++++++
 arch/arm/plat-samsung/devs.c              |  9 ---------
 drivers/dma/amba-pl08x.c                  |  3 +++
 drivers/spi/spi-s3c64xx.c                 | 21 ++++----------------
 include/linux/amba/pl08x.h                |  4 ++++
 include/linux/platform_data/asoc-s3c.h    |  5 -----
 include/linux/platform_data/spi-s3c64xx.h |  3 ---
 sound/soc/samsung/i2s.c                   | 14 ++------------
 sound/soc/samsung/pcm.c                   | 14 +++++---------
 10 files changed, 50 insertions(+), 74 deletions(-)

-- 
1.9.1

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

* [PATCH RFC 1/7] dma: pl08x: Add support for the DMA slave map
  2016-11-04 16:14 ` Sylwester Nawrocki
@ 2016-11-04 16:14   ` Sylwester Nawrocki
  -1 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-samsung-soc, linux-arm-kernel, dmaengine
  Cc: vinod.koul, broonie, ckeepax, ym0914, arnd, kgene, javier,
	andi.shyti, sbkim73, Sylwester Nawrocki

This patch add support for the new channel request API
introduced in commit a8135d0d79e9d0ad3a4ff494fceeaae83
"dmaengine: core: Introduce new, universal API to request a channel"

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/dma/amba-pl08x.c   | 3 +++
 include/linux/amba/pl08x.h | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 939a7c3..d5c75c8 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -2307,6 +2307,9 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
 			ret = -EINVAL;
 			goto out_no_platdata;
 		}
+	} else {
+		pl08x->slave.filter.map = pl08x->pd->slave_map;
+		pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len;
 	}
 
 	/* By default, AHB1 only.  If dualmaster, from platform */
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h
index 27e9ec8..5308eae 100644
--- a/include/linux/amba/pl08x.h
+++ b/include/linux/amba/pl08x.h
@@ -84,6 +84,8 @@ struct pl08x_channel_data {
  * running any DMA transfer and multiplexing can be recycled
  * @lli_buses: buses which LLIs can be fetched from: PL08X_AHB1 | PL08X_AHB2
  * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2
+ * @slave_map: DMA slave matching table
+ * @slave_map_len: number of elements in @slave_map
  */
 struct pl08x_platform_data {
 	struct pl08x_channel_data *slave_channels;
@@ -93,6 +95,8 @@ struct pl08x_platform_data {
 	void (*put_xfer_signal)(const struct pl08x_channel_data *, int);
 	u8 lli_buses;
 	u8 mem_buses;
+	const struct dma_slave_map *slave_map;
+	int slave_map_len;
 };
 
 #ifdef CONFIG_AMBA_PL08X
-- 
1.9.1

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

* [PATCH RFC 1/7] dma: pl08x: Add support for the DMA slave map
@ 2016-11-04 16:14   ` Sylwester Nawrocki
  0 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-arm-kernel

This patch add support for the new channel request API
introduced in commit a8135d0d79e9d0ad3a4ff494fceeaae83
"dmaengine: core: Introduce new, universal API to request a channel"

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/dma/amba-pl08x.c   | 3 +++
 include/linux/amba/pl08x.h | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 939a7c3..d5c75c8 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -2307,6 +2307,9 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
 			ret = -EINVAL;
 			goto out_no_platdata;
 		}
+	} else {
+		pl08x->slave.filter.map = pl08x->pd->slave_map;
+		pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len;
 	}
 
 	/* By default, AHB1 only.  If dualmaster, from platform */
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h
index 27e9ec8..5308eae 100644
--- a/include/linux/amba/pl08x.h
+++ b/include/linux/amba/pl08x.h
@@ -84,6 +84,8 @@ struct pl08x_channel_data {
  * running any DMA transfer and multiplexing can be recycled
  * @lli_buses: buses which LLIs can be fetched from: PL08X_AHB1 | PL08X_AHB2
  * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2
+ * @slave_map: DMA slave matching table
+ * @slave_map_len: number of elements in @slave_map
  */
 struct pl08x_platform_data {
 	struct pl08x_channel_data *slave_channels;
@@ -93,6 +95,8 @@ struct pl08x_platform_data {
 	void (*put_xfer_signal)(const struct pl08x_channel_data *, int);
 	u8 lli_buses;
 	u8 mem_buses;
+	const struct dma_slave_map *slave_map;
+	int slave_map_len;
 };
 
 #ifdef CONFIG_AMBA_PL08X
-- 
1.9.1

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

* [PATCH RFC 2/7] ARM: S3C64XX: Add DMA slave maps for PL080 devices
  2016-11-04 16:14 ` Sylwester Nawrocki
@ 2016-11-04 16:14   ` Sylwester Nawrocki
  -1 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-samsung-soc, linux-arm-kernel, dmaengine
  Cc: vinod.koul, broonie, ckeepax, ym0914, arnd, kgene, javier,
	andi.shyti, sbkim73, Sylwester Nawrocki

This patch adds DMA slave map tables to the pl080 devices's
platform_data in order to support the new channel request API.
A few devices for which there was no DMA support with current
code are omitted from the tables.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 arch/arm/mach-s3c64xx/pl080.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm/mach-s3c64xx/pl080.c b/arch/arm/mach-s3c64xx/pl080.c
index 89c5a62..8c88680 100644
--- a/arch/arm/mach-s3c64xx/pl080.c
+++ b/arch/arm/mach-s3c64xx/pl080.c
@@ -117,6 +117,25 @@ static void pl08x_put_xfer_signal(const struct pl08x_channel_data *cd, int ch)
 	}
 };
 
+static const struct dma_slave_map s3c64xx_dma0_slave_map[] = {
+	{ "s3c6400-uart.0", "tx", (void *)"uart0_tx" },
+	{ "s3c6400-uart.0", "rx", (void *)"uart0_rx" },
+	{ "s3c6400-uart.1", "tx", (void *)"uart1_tx" },
+	{ "s3c6400-uart.1", "rx", (void *)"uart1_rx" },
+	{ "s3c6400-uart.2", "tx", (void *)"uart2_tx" },
+	{ "s3c6400-uart.2", "rx", (void *)"uart2_rx" },
+	{ "s3c6400-uart.3", "tx", (void *)"uart3_tx" },
+	{ "s3c6400-uart.3", "rx", (void *)"uart3_rx" },
+	{ "samsung-pcm.0", "tx", (void *)"pcm0_tx" },
+	{ "samsung-pcm.0", "rx", (void *)"pcm0_rx" },
+	{ "samsung-i2s.0", "tx", (void *)"i2s0_tx" },
+	{ "samsung-i2s.0", "rx", (void *)"i2s0_rx" },
+	{ "s3c6410-spi.0", "tx", (void *)"spi0_tx" },
+	{ "s3c6410-spi.0", "rx", (void *)"spi0_rx" },
+	{ "samsung-i2s.2", "tx", (void *)"i2s2_tx" },
+	{ "samsung-i2s.2", "rx", (void *)"i2s2_rx" },
+};
+
 struct pl08x_platform_data s3c64xx_dma0_plat_data = {
 	.memcpy_channel = {
 		.bus_id = "memcpy",
@@ -134,6 +153,8 @@ struct pl08x_platform_data s3c64xx_dma0_plat_data = {
 	.put_xfer_signal = pl08x_put_xfer_signal,
 	.slave_channels = s3c64xx_dma0_info,
 	.num_slave_channels = ARRAY_SIZE(s3c64xx_dma0_info),
+	.slave_map = s3c64xx_dma0_slave_map,
+	.slavecnt = ARRAY_SIZE(s3c64xx_dma0_slave_map),
 };
 
 static AMBA_AHB_DEVICE(s3c64xx_dma0, "dma-pl080s.0", 0,
@@ -207,6 +228,15 @@ static AMBA_AHB_DEVICE(s3c64xx_dma0, "dma-pl080s.0", 0,
 	},
 };
 
+static const struct dma_slave_map s3c64xx_dma1_slave_map[] = {
+	{ "samsung-pcm.1", "tx", (void *)"pcm1_tx" },
+	{ "samsung-pcm.1", "rx", (void *)"pcm1_rx" },
+	{ "samsung-i2s.1", "tx", (void *)"i2s1_tx" },
+	{ "samsung-i2s.1", "rx", (void *)"i2s1_rx" },
+	{ "s3c6410-spi.1", "tx", (void *)"spi1_tx" },
+	{ "s3c6410-spi.1", "rx", (void *)"spi1_rx" },
+};
+
 struct pl08x_platform_data s3c64xx_dma1_plat_data = {
 	.memcpy_channel = {
 		.bus_id = "memcpy",
@@ -224,6 +254,8 @@ struct pl08x_platform_data s3c64xx_dma1_plat_data = {
 	.put_xfer_signal = pl08x_put_xfer_signal,
 	.slave_channels = s3c64xx_dma1_info,
 	.num_slave_channels = ARRAY_SIZE(s3c64xx_dma1_info),
+	.slave_map = s3c64xx_dma1_slave_map,
+	.slavecnt = ARRAY_SIZE(s3c64xx_dma1_slave_map),
 };
 
 static AMBA_AHB_DEVICE(s3c64xx_dma1, "dma-pl080s.1", 0,
-- 
1.9.1

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

* [PATCH RFC 2/7] ARM: S3C64XX: Add DMA slave maps for PL080 devices
@ 2016-11-04 16:14   ` Sylwester Nawrocki
  0 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds DMA slave map tables to the pl080 devices's
platform_data in order to support the new channel request API.
A few devices for which there was no DMA support with current
code are omitted from the tables.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 arch/arm/mach-s3c64xx/pl080.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm/mach-s3c64xx/pl080.c b/arch/arm/mach-s3c64xx/pl080.c
index 89c5a62..8c88680 100644
--- a/arch/arm/mach-s3c64xx/pl080.c
+++ b/arch/arm/mach-s3c64xx/pl080.c
@@ -117,6 +117,25 @@ static void pl08x_put_xfer_signal(const struct pl08x_channel_data *cd, int ch)
 	}
 };
 
+static const struct dma_slave_map s3c64xx_dma0_slave_map[] = {
+	{ "s3c6400-uart.0", "tx", (void *)"uart0_tx" },
+	{ "s3c6400-uart.0", "rx", (void *)"uart0_rx" },
+	{ "s3c6400-uart.1", "tx", (void *)"uart1_tx" },
+	{ "s3c6400-uart.1", "rx", (void *)"uart1_rx" },
+	{ "s3c6400-uart.2", "tx", (void *)"uart2_tx" },
+	{ "s3c6400-uart.2", "rx", (void *)"uart2_rx" },
+	{ "s3c6400-uart.3", "tx", (void *)"uart3_tx" },
+	{ "s3c6400-uart.3", "rx", (void *)"uart3_rx" },
+	{ "samsung-pcm.0", "tx", (void *)"pcm0_tx" },
+	{ "samsung-pcm.0", "rx", (void *)"pcm0_rx" },
+	{ "samsung-i2s.0", "tx", (void *)"i2s0_tx" },
+	{ "samsung-i2s.0", "rx", (void *)"i2s0_rx" },
+	{ "s3c6410-spi.0", "tx", (void *)"spi0_tx" },
+	{ "s3c6410-spi.0", "rx", (void *)"spi0_rx" },
+	{ "samsung-i2s.2", "tx", (void *)"i2s2_tx" },
+	{ "samsung-i2s.2", "rx", (void *)"i2s2_rx" },
+};
+
 struct pl08x_platform_data s3c64xx_dma0_plat_data = {
 	.memcpy_channel = {
 		.bus_id = "memcpy",
@@ -134,6 +153,8 @@ struct pl08x_platform_data s3c64xx_dma0_plat_data = {
 	.put_xfer_signal = pl08x_put_xfer_signal,
 	.slave_channels = s3c64xx_dma0_info,
 	.num_slave_channels = ARRAY_SIZE(s3c64xx_dma0_info),
+	.slave_map = s3c64xx_dma0_slave_map,
+	.slavecnt = ARRAY_SIZE(s3c64xx_dma0_slave_map),
 };
 
 static AMBA_AHB_DEVICE(s3c64xx_dma0, "dma-pl080s.0", 0,
@@ -207,6 +228,15 @@ static AMBA_AHB_DEVICE(s3c64xx_dma0, "dma-pl080s.0", 0,
 	},
 };
 
+static const struct dma_slave_map s3c64xx_dma1_slave_map[] = {
+	{ "samsung-pcm.1", "tx", (void *)"pcm1_tx" },
+	{ "samsung-pcm.1", "rx", (void *)"pcm1_rx" },
+	{ "samsung-i2s.1", "tx", (void *)"i2s1_tx" },
+	{ "samsung-i2s.1", "rx", (void *)"i2s1_rx" },
+	{ "s3c6410-spi.1", "tx", (void *)"spi1_tx" },
+	{ "s3c6410-spi.1", "rx", (void *)"spi1_rx" },
+};
+
 struct pl08x_platform_data s3c64xx_dma1_plat_data = {
 	.memcpy_channel = {
 		.bus_id = "memcpy",
@@ -224,6 +254,8 @@ struct pl08x_platform_data s3c64xx_dma1_plat_data = {
 	.put_xfer_signal = pl08x_put_xfer_signal,
 	.slave_channels = s3c64xx_dma1_info,
 	.num_slave_channels = ARRAY_SIZE(s3c64xx_dma1_info),
+	.slave_map = s3c64xx_dma1_slave_map,
+	.slavecnt = ARRAY_SIZE(s3c64xx_dma1_slave_map),
 };
 
 static AMBA_AHB_DEVICE(s3c64xx_dma1, "dma-pl080s.1", 0,
-- 
1.9.1

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

* [PATCH RFC 3/7] spi: s3c64xx: Do not use platform_data for DMA parameters
  2016-11-04 16:14 ` Sylwester Nawrocki
@ 2016-11-04 16:14   ` Sylwester Nawrocki
  -1 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-samsung-soc, linux-arm-kernel, dmaengine
  Cc: vinod.koul, broonie, ckeepax, ym0914, arnd, kgene, javier,
	andi.shyti, sbkim73, Sylwester Nawrocki

All related platforms use either devicetree or the DMA slave
map API for mapping DMA channels to DMA slaves so we can now
stop using platform_data for passing DMA details.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 3c09e94..28dfdce 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -341,27 +341,20 @@ static void s3c64xx_spi_set_cs(struct spi_device *spi, bool enable)
 static int s3c64xx_spi_prepare_transfer(struct spi_master *spi)
 {
 	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(spi);
-	dma_filter_fn filter = sdd->cntrlr_info->filter;
 	struct device *dev = &sdd->pdev->dev;
-	dma_cap_mask_t mask;
 
 	if (is_polling(sdd))
 		return 0;
 
-	dma_cap_zero(mask);
-	dma_cap_set(DMA_SLAVE, mask);
-
 	/* Acquire DMA channels */
-	sdd->rx_dma.ch = dma_request_slave_channel_compat(mask, filter,
-			   sdd->cntrlr_info->dma_rx, dev, "rx");
+	sdd->rx_dma.ch = dma_request_slave_channel(dev, "rx");
 	if (!sdd->rx_dma.ch) {
 		dev_err(dev, "Failed to get RX DMA channel\n");
 		return -EBUSY;
 	}
 	spi->dma_rx = sdd->rx_dma.ch;
 
-	sdd->tx_dma.ch = dma_request_slave_channel_compat(mask, filter,
-			   sdd->cntrlr_info->dma_tx, dev, "tx");
+	sdd->tx_dma.ch = dma_request_slave_channel(dev, "tx");
 	if (!sdd->tx_dma.ch) {
 		dev_err(dev, "Failed to get TX DMA channel\n");
 		dma_release_channel(sdd->rx_dma.ch);
@@ -1091,11 +1084,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 
 	sdd->cur_bpw = 8;
 
-	if (!sdd->pdev->dev.of_node && (!sci->dma_tx || !sci->dma_rx)) {
-		dev_warn(&pdev->dev, "Unable to get SPI tx/rx DMA data. Switching to poll mode\n");
-		sdd->port_conf->quirks = S3C64XX_SPI_QUIRK_POLL;
-	}
-
 	sdd->tx_dma.direction = DMA_MEM_TO_DEV;
 	sdd->rx_dma.direction = DMA_DEV_TO_MEM;
 
@@ -1205,9 +1193,8 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 
 	dev_dbg(&pdev->dev, "Samsung SoC SPI Driver loaded for Bus SPI-%d with %d Slaves attached\n",
 					sdd->port_id, master->num_chipselect);
-	dev_dbg(&pdev->dev, "\tIOmem=[%pR]\tFIFO %dbytes\tDMA=[Rx-%p, Tx-%p]\n",
-					mem_res, (FIFO_LVL_MASK(sdd) >> 1) + 1,
-					sci->dma_rx, sci->dma_tx);
+	dev_dbg(&pdev->dev, "\tIOmem=[%pR]\tFIFO %dbytes\n",
+					mem_res, (FIFO_LVL_MASK(sdd) >> 1) + 1);
 
 	pm_runtime_mark_last_busy(&pdev->dev);
 	pm_runtime_put_autosuspend(&pdev->dev);
-- 
1.9.1

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

* [PATCH RFC 3/7] spi: s3c64xx: Do not use platform_data for DMA parameters
@ 2016-11-04 16:14   ` Sylwester Nawrocki
  0 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-arm-kernel

All related platforms use either devicetree or the DMA slave
map API for mapping DMA channels to DMA slaves so we can now
stop using platform_data for passing DMA details.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 3c09e94..28dfdce 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -341,27 +341,20 @@ static void s3c64xx_spi_set_cs(struct spi_device *spi, bool enable)
 static int s3c64xx_spi_prepare_transfer(struct spi_master *spi)
 {
 	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(spi);
-	dma_filter_fn filter = sdd->cntrlr_info->filter;
 	struct device *dev = &sdd->pdev->dev;
-	dma_cap_mask_t mask;
 
 	if (is_polling(sdd))
 		return 0;
 
-	dma_cap_zero(mask);
-	dma_cap_set(DMA_SLAVE, mask);
-
 	/* Acquire DMA channels */
-	sdd->rx_dma.ch = dma_request_slave_channel_compat(mask, filter,
-			   sdd->cntrlr_info->dma_rx, dev, "rx");
+	sdd->rx_dma.ch = dma_request_slave_channel(dev, "rx");
 	if (!sdd->rx_dma.ch) {
 		dev_err(dev, "Failed to get RX DMA channel\n");
 		return -EBUSY;
 	}
 	spi->dma_rx = sdd->rx_dma.ch;
 
-	sdd->tx_dma.ch = dma_request_slave_channel_compat(mask, filter,
-			   sdd->cntrlr_info->dma_tx, dev, "tx");
+	sdd->tx_dma.ch = dma_request_slave_channel(dev, "tx");
 	if (!sdd->tx_dma.ch) {
 		dev_err(dev, "Failed to get TX DMA channel\n");
 		dma_release_channel(sdd->rx_dma.ch);
@@ -1091,11 +1084,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 
 	sdd->cur_bpw = 8;
 
-	if (!sdd->pdev->dev.of_node && (!sci->dma_tx || !sci->dma_rx)) {
-		dev_warn(&pdev->dev, "Unable to get SPI tx/rx DMA data. Switching to poll mode\n");
-		sdd->port_conf->quirks = S3C64XX_SPI_QUIRK_POLL;
-	}
-
 	sdd->tx_dma.direction = DMA_MEM_TO_DEV;
 	sdd->rx_dma.direction = DMA_DEV_TO_MEM;
 
@@ -1205,9 +1193,8 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 
 	dev_dbg(&pdev->dev, "Samsung SoC SPI Driver loaded for Bus SPI-%d with %d Slaves attached\n",
 					sdd->port_id, master->num_chipselect);
-	dev_dbg(&pdev->dev, "\tIOmem=[%pR]\tFIFO %dbytes\tDMA=[Rx-%p, Tx-%p]\n",
-					mem_res, (FIFO_LVL_MASK(sdd) >> 1) + 1,
-					sci->dma_rx, sci->dma_tx);
+	dev_dbg(&pdev->dev, "\tIOmem=[%pR]\tFIFO %dbytes\n",
+					mem_res, (FIFO_LVL_MASK(sdd) >> 1) + 1);
 
 	pm_runtime_mark_last_busy(&pdev->dev);
 	pm_runtime_put_autosuspend(&pdev->dev);
-- 
1.9.1

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

* [PATCH RFC 4/7] ASoC: samsung: i2s: Do not use platform_data for DMA parameters
  2016-11-04 16:14 ` Sylwester Nawrocki
@ 2016-11-04 16:14   ` Sylwester Nawrocki
  -1 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-samsung-soc, linux-arm-kernel, dmaengine
  Cc: vinod.koul, broonie, ckeepax, ym0914, arnd, kgene, javier,
	andi.shyti, sbkim73, Sylwester Nawrocki

All related platforms use either devicetree or the DMA slave
map API for mapping DMA channels to slave devices so we can now
stop using platform_data for passing DMA details.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 sound/soc/samsung/i2s.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 7e32cf4..95a9a3f 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -90,7 +90,6 @@ struct i2s_dai {
 	struct snd_dmaengine_dai_dma_data dma_playback;
 	struct snd_dmaengine_dai_dma_data dma_capture;
 	struct snd_dmaengine_dai_dma_data idma_playback;
-	dma_filter_fn filter;
 	u32	quirks;
 	u32	suspend_i2smod;
 	u32	suspend_i2scon;
@@ -1244,7 +1243,7 @@ static int samsung_i2s_probe(struct platform_device *pdev)
 			return ret;
 
 		return samsung_asoc_dma_platform_register(&pdev->dev,
-					sec_dai->filter, "tx-sec", NULL);
+						NULL, "tx-sec", NULL);
 	}
 
 	pri_dai = i2s_alloc_dai(pdev, false);
@@ -1262,10 +1261,6 @@ static int samsung_i2s_probe(struct platform_device *pdev)
 			return -EINVAL;
 		}
 
-		pri_dai->dma_playback.filter_data = i2s_pdata->dma_playback;
-		pri_dai->dma_capture.filter_data = i2s_pdata->dma_capture;
-		pri_dai->filter = i2s_pdata->dma_filter;
-
 		if (&i2s_pdata->type)
 			i2s_cfg = &i2s_pdata->type.i2s;
 
@@ -1327,11 +1322,6 @@ static int samsung_i2s_probe(struct platform_device *pdev)
 		sec_dai->dma_playback.addr = regs_base + I2STXDS;
 		sec_dai->dma_playback.chan_name = "tx-sec";
 
-		if (!np) {
-			sec_dai->dma_playback.filter_data = i2s_pdata->dma_play_sec;
-			sec_dai->filter = i2s_pdata->dma_filter;
-		}
-
 		sec_dai->dma_playback.addr_width = 4;
 		sec_dai->addr = pri_dai->addr;
 		sec_dai->clk = pri_dai->clk;
@@ -1353,7 +1343,7 @@ static int samsung_i2s_probe(struct platform_device *pdev)
 	if (ret < 0)
 		goto err_free_dai;
 
-	ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter,
+	ret = samsung_asoc_dma_platform_register(&pdev->dev, NULL,
 						 NULL, NULL);
 	if (ret < 0)
 		goto err_free_dai;
-- 
1.9.1

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

* [PATCH RFC 4/7] ASoC: samsung: i2s: Do not use platform_data for DMA parameters
@ 2016-11-04 16:14   ` Sylwester Nawrocki
  0 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-arm-kernel

All related platforms use either devicetree or the DMA slave
map API for mapping DMA channels to slave devices so we can now
stop using platform_data for passing DMA details.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 sound/soc/samsung/i2s.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 7e32cf4..95a9a3f 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -90,7 +90,6 @@ struct i2s_dai {
 	struct snd_dmaengine_dai_dma_data dma_playback;
 	struct snd_dmaengine_dai_dma_data dma_capture;
 	struct snd_dmaengine_dai_dma_data idma_playback;
-	dma_filter_fn filter;
 	u32	quirks;
 	u32	suspend_i2smod;
 	u32	suspend_i2scon;
@@ -1244,7 +1243,7 @@ static int samsung_i2s_probe(struct platform_device *pdev)
 			return ret;
 
 		return samsung_asoc_dma_platform_register(&pdev->dev,
-					sec_dai->filter, "tx-sec", NULL);
+						NULL, "tx-sec", NULL);
 	}
 
 	pri_dai = i2s_alloc_dai(pdev, false);
@@ -1262,10 +1261,6 @@ static int samsung_i2s_probe(struct platform_device *pdev)
 			return -EINVAL;
 		}
 
-		pri_dai->dma_playback.filter_data = i2s_pdata->dma_playback;
-		pri_dai->dma_capture.filter_data = i2s_pdata->dma_capture;
-		pri_dai->filter = i2s_pdata->dma_filter;
-
 		if (&i2s_pdata->type)
 			i2s_cfg = &i2s_pdata->type.i2s;
 
@@ -1327,11 +1322,6 @@ static int samsung_i2s_probe(struct platform_device *pdev)
 		sec_dai->dma_playback.addr = regs_base + I2STXDS;
 		sec_dai->dma_playback.chan_name = "tx-sec";
 
-		if (!np) {
-			sec_dai->dma_playback.filter_data = i2s_pdata->dma_play_sec;
-			sec_dai->filter = i2s_pdata->dma_filter;
-		}
-
 		sec_dai->dma_playback.addr_width = 4;
 		sec_dai->addr = pri_dai->addr;
 		sec_dai->clk = pri_dai->clk;
@@ -1353,7 +1343,7 @@ static int samsung_i2s_probe(struct platform_device *pdev)
 	if (ret < 0)
 		goto err_free_dai;
 
-	ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter,
+	ret = samsung_asoc_dma_platform_register(&pdev->dev, NULL,
 						 NULL, NULL);
 	if (ret < 0)
 		goto err_free_dai;
-- 
1.9.1

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

* [PATCH RFC 5/7] ASoC: samsung: pcm: Do not use platform_data for DMA parameters
  2016-11-04 16:14 ` Sylwester Nawrocki
@ 2016-11-04 16:14   ` Sylwester Nawrocki
  -1 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-samsung-soc, linux-arm-kernel, dmaengine
  Cc: vinod.koul, broonie, ckeepax, ym0914, arnd, kgene, javier,
	andi.shyti, sbkim73, Sylwester Nawrocki

All related platforms use either devicetree or the DMA slave
map API for mapping DMA channels to slave devices so we can now
stop using platform_data for passing DMA details.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 sound/soc/samsung/pcm.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c
index 43e367a..ccedab2 100644
--- a/sound/soc/samsung/pcm.c
+++ b/sound/soc/samsung/pcm.c
@@ -134,18 +134,22 @@ struct s3c_pcm_info {
 static struct snd_dmaengine_dai_dma_data s3c_pcm_stereo_out[] = {
 	[0] = {
 		.addr_width	= 4,
+		.chan_name	= "tx",
 	},
 	[1] = {
 		.addr_width	= 4,
+		.chan_name	= "tx",
 	},
 };
 
 static struct snd_dmaengine_dai_dma_data s3c_pcm_stereo_in[] = {
 	[0] = {
 		.addr_width	= 4,
+		.chan_name	= "rx",
 	},
 	[1] = {
 		.addr_width	= 4,
+		.chan_name	= "rx",
 	},
 };
 
@@ -488,7 +492,6 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
 	struct s3c_pcm_info *pcm;
 	struct resource *mem_res;
 	struct s3c_audio_pdata *pcm_pdata;
-	dma_filter_fn filter;
 	int ret;
 
 	/* Check for valid device index */
@@ -555,13 +558,6 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
 	s3c_pcm_stereo_in[pdev->id].addr = mem_res->start + S3C_PCM_RXFIFO;
 	s3c_pcm_stereo_out[pdev->id].addr = mem_res->start + S3C_PCM_TXFIFO;
 
-	filter = NULL;
-	if (pcm_pdata) {
-		s3c_pcm_stereo_in[pdev->id].filter_data = pcm_pdata->dma_capture;
-		s3c_pcm_stereo_out[pdev->id].filter_data = pcm_pdata->dma_playback;
-		filter = pcm_pdata->dma_filter;
-	}
-
 	pcm->dma_capture = &s3c_pcm_stereo_in[pdev->id];
 	pcm->dma_playback = &s3c_pcm_stereo_out[pdev->id];
 
@@ -574,7 +570,7 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
 		goto err5;
 	}
 
-	ret = samsung_asoc_dma_platform_register(&pdev->dev, filter,
+	ret = samsung_asoc_dma_platform_register(&pdev->dev, NULL,
 						 NULL, NULL);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to get register DMA: %d\n", ret);
-- 
1.9.1

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

* [PATCH RFC 5/7] ASoC: samsung: pcm: Do not use platform_data for DMA parameters
@ 2016-11-04 16:14   ` Sylwester Nawrocki
  0 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-arm-kernel

All related platforms use either devicetree or the DMA slave
map API for mapping DMA channels to slave devices so we can now
stop using platform_data for passing DMA details.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 sound/soc/samsung/pcm.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c
index 43e367a..ccedab2 100644
--- a/sound/soc/samsung/pcm.c
+++ b/sound/soc/samsung/pcm.c
@@ -134,18 +134,22 @@ struct s3c_pcm_info {
 static struct snd_dmaengine_dai_dma_data s3c_pcm_stereo_out[] = {
 	[0] = {
 		.addr_width	= 4,
+		.chan_name	= "tx",
 	},
 	[1] = {
 		.addr_width	= 4,
+		.chan_name	= "tx",
 	},
 };
 
 static struct snd_dmaengine_dai_dma_data s3c_pcm_stereo_in[] = {
 	[0] = {
 		.addr_width	= 4,
+		.chan_name	= "rx",
 	},
 	[1] = {
 		.addr_width	= 4,
+		.chan_name	= "rx",
 	},
 };
 
@@ -488,7 +492,6 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
 	struct s3c_pcm_info *pcm;
 	struct resource *mem_res;
 	struct s3c_audio_pdata *pcm_pdata;
-	dma_filter_fn filter;
 	int ret;
 
 	/* Check for valid device index */
@@ -555,13 +558,6 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
 	s3c_pcm_stereo_in[pdev->id].addr = mem_res->start + S3C_PCM_RXFIFO;
 	s3c_pcm_stereo_out[pdev->id].addr = mem_res->start + S3C_PCM_TXFIFO;
 
-	filter = NULL;
-	if (pcm_pdata) {
-		s3c_pcm_stereo_in[pdev->id].filter_data = pcm_pdata->dma_capture;
-		s3c_pcm_stereo_out[pdev->id].filter_data = pcm_pdata->dma_playback;
-		filter = pcm_pdata->dma_filter;
-	}
-
 	pcm->dma_capture = &s3c_pcm_stereo_in[pdev->id];
 	pcm->dma_playback = &s3c_pcm_stereo_out[pdev->id];
 
@@ -574,7 +570,7 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
 		goto err5;
 	}
 
-	ret = samsung_asoc_dma_platform_register(&pdev->dev, filter,
+	ret = samsung_asoc_dma_platform_register(&pdev->dev, NULL,
 						 NULL, NULL);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to get register DMA: %d\n", ret);
-- 
1.9.1

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

* [PATCH RFC 6/7] ARM: S3C64XX: Drop unused DMA fields from struct s3c64xx_spi_csinfo
  2016-11-04 16:14 ` Sylwester Nawrocki
@ 2016-11-04 16:14   ` Sylwester Nawrocki
  -1 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-samsung-soc, linux-arm-kernel, dmaengine
  Cc: vinod.koul, broonie, ckeepax, ym0914, arnd, kgene, javier,
	andi.shyti, sbkim73, Sylwester Nawrocki

There is no drivers using those fields so remove them and
remaining initializations.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 arch/arm/plat-samsung/devs.c              | 9 ---------
 include/linux/platform_data/spi-s3c64xx.h | 3 ---
 2 files changed, 12 deletions(-)

diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index e93aa67..4e14bf6 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -1124,15 +1124,6 @@ void __init s3c64xx_spi0_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
 	pd.num_cs = num_cs;
 	pd.src_clk_nr = src_clk_nr;
 	pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi0_cfg_gpio;
-	pd.dma_tx = (void *)DMACH_SPI0_TX;
-	pd.dma_rx = (void *)DMACH_SPI0_RX;
-#if defined(CONFIG_PL330_DMA)
-	pd.filter = pl330_filter;
-#elif defined(CONFIG_S3C64XX_PL080)
-	pd.filter = pl08x_filter_id;
-#elif defined(CONFIG_S3C24XX_DMAC)
-	pd.filter = s3c24xx_dma_filter;
-#endif
 
 	s3c_set_platdata(&pd, sizeof(pd), &s3c64xx_device_spi0);
 }
diff --git a/include/linux/platform_data/spi-s3c64xx.h b/include/linux/platform_data/spi-s3c64xx.h
index 5c1e21c..da79774 100644
--- a/include/linux/platform_data/spi-s3c64xx.h
+++ b/include/linux/platform_data/spi-s3c64xx.h
@@ -40,9 +40,6 @@ struct s3c64xx_spi_info {
 	int num_cs;
 	bool no_cs;
 	int (*cfg_gpio)(void);
-	dma_filter_fn filter;
-	void *dma_tx;
-	void *dma_rx;
 };
 
 /**
-- 
1.9.1

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

* [PATCH RFC 6/7] ARM: S3C64XX: Drop unused DMA fields from struct s3c64xx_spi_csinfo
@ 2016-11-04 16:14   ` Sylwester Nawrocki
  0 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-arm-kernel

There is no drivers using those fields so remove them and
remaining initializations.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 arch/arm/plat-samsung/devs.c              | 9 ---------
 include/linux/platform_data/spi-s3c64xx.h | 3 ---
 2 files changed, 12 deletions(-)

diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index e93aa67..4e14bf6 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -1124,15 +1124,6 @@ void __init s3c64xx_spi0_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
 	pd.num_cs = num_cs;
 	pd.src_clk_nr = src_clk_nr;
 	pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi0_cfg_gpio;
-	pd.dma_tx = (void *)DMACH_SPI0_TX;
-	pd.dma_rx = (void *)DMACH_SPI0_RX;
-#if defined(CONFIG_PL330_DMA)
-	pd.filter = pl330_filter;
-#elif defined(CONFIG_S3C64XX_PL080)
-	pd.filter = pl08x_filter_id;
-#elif defined(CONFIG_S3C24XX_DMAC)
-	pd.filter = s3c24xx_dma_filter;
-#endif
 
 	s3c_set_platdata(&pd, sizeof(pd), &s3c64xx_device_spi0);
 }
diff --git a/include/linux/platform_data/spi-s3c64xx.h b/include/linux/platform_data/spi-s3c64xx.h
index 5c1e21c..da79774 100644
--- a/include/linux/platform_data/spi-s3c64xx.h
+++ b/include/linux/platform_data/spi-s3c64xx.h
@@ -40,9 +40,6 @@ struct s3c64xx_spi_info {
 	int num_cs;
 	bool no_cs;
 	int (*cfg_gpio)(void);
-	dma_filter_fn filter;
-	void *dma_tx;
-	void *dma_rx;
 };
 
 /**
-- 
1.9.1

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

* [PATCH RFC 7/7] ARM: S3C64XX: Drop initialization of unused struct s3c_audio_pdata fields
  2016-11-04 16:14 ` Sylwester Nawrocki
@ 2016-11-04 16:14   ` Sylwester Nawrocki
  -1 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-samsung-soc, linux-arm-kernel, dmaengine
  Cc: vinod.koul, broonie, ckeepax, ym0914, arnd, kgene, javier,
	andi.shyti, sbkim73, Sylwester Nawrocki

There is no drivers using these fields so remove them and remaining
initializations.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 arch/arm/mach-s3c64xx/dev-audio.c      | 19 -------------------
 include/linux/platform_data/asoc-s3c.h |  5 -----
 2 files changed, 24 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c
index b577833..a3f39dd 100644
--- a/arch/arm/mach-s3c64xx/dev-audio.c
+++ b/arch/arm/mach-s3c64xx/dev-audio.c
@@ -58,9 +58,6 @@ static int s3c64xx_i2s_cfg_gpio(struct platform_device *pdev)
 
 static struct s3c_audio_pdata i2s0_pdata = {
 	.cfg_gpio = s3c64xx_i2s_cfg_gpio,
-	.dma_filter = pl08x_filter_id,
-	.dma_playback = DMACH_I2S0_OUT,
-	.dma_capture = DMACH_I2S0_IN,
 };
 
 struct platform_device s3c64xx_device_iis0 = {
@@ -80,9 +77,6 @@ struct platform_device s3c64xx_device_iis0 = {
 
 static struct s3c_audio_pdata i2s1_pdata = {
 	.cfg_gpio = s3c64xx_i2s_cfg_gpio,
-	.dma_filter = pl08x_filter_id,
-	.dma_playback = DMACH_I2S1_OUT,
-	.dma_capture = DMACH_I2S1_IN,
 };
 
 struct platform_device s3c64xx_device_iis1 = {
@@ -102,9 +96,6 @@ struct platform_device s3c64xx_device_iis1 = {
 
 static struct s3c_audio_pdata i2sv4_pdata = {
 	.cfg_gpio = s3c64xx_i2s_cfg_gpio,
-	.dma_filter = pl08x_filter_id,
-	.dma_playback = DMACH_HSI_I2SV40_TX,
-	.dma_capture = DMACH_HSI_I2SV40_RX,
 	.type = {
 		.i2s = {
 			.quirks = QUIRK_PRI_6CHAN,
@@ -153,9 +144,6 @@ static int s3c64xx_pcm_cfg_gpio(struct platform_device *pdev)
 
 static struct s3c_audio_pdata s3c_pcm0_pdata = {
 	.cfg_gpio = s3c64xx_pcm_cfg_gpio,
-	.dma_filter = pl08x_filter_id,
-	.dma_capture = DMACH_PCM0_RX,
-	.dma_playback = DMACH_PCM0_TX,
 };
 
 struct platform_device s3c64xx_device_pcm0 = {
@@ -175,9 +163,6 @@ struct platform_device s3c64xx_device_pcm0 = {
 
 static struct s3c_audio_pdata s3c_pcm1_pdata = {
 	.cfg_gpio = s3c64xx_pcm_cfg_gpio,
-	.dma_filter = pl08x_filter_id,
-	.dma_playback = DMACH_PCM1_TX,
-	.dma_capture = DMACH_PCM1_RX,
 };
 
 struct platform_device s3c64xx_device_pcm1 = {
@@ -209,10 +194,6 @@ static int s3c64xx_ac97_cfg_gpe(struct platform_device *pdev)
 };
 
 static struct s3c_audio_pdata s3c_ac97_pdata = {
-	.dma_playback = DMACH_AC97_PCMOUT,
-	.dma_filter = pl08x_filter_id,
-	.dma_capture = DMACH_AC97_PCMIN,
-	.dma_capture_mic = DMACH_AC97_MICIN,
 };
 
 static u64 s3c64xx_ac97_dmamask = DMA_BIT_MASK(32);
diff --git a/include/linux/platform_data/asoc-s3c.h b/include/linux/platform_data/asoc-s3c.h
index 15bf56e..2d415f6 100644
--- a/include/linux/platform_data/asoc-s3c.h
+++ b/include/linux/platform_data/asoc-s3c.h
@@ -42,11 +42,6 @@ struct samsung_i2s {
  */
 struct s3c_audio_pdata {
 	int (*cfg_gpio)(struct platform_device *);
-	dma_filter_fn dma_filter;
-	void *dma_playback;
-	void *dma_capture;
-	void *dma_play_sec;
-	void *dma_capture_mic;
 	union {
 		struct samsung_i2s i2s;
 	} type;
-- 
1.9.1

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

* [PATCH RFC 7/7] ARM: S3C64XX: Drop initialization of unused struct s3c_audio_pdata fields
@ 2016-11-04 16:14   ` Sylwester Nawrocki
  0 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-04 16:14 UTC (permalink / raw)
  To: linux-arm-kernel

There is no drivers using these fields so remove them and remaining
initializations.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 arch/arm/mach-s3c64xx/dev-audio.c      | 19 -------------------
 include/linux/platform_data/asoc-s3c.h |  5 -----
 2 files changed, 24 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c
index b577833..a3f39dd 100644
--- a/arch/arm/mach-s3c64xx/dev-audio.c
+++ b/arch/arm/mach-s3c64xx/dev-audio.c
@@ -58,9 +58,6 @@ static int s3c64xx_i2s_cfg_gpio(struct platform_device *pdev)
 
 static struct s3c_audio_pdata i2s0_pdata = {
 	.cfg_gpio = s3c64xx_i2s_cfg_gpio,
-	.dma_filter = pl08x_filter_id,
-	.dma_playback = DMACH_I2S0_OUT,
-	.dma_capture = DMACH_I2S0_IN,
 };
 
 struct platform_device s3c64xx_device_iis0 = {
@@ -80,9 +77,6 @@ struct platform_device s3c64xx_device_iis0 = {
 
 static struct s3c_audio_pdata i2s1_pdata = {
 	.cfg_gpio = s3c64xx_i2s_cfg_gpio,
-	.dma_filter = pl08x_filter_id,
-	.dma_playback = DMACH_I2S1_OUT,
-	.dma_capture = DMACH_I2S1_IN,
 };
 
 struct platform_device s3c64xx_device_iis1 = {
@@ -102,9 +96,6 @@ struct platform_device s3c64xx_device_iis1 = {
 
 static struct s3c_audio_pdata i2sv4_pdata = {
 	.cfg_gpio = s3c64xx_i2s_cfg_gpio,
-	.dma_filter = pl08x_filter_id,
-	.dma_playback = DMACH_HSI_I2SV40_TX,
-	.dma_capture = DMACH_HSI_I2SV40_RX,
 	.type = {
 		.i2s = {
 			.quirks = QUIRK_PRI_6CHAN,
@@ -153,9 +144,6 @@ static int s3c64xx_pcm_cfg_gpio(struct platform_device *pdev)
 
 static struct s3c_audio_pdata s3c_pcm0_pdata = {
 	.cfg_gpio = s3c64xx_pcm_cfg_gpio,
-	.dma_filter = pl08x_filter_id,
-	.dma_capture = DMACH_PCM0_RX,
-	.dma_playback = DMACH_PCM0_TX,
 };
 
 struct platform_device s3c64xx_device_pcm0 = {
@@ -175,9 +163,6 @@ struct platform_device s3c64xx_device_pcm0 = {
 
 static struct s3c_audio_pdata s3c_pcm1_pdata = {
 	.cfg_gpio = s3c64xx_pcm_cfg_gpio,
-	.dma_filter = pl08x_filter_id,
-	.dma_playback = DMACH_PCM1_TX,
-	.dma_capture = DMACH_PCM1_RX,
 };
 
 struct platform_device s3c64xx_device_pcm1 = {
@@ -209,10 +194,6 @@ static int s3c64xx_ac97_cfg_gpe(struct platform_device *pdev)
 };
 
 static struct s3c_audio_pdata s3c_ac97_pdata = {
-	.dma_playback = DMACH_AC97_PCMOUT,
-	.dma_filter = pl08x_filter_id,
-	.dma_capture = DMACH_AC97_PCMIN,
-	.dma_capture_mic = DMACH_AC97_MICIN,
 };
 
 static u64 s3c64xx_ac97_dmamask = DMA_BIT_MASK(32);
diff --git a/include/linux/platform_data/asoc-s3c.h b/include/linux/platform_data/asoc-s3c.h
index 15bf56e..2d415f6 100644
--- a/include/linux/platform_data/asoc-s3c.h
+++ b/include/linux/platform_data/asoc-s3c.h
@@ -42,11 +42,6 @@ struct samsung_i2s {
  */
 struct s3c_audio_pdata {
 	int (*cfg_gpio)(struct platform_device *);
-	dma_filter_fn dma_filter;
-	void *dma_playback;
-	void *dma_capture;
-	void *dma_play_sec;
-	void *dma_capture_mic;
 	union {
 		struct samsung_i2s i2s;
 	} type;
-- 
1.9.1

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

* Re: [PATCH RFC 3/7] spi: s3c64xx: Do not use platform_data for DMA parameters
  2016-11-04 16:14   ` Sylwester Nawrocki
@ 2016-11-04 17:12     ` Mark Brown
  -1 siblings, 0 replies; 56+ messages in thread
From: Mark Brown @ 2016-11-04 17:12 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, linux-arm-kernel, dmaengine, vinod.koul,
	ckeepax, ym0914, arnd, kgene, javier, andi.shyti, sbkim73

[-- Attachment #1: Type: text/plain, Size: 289 bytes --]

On Fri, Nov 04, 2016 at 05:14:50PM +0100, Sylwester Nawrocki wrote:
> All related platforms use either devicetree or the DMA slave
> map API for mapping DMA channels to DMA slaves so we can now
> stop using platform_data for passing DMA details.

Acked-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

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

* [PATCH RFC 3/7] spi: s3c64xx: Do not use platform_data for DMA parameters
@ 2016-11-04 17:12     ` Mark Brown
  0 siblings, 0 replies; 56+ messages in thread
From: Mark Brown @ 2016-11-04 17:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 04, 2016 at 05:14:50PM +0100, Sylwester Nawrocki wrote:
> All related platforms use either devicetree or the DMA slave
> map API for mapping DMA channels to DMA slaves so we can now
> stop using platform_data for passing DMA details.

Acked-by: Mark Brown <broonie@kernel.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161104/353d7b33/attachment.sig>

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

* Re: [PATCH RFC 4/7] ASoC: samsung: i2s: Do not use platform_data for DMA parameters
  2016-11-04 16:14   ` Sylwester Nawrocki
@ 2016-11-04 17:13     ` Mark Brown
  -1 siblings, 0 replies; 56+ messages in thread
From: Mark Brown @ 2016-11-04 17:13 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, linux-arm-kernel, dmaengine, vinod.koul,
	ckeepax, ym0914, arnd, kgene, javier, andi.shyti, sbkim73

[-- Attachment #1: Type: text/plain, Size: 292 bytes --]

On Fri, Nov 04, 2016 at 05:14:51PM +0100, Sylwester Nawrocki wrote:
> All related platforms use either devicetree or the DMA slave
> map API for mapping DMA channels to slave devices so we can now
> stop using platform_data for passing DMA details.

Acked-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

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

* [PATCH RFC 4/7] ASoC: samsung: i2s: Do not use platform_data for DMA parameters
@ 2016-11-04 17:13     ` Mark Brown
  0 siblings, 0 replies; 56+ messages in thread
From: Mark Brown @ 2016-11-04 17:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 04, 2016 at 05:14:51PM +0100, Sylwester Nawrocki wrote:
> All related platforms use either devicetree or the DMA slave
> map API for mapping DMA channels to slave devices so we can now
> stop using platform_data for passing DMA details.

Acked-by: Mark Brown <broonie@kernel.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161104/f967f889/attachment-0001.sig>

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

* Re: [PATCH RFC 5/7] ASoC: samsung: pcm: Do not use platform_data for DMA parameters
  2016-11-04 16:14   ` Sylwester Nawrocki
@ 2016-11-04 17:13     ` Mark Brown
  -1 siblings, 0 replies; 56+ messages in thread
From: Mark Brown @ 2016-11-04 17:13 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, linux-arm-kernel, dmaengine, vinod.koul,
	ckeepax, ym0914, arnd, kgene, javier, andi.shyti, sbkim73

[-- Attachment #1: Type: text/plain, Size: 292 bytes --]

On Fri, Nov 04, 2016 at 05:14:52PM +0100, Sylwester Nawrocki wrote:
> All related platforms use either devicetree or the DMA slave
> map API for mapping DMA channels to slave devices so we can now
> stop using platform_data for passing DMA details.

Acked-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

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

* [PATCH RFC 5/7] ASoC: samsung: pcm: Do not use platform_data for DMA parameters
@ 2016-11-04 17:13     ` Mark Brown
  0 siblings, 0 replies; 56+ messages in thread
From: Mark Brown @ 2016-11-04 17:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 04, 2016 at 05:14:52PM +0100, Sylwester Nawrocki wrote:
> All related platforms use either devicetree or the DMA slave
> map API for mapping DMA channels to slave devices so we can now
> stop using platform_data for passing DMA details.

Acked-by: Mark Brown <broonie@kernel.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161104/dde0e7b9/attachment.sig>

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

* Re: [PATCH RFC 1/7] dma: pl08x: Add support for the DMA slave map
  2016-11-04 16:14   ` Sylwester Nawrocki
@ 2016-11-04 23:26     ` Arnd Bergmann
  -1 siblings, 0 replies; 56+ messages in thread
From: Arnd Bergmann @ 2016-11-04 23:26 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Sylwester Nawrocki, linux-samsung-soc, dmaengine, vinod.koul,
	sbkim73, andi.shyti, javier, broonie, kgene, ckeepax, ym0914

On Friday 04 November 2016, Sylwester Nawrocki wrote:
> +       } else {
> +               pl08x->slave.filter.map = pl08x->pd->slave_map;
> +               pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len;
>         }

I think you miss the setup of the filter function here.

Filtering by string in this driver is a bit awkward, so I wonder if we
might want to go one step further here and pass the actual data (i.e. 
struct pl08x_channel_data) rather than the string here.

	Arnd

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

* [PATCH RFC 1/7] dma: pl08x: Add support for the DMA slave map
@ 2016-11-04 23:26     ` Arnd Bergmann
  0 siblings, 0 replies; 56+ messages in thread
From: Arnd Bergmann @ 2016-11-04 23:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 04 November 2016, Sylwester Nawrocki wrote:
> +       } else {
> +               pl08x->slave.filter.map = pl08x->pd->slave_map;
> +               pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len;
>         }

I think you miss the setup of the filter function here.

Filtering by string in this driver is a bit awkward, so I wonder if we
might want to go one step further here and pass the actual data (i.e. 
struct pl08x_channel_data) rather than the string here.

	Arnd

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

* Re: [PATCH RFC 4/7] ASoC: samsung: i2s: Do not use platform_data for DMA parameters
  2016-11-04 16:14   ` Sylwester Nawrocki
@ 2016-11-04 23:29     ` Arnd Bergmann
  -1 siblings, 0 replies; 56+ messages in thread
From: Arnd Bergmann @ 2016-11-04 23:29 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, linux-arm-kernel, dmaengine, vinod.koul,
	broonie, ckeepax, ym0914, kgene, javier, andi.shyti, sbkim73

On Friday 04 November 2016, Sylwester Nawrocki wrote:
> -       ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter,
> +       ret = samsung_asoc_dma_platform_register(&pdev->dev, NULL,
>                                                  NULL, NULL);

If we remove the filter argument from every caller here, maybe we should also
change the prototype to not expect those three NULL arguments any more.



	Arnd

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

* [PATCH RFC 4/7] ASoC: samsung: i2s: Do not use platform_data for DMA parameters
@ 2016-11-04 23:29     ` Arnd Bergmann
  0 siblings, 0 replies; 56+ messages in thread
From: Arnd Bergmann @ 2016-11-04 23:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 04 November 2016, Sylwester Nawrocki wrote:
> -       ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter,
> +       ret = samsung_asoc_dma_platform_register(&pdev->dev, NULL,
>                                                  NULL, NULL);

If we remove the filter argument from every caller here, maybe we should also
change the prototype to not expect those three NULL arguments any more.



	Arnd

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

* Re: [PATCH RFC 3/7] spi: s3c64xx: Do not use platform_data for DMA parameters
  2016-11-04 16:14   ` Sylwester Nawrocki
@ 2016-11-07  2:51     ` Andi Shyti
  -1 siblings, 0 replies; 56+ messages in thread
From: Andi Shyti @ 2016-11-07  2:51 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, linux-arm-kernel, dmaengine, vinod.koul,
	broonie, ckeepax, ym0914, arnd, kgene, javier, sbkim73

Hi Sylwester,

> All related platforms use either devicetree or the DMA slave
> map API for mapping DMA channels to DMA slaves so we can now
> stop using platform_data for passing DMA details.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

Tested-by: Andi Shyti <andi.shyti@samsung.com>

Andi

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

* [PATCH RFC 3/7] spi: s3c64xx: Do not use platform_data for DMA parameters
@ 2016-11-07  2:51     ` Andi Shyti
  0 siblings, 0 replies; 56+ messages in thread
From: Andi Shyti @ 2016-11-07  2:51 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sylwester,

> All related platforms use either devicetree or the DMA slave
> map API for mapping DMA channels to DMA slaves so we can now
> stop using platform_data for passing DMA details.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

Tested-by: Andi Shyti <andi.shyti@samsung.com>

Andi

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

* Re: [PATCH RFC 1/7] dma: pl08x: Add support for the DMA slave map
  2016-11-04 23:26     ` Arnd Bergmann
@ 2016-11-07 15:41       ` Sylwester Nawrocki
  -1 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-07 15:41 UTC (permalink / raw)
  To: Arnd Bergmann, dmaengine, vinod.koul
  Cc: linux-arm-kernel, linux-samsung-soc, sbkim73, andi.shyti, javier,
	broonie, kgene, ckeepax, ym0914

On 11/05/2016 12:26 AM, Arnd Bergmann wrote:
> On Friday 04 November 2016, Sylwester Nawrocki wrote:
>> +       } else {
>> +               pl08x->slave.filter.map = pl08x->pd->slave_map;
>> +               pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len;
>>         }
> 
> I think you miss the setup of the filter function here.

Oops, indeed, there was little chance it could work without that part.

> Filtering by string in this driver is a bit awkward, so I wonder if we
> might want to go one step further here and pass the actual data (i.e. 
> struct pl08x_channel_data) rather than the string here.

Yeah, it didn't look to me terribly elegant too. Then a change as below?

--------------8<-------------------
diff --git a/arch/arm/mach-s3c64xx/pl080.c b/arch/arm/mach-s3c64xx/pl080.c
index 8c88680..556ce74 100644
--- a/arch/arm/mach-s3c64xx/pl080.c
+++ b/arch/arm/mach-s3c64xx/pl080.c
@@ -118,22 +118,22 @@ static void pl08x_put_xfer_signal(const struct
pl08x_channel_data *cd, int ch)
 };

 static const struct dma_slave_map s3c64xx_dma0_slave_map[] = {
-       { "s3c6400-uart.0", "tx", (void *)"uart0_tx" },
-       { "s3c6400-uart.0", "rx", (void *)"uart0_rx" },
-       { "s3c6400-uart.1", "tx", (void *)"uart1_tx" },
-       { "s3c6400-uart.1", "rx", (void *)"uart1_rx" },
-       { "s3c6400-uart.2", "tx", (void *)"uart2_tx" },
-       { "s3c6400-uart.2", "rx", (void *)"uart2_rx" },
-       { "s3c6400-uart.3", "tx", (void *)"uart3_tx" },
-       { "s3c6400-uart.3", "rx", (void *)"uart3_rx" },
-       { "samsung-pcm.0", "tx", (void *)"pcm0_tx" },
-       { "samsung-pcm.0", "rx", (void *)"pcm0_rx" },
-       { "samsung-i2s.0", "tx", (void *)"i2s0_tx" },
-       { "samsung-i2s.0", "rx", (void *)"i2s0_rx" },
-       { "s3c6410-spi.0", "tx", (void *)"spi0_tx" },
-       { "s3c6410-spi.0", "rx", (void *)"spi0_rx" },
-       { "samsung-i2s.2", "tx", (void *)"i2s2_tx" },
-       { "samsung-i2s.2", "rx", (void *)"i2s2_rx" },
+       { "s3c6400-uart.0", "tx", (void *)&s3c64xx_dma0_info[0] },
+       { "s3c6400-uart.0", "rx", (void *)&s3c64xx_dma0_info[1] },
+       { "s3c6400-uart.1", "tx", (void *)&s3c64xx_dma0_info[2] },
+       { "s3c6400-uart.1", "rx", (void *)&s3c64xx_dma0_info[3] },
+       { "s3c6400-uart.2", "tx", (void *)&s3c64xx_dma0_info[4] },
+       { "s3c6400-uart.2", "rx", (void *)&s3c64xx_dma0_info[5] },
+       { "s3c6400-uart.3", "tx", (void *)&s3c64xx_dma0_info[6] },
+       { "s3c6400-uart.3", "rx", (void *)&s3c64xx_dma0_info[7] },
+       { "samsung-pcm.0", "tx", (void *)&s3c64xx_dma0_info[8] },
+       { "samsung-pcm.0", "rx", (void *)&s3c64xx_dma0_info[9] },
+       { "samsung-i2s.0", "tx", (void *)&s3c64xx_dma0_info[10] },
+       { "samsung-i2s.0", "rx", (void *)&s3c64xx_dma0_info[11] },
+       { "s3c6410-spi.0", "tx", (void *)&s3c64xx_dma0_info[12] },
+       { "s3c6410-spi.0", "rx", (void *)&s3c64xx_dma0_info[13] },
+       { "samsung-i2s.2", "tx", (void *)&s3c64xx_dma0_info[14] },
+       { "samsung-i2s.2", "rx", (void *)&s3c64xx_dma0_info[15] },
 };

@@ -229,12 +229,12 @@ static AMBA_AHB_DEVICE(s3c64xx_dma0, "dma-pl080s.0", 0,
 };

 static const struct dma_slave_map s3c64xx_dma1_slave_map[] = {
-       { "samsung-pcm.1", "tx", (void *)"pcm1_tx" },
-       { "samsung-pcm.1", "rx", (void *)"pcm1_rx" },
-       { "samsung-i2s.1", "tx", (void *)"i2s1_tx" },
-       { "samsung-i2s.1", "rx", (void *)"i2s1_rx" },
-       { "s3c6410-spi.1", "tx", (void *)"spi1_tx" },
-       { "s3c6410-spi.1", "rx", (void *)"spi1_rx" },
+       { "samsung-pcm.1", "tx", (void *)&s3c64xx_dma1_info[0] },
+       { "samsung-pcm.1", "rx", (void *)&s3c64xx_dma1_info[1] },
+       { "samsung-i2s.1", "tx", (void *)&s3c64xx_dma1_info[2] },
+       { "samsung-i2s.1", "rx", (void *)&s3c64xx_dma1_info[3] },
+       { "s3c6410-spi.1", "tx", (void *)&s3c64xx_dma1_info[4] },
+       { "s3c6410-spi.1", "rx", (void *)&s3c64xx_dma1_info[5] },
 };

diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index d5c75c8..0d1eb2e 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -1793,6 +1793,23 @@ bool pl08x_filter_id(struct dma_chan *chan, void *chan_id)
 }
 EXPORT_SYMBOL_GPL(pl08x_filter_id);

+static bool pl08x_filter_fn(struct dma_chan *chan, void *chan_id)
+{
+       struct pl08x_dma_chan *plchan;
+
+       /* Reject channels for devices not bound to this driver */
+       if (chan->device->dev->driver != &pl08x_amba_driver.drv)
+               return false;
+
+       plchan = to_pl08x_chan(chan);
+
+       /* Check that the channel is not taken! */
+       if (plchan->cd == chan_id)
+               return true;
+
+       return false;
+}
+
 /*
  * Just check that the device is there and active
  * TODO: turn this bit on/off depending on the number of physical channels
@@ -2310,6 +2327,7 @@ static int pl08x_probe(struct amba_device *adev, const
struct amba_id *id)
        } else {
                pl08x->slave.filter.map = pl08x->pd->slave_map;
                pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len;
+               pl08x->slave.filter.fn = pl08x_filter_fn;
        }

        /* By default, AHB1 only.  If dualmaster, from platform */

-------------->8-------------------

-- 
Thanks,
Sylwester

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

* [PATCH RFC 1/7] dma: pl08x: Add support for the DMA slave map
@ 2016-11-07 15:41       ` Sylwester Nawrocki
  0 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-07 15:41 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/05/2016 12:26 AM, Arnd Bergmann wrote:
> On Friday 04 November 2016, Sylwester Nawrocki wrote:
>> +       } else {
>> +               pl08x->slave.filter.map = pl08x->pd->slave_map;
>> +               pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len;
>>         }
> 
> I think you miss the setup of the filter function here.

Oops, indeed, there was little chance it could work without that part.

> Filtering by string in this driver is a bit awkward, so I wonder if we
> might want to go one step further here and pass the actual data (i.e. 
> struct pl08x_channel_data) rather than the string here.

Yeah, it didn't look to me terribly elegant too. Then a change as below?

--------------8<-------------------
diff --git a/arch/arm/mach-s3c64xx/pl080.c b/arch/arm/mach-s3c64xx/pl080.c
index 8c88680..556ce74 100644
--- a/arch/arm/mach-s3c64xx/pl080.c
+++ b/arch/arm/mach-s3c64xx/pl080.c
@@ -118,22 +118,22 @@ static void pl08x_put_xfer_signal(const struct
pl08x_channel_data *cd, int ch)
 };

 static const struct dma_slave_map s3c64xx_dma0_slave_map[] = {
-       { "s3c6400-uart.0", "tx", (void *)"uart0_tx" },
-       { "s3c6400-uart.0", "rx", (void *)"uart0_rx" },
-       { "s3c6400-uart.1", "tx", (void *)"uart1_tx" },
-       { "s3c6400-uart.1", "rx", (void *)"uart1_rx" },
-       { "s3c6400-uart.2", "tx", (void *)"uart2_tx" },
-       { "s3c6400-uart.2", "rx", (void *)"uart2_rx" },
-       { "s3c6400-uart.3", "tx", (void *)"uart3_tx" },
-       { "s3c6400-uart.3", "rx", (void *)"uart3_rx" },
-       { "samsung-pcm.0", "tx", (void *)"pcm0_tx" },
-       { "samsung-pcm.0", "rx", (void *)"pcm0_rx" },
-       { "samsung-i2s.0", "tx", (void *)"i2s0_tx" },
-       { "samsung-i2s.0", "rx", (void *)"i2s0_rx" },
-       { "s3c6410-spi.0", "tx", (void *)"spi0_tx" },
-       { "s3c6410-spi.0", "rx", (void *)"spi0_rx" },
-       { "samsung-i2s.2", "tx", (void *)"i2s2_tx" },
-       { "samsung-i2s.2", "rx", (void *)"i2s2_rx" },
+       { "s3c6400-uart.0", "tx", (void *)&s3c64xx_dma0_info[0] },
+       { "s3c6400-uart.0", "rx", (void *)&s3c64xx_dma0_info[1] },
+       { "s3c6400-uart.1", "tx", (void *)&s3c64xx_dma0_info[2] },
+       { "s3c6400-uart.1", "rx", (void *)&s3c64xx_dma0_info[3] },
+       { "s3c6400-uart.2", "tx", (void *)&s3c64xx_dma0_info[4] },
+       { "s3c6400-uart.2", "rx", (void *)&s3c64xx_dma0_info[5] },
+       { "s3c6400-uart.3", "tx", (void *)&s3c64xx_dma0_info[6] },
+       { "s3c6400-uart.3", "rx", (void *)&s3c64xx_dma0_info[7] },
+       { "samsung-pcm.0", "tx", (void *)&s3c64xx_dma0_info[8] },
+       { "samsung-pcm.0", "rx", (void *)&s3c64xx_dma0_info[9] },
+       { "samsung-i2s.0", "tx", (void *)&s3c64xx_dma0_info[10] },
+       { "samsung-i2s.0", "rx", (void *)&s3c64xx_dma0_info[11] },
+       { "s3c6410-spi.0", "tx", (void *)&s3c64xx_dma0_info[12] },
+       { "s3c6410-spi.0", "rx", (void *)&s3c64xx_dma0_info[13] },
+       { "samsung-i2s.2", "tx", (void *)&s3c64xx_dma0_info[14] },
+       { "samsung-i2s.2", "rx", (void *)&s3c64xx_dma0_info[15] },
 };

@@ -229,12 +229,12 @@ static AMBA_AHB_DEVICE(s3c64xx_dma0, "dma-pl080s.0", 0,
 };

 static const struct dma_slave_map s3c64xx_dma1_slave_map[] = {
-       { "samsung-pcm.1", "tx", (void *)"pcm1_tx" },
-       { "samsung-pcm.1", "rx", (void *)"pcm1_rx" },
-       { "samsung-i2s.1", "tx", (void *)"i2s1_tx" },
-       { "samsung-i2s.1", "rx", (void *)"i2s1_rx" },
-       { "s3c6410-spi.1", "tx", (void *)"spi1_tx" },
-       { "s3c6410-spi.1", "rx", (void *)"spi1_rx" },
+       { "samsung-pcm.1", "tx", (void *)&s3c64xx_dma1_info[0] },
+       { "samsung-pcm.1", "rx", (void *)&s3c64xx_dma1_info[1] },
+       { "samsung-i2s.1", "tx", (void *)&s3c64xx_dma1_info[2] },
+       { "samsung-i2s.1", "rx", (void *)&s3c64xx_dma1_info[3] },
+       { "s3c6410-spi.1", "tx", (void *)&s3c64xx_dma1_info[4] },
+       { "s3c6410-spi.1", "rx", (void *)&s3c64xx_dma1_info[5] },
 };

diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index d5c75c8..0d1eb2e 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -1793,6 +1793,23 @@ bool pl08x_filter_id(struct dma_chan *chan, void *chan_id)
 }
 EXPORT_SYMBOL_GPL(pl08x_filter_id);

+static bool pl08x_filter_fn(struct dma_chan *chan, void *chan_id)
+{
+       struct pl08x_dma_chan *plchan;
+
+       /* Reject channels for devices not bound to this driver */
+       if (chan->device->dev->driver != &pl08x_amba_driver.drv)
+               return false;
+
+       plchan = to_pl08x_chan(chan);
+
+       /* Check that the channel is not taken! */
+       if (plchan->cd == chan_id)
+               return true;
+
+       return false;
+}
+
 /*
  * Just check that the device is there and active
  * TODO: turn this bit on/off depending on the number of physical channels
@@ -2310,6 +2327,7 @@ static int pl08x_probe(struct amba_device *adev, const
struct amba_id *id)
        } else {
                pl08x->slave.filter.map = pl08x->pd->slave_map;
                pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len;
+               pl08x->slave.filter.fn = pl08x_filter_fn;
        }

        /* By default, AHB1 only.  If dualmaster, from platform */

-------------->8-------------------

-- 
Thanks,
Sylwester

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

* Re: [PATCH RFC 4/7] ASoC: samsung: i2s: Do not use platform_data for DMA parameters
  2016-11-04 23:29     ` Arnd Bergmann
@ 2016-11-07 16:02       ` Sylwester Nawrocki
  -1 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-07 16:02 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-samsung-soc, linux-arm-kernel, dmaengine, vinod.koul,
	broonie, ckeepax, ym0914, kgene, javier, andi.shyti, sbkim73

On 11/05/2016 12:29 AM, Arnd Bergmann wrote:
> On Friday 04 November 2016, Sylwester Nawrocki wrote:
>> > -       ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter,
>> > +       ret = samsung_asoc_dma_platform_register(&pdev->dev, NULL,
>> >                                                  NULL, NULL);
>
> If we remove the filter argument from every caller here, maybe we should also
> change the prototype to not expect those three NULL arguments any more.

There is one occurrence where the third argument needs to be not NULL.
I'm planning to modify sound/sound/samsung/i2s.c so there is no need
to create another platform device just for the overlay DAI, afterwards
the above function could be simplified.

-- 
Thanks,
Sylwester

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

* [PATCH RFC 4/7] ASoC: samsung: i2s: Do not use platform_data for DMA parameters
@ 2016-11-07 16:02       ` Sylwester Nawrocki
  0 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-07 16:02 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/05/2016 12:29 AM, Arnd Bergmann wrote:
> On Friday 04 November 2016, Sylwester Nawrocki wrote:
>> > -       ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter,
>> > +       ret = samsung_asoc_dma_platform_register(&pdev->dev, NULL,
>> >                                                  NULL, NULL);
>
> If we remove the filter argument from every caller here, maybe we should also
> change the prototype to not expect those three NULL arguments any more.

There is one occurrence where the third argument needs to be not NULL.
I'm planning to modify sound/sound/samsung/i2s.c so there is no need
to create another platform device just for the overlay DAI, afterwards
the above function could be simplified.

-- 
Thanks,
Sylwester

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

* Re: [PATCH RFC 1/7] dma: pl08x: Add support for the DMA slave map
  2016-11-07 15:41       ` Sylwester Nawrocki
@ 2016-11-07 19:55         ` Arnd Bergmann
  -1 siblings, 0 replies; 56+ messages in thread
From: Arnd Bergmann @ 2016-11-07 19:55 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: dmaengine, vinod.koul, linux-arm-kernel, linux-samsung-soc,
	sbkim73, andi.shyti, javier, broonie, kgene, ckeepax, ym0914

On Monday, November 7, 2016 4:41:58 PM CET Sylwester Nawrocki wrote:
> On 11/05/2016 12:26 AM, Arnd Bergmann wrote:

> 
>  static const struct dma_slave_map s3c64xx_dma1_slave_map[] = {
> -       { "samsung-pcm.1", "tx", (void *)"pcm1_tx" },
> -       { "samsung-pcm.1", "rx", (void *)"pcm1_rx" },
> -       { "samsung-i2s.1", "tx", (void *)"i2s1_tx" },
> -       { "samsung-i2s.1", "rx", (void *)"i2s1_rx" },
> -       { "s3c6410-spi.1", "tx", (void *)"spi1_tx" },
> -       { "s3c6410-spi.1", "rx", (void *)"spi1_rx" },
> +       { "samsung-pcm.1", "tx", (void *)&s3c64xx_dma1_info[0] },
> +       { "samsung-pcm.1", "rx", (void *)&s3c64xx_dma1_info[1] },
> +       { "samsung-i2s.1", "tx", (void *)&s3c64xx_dma1_info[2] },
> +       { "samsung-i2s.1", "rx", (void *)&s3c64xx_dma1_info[3] },
> +       { "s3c6410-spi.1", "tx", (void *)&s3c64xx_dma1_info[4] },
> +       { "s3c6410-spi.1", "rx", (void *)&s3c64xx_dma1_info[5] },
>  };
> 

I think you can drop the (void*) cast either way (before and after
this change).

> diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
> index d5c75c8..0d1eb2e 100644
> --- a/drivers/dma/amba-pl08x.c
> +++ b/drivers/dma/amba-pl08x.c
> @@ -1793,6 +1793,23 @@ bool pl08x_filter_id(struct dma_chan *chan, void *chan_id)
>  }
>  EXPORT_SYMBOL_GPL(pl08x_filter_id);
> 
> +static bool pl08x_filter_fn(struct dma_chan *chan, void *chan_id)
> +{
> +       struct pl08x_dma_chan *plchan;
> +
> +       /* Reject channels for devices not bound to this driver */
> +       if (chan->device->dev->driver != &pl08x_amba_driver.drv)
> +               return false;

This check should not be needed, you only get channels for the
device itself.

> +       plchan = to_pl08x_chan(chan);
> +
> +       /* Check that the channel is not taken! */
> +       if (plchan->cd == chan_id)
> +               return true;


What I had in mind was a bit different: Instead of comparing the
channel, I was thinking of modifying the channel itself, something
like:

	plchan->signal = chan_id->signal;
	plchan->periph_buses = chan_id->periph_buses;

after that, remove the plchan->cd data. Unfortunately, the muxing in
arch/arm/mach-spear/ makes this a bit harder. I'd have to think
about it some more. It may be easier to do this after moving
spear and lpc32xx over to use dma_slave_map.

	Arnd

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

* [PATCH RFC 1/7] dma: pl08x: Add support for the DMA slave map
@ 2016-11-07 19:55         ` Arnd Bergmann
  0 siblings, 0 replies; 56+ messages in thread
From: Arnd Bergmann @ 2016-11-07 19:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, November 7, 2016 4:41:58 PM CET Sylwester Nawrocki wrote:
> On 11/05/2016 12:26 AM, Arnd Bergmann wrote:

> 
>  static const struct dma_slave_map s3c64xx_dma1_slave_map[] = {
> -       { "samsung-pcm.1", "tx", (void *)"pcm1_tx" },
> -       { "samsung-pcm.1", "rx", (void *)"pcm1_rx" },
> -       { "samsung-i2s.1", "tx", (void *)"i2s1_tx" },
> -       { "samsung-i2s.1", "rx", (void *)"i2s1_rx" },
> -       { "s3c6410-spi.1", "tx", (void *)"spi1_tx" },
> -       { "s3c6410-spi.1", "rx", (void *)"spi1_rx" },
> +       { "samsung-pcm.1", "tx", (void *)&s3c64xx_dma1_info[0] },
> +       { "samsung-pcm.1", "rx", (void *)&s3c64xx_dma1_info[1] },
> +       { "samsung-i2s.1", "tx", (void *)&s3c64xx_dma1_info[2] },
> +       { "samsung-i2s.1", "rx", (void *)&s3c64xx_dma1_info[3] },
> +       { "s3c6410-spi.1", "tx", (void *)&s3c64xx_dma1_info[4] },
> +       { "s3c6410-spi.1", "rx", (void *)&s3c64xx_dma1_info[5] },
>  };
> 

I think you can drop the (void*) cast either way (before and after
this change).

> diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
> index d5c75c8..0d1eb2e 100644
> --- a/drivers/dma/amba-pl08x.c
> +++ b/drivers/dma/amba-pl08x.c
> @@ -1793,6 +1793,23 @@ bool pl08x_filter_id(struct dma_chan *chan, void *chan_id)
>  }
>  EXPORT_SYMBOL_GPL(pl08x_filter_id);
> 
> +static bool pl08x_filter_fn(struct dma_chan *chan, void *chan_id)
> +{
> +       struct pl08x_dma_chan *plchan;
> +
> +       /* Reject channels for devices not bound to this driver */
> +       if (chan->device->dev->driver != &pl08x_amba_driver.drv)
> +               return false;

This check should not be needed, you only get channels for the
device itself.

> +       plchan = to_pl08x_chan(chan);
> +
> +       /* Check that the channel is not taken! */
> +       if (plchan->cd == chan_id)
> +               return true;


What I had in mind was a bit different: Instead of comparing the
channel, I was thinking of modifying the channel itself, something
like:

	plchan->signal = chan_id->signal;
	plchan->periph_buses = chan_id->periph_buses;

after that, remove the plchan->cd data. Unfortunately, the muxing in
arch/arm/mach-spear/ makes this a bit harder. I'd have to think
about it some more. It may be easier to do this after moving
spear and lpc32xx over to use dma_slave_map.

	Arnd

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

* Re: [PATCH RFC 4/7] ASoC: samsung: i2s: Do not use platform_data for DMA parameters
  2016-11-07 16:02       ` Sylwester Nawrocki
@ 2016-11-07 21:14         ` Arnd Bergmann
  -1 siblings, 0 replies; 56+ messages in thread
From: Arnd Bergmann @ 2016-11-07 21:14 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Sylwester Nawrocki, linux-samsung-soc, vinod.koul, sbkim73,
	andi.shyti, javier, broonie, kgene, dmaengine, ckeepax, ym0914

On Monday, November 7, 2016 5:02:54 PM CET Sylwester Nawrocki wrote:
> On 11/05/2016 12:29 AM, Arnd Bergmann wrote:
> > On Friday 04 November 2016, Sylwester Nawrocki wrote:
> >> > -       ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter,
> >> > +       ret = samsung_asoc_dma_platform_register(&pdev->dev, NULL,
> >> >                                                  NULL, NULL);
> >
> > If we remove the filter argument from every caller here, maybe we should also
> > change the prototype to not expect those three NULL arguments any more.
> 
> There is one occurrence where the third argument needs to be not NULL.
> I'm planning to modify sound/sound/samsung/i2s.c so there is no need
> to create another platform device just for the overlay DAI, afterwards
> the above function could be simplified.

Ok, sounds good.

	Arnd

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

* [PATCH RFC 4/7] ASoC: samsung: i2s: Do not use platform_data for DMA parameters
@ 2016-11-07 21:14         ` Arnd Bergmann
  0 siblings, 0 replies; 56+ messages in thread
From: Arnd Bergmann @ 2016-11-07 21:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, November 7, 2016 5:02:54 PM CET Sylwester Nawrocki wrote:
> On 11/05/2016 12:29 AM, Arnd Bergmann wrote:
> > On Friday 04 November 2016, Sylwester Nawrocki wrote:
> >> > -       ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter,
> >> > +       ret = samsung_asoc_dma_platform_register(&pdev->dev, NULL,
> >> >                                                  NULL, NULL);
> >
> > If we remove the filter argument from every caller here, maybe we should also
> > change the prototype to not expect those three NULL arguments any more.
> 
> There is one occurrence where the third argument needs to be not NULL.
> I'm planning to modify sound/sound/samsung/i2s.c so there is no need
> to create another platform device just for the overlay DAI, afterwards
> the above function could be simplified.

Ok, sounds good.

	Arnd

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

* Re: [PATCH RFC 2/7] ARM: S3C64XX: Add DMA slave maps for PL080 devices
  2016-11-04 16:14   ` Sylwester Nawrocki
@ 2016-11-08 14:44     ` Charles Keepax
  -1 siblings, 0 replies; 56+ messages in thread
From: Charles Keepax @ 2016-11-08 14:44 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, arnd, vinod.koul, sbkim73, andi.shyti, javier,
	broonie, kgene, dmaengine, linux-arm-kernel, ym0914

On Fri, Nov 04, 2016 at 05:14:49PM +0100, Sylwester Nawrocki wrote:
> This patch adds DMA slave map tables to the pl080 devices's
> platform_data in order to support the new channel request API.
> A few devices for which there was no DMA support with current
> code are omitted from the tables.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---
>  arch/arm/mach-s3c64xx/pl080.c | 32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/arch/arm/mach-s3c64xx/pl080.c b/arch/arm/mach-s3c64xx/pl080.c
> index 89c5a62..8c88680 100644
> --- a/arch/arm/mach-s3c64xx/pl080.c
> +++ b/arch/arm/mach-s3c64xx/pl080.c
<snip>
> @@ -134,6 +153,8 @@ struct pl08x_platform_data s3c64xx_dma0_plat_data = {
>  	.put_xfer_signal = pl08x_put_xfer_signal,
>  	.slave_channels = s3c64xx_dma0_info,
>  	.num_slave_channels = ARRAY_SIZE(s3c64xx_dma0_info),
> +	.slave_map = s3c64xx_dma0_slave_map,
> +	.slavecnt = ARRAY_SIZE(s3c64xx_dma0_slave_map),
>  };

Here we add a .slavecnt but the pl08x_platform_data structure doesn't
contain that field. I can't see it on the branch you linked in
the cover letter either, is it added by a patch on another branch
I am missing?

> @@ -224,6 +254,8 @@ struct pl08x_platform_data s3c64xx_dma1_plat_data = {
>  	.put_xfer_signal = pl08x_put_xfer_signal,
>  	.slave_channels = s3c64xx_dma1_info,
>  	.num_slave_channels = ARRAY_SIZE(s3c64xx_dma1_info),
> +	.slave_map = s3c64xx_dma1_slave_map,
> +	.slavecnt = ARRAY_SIZE(s3c64xx_dma1_slave_map),
>  };

ditto.

Thanks,
Charles

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

* [PATCH RFC 2/7] ARM: S3C64XX: Add DMA slave maps for PL080 devices
@ 2016-11-08 14:44     ` Charles Keepax
  0 siblings, 0 replies; 56+ messages in thread
From: Charles Keepax @ 2016-11-08 14:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 04, 2016 at 05:14:49PM +0100, Sylwester Nawrocki wrote:
> This patch adds DMA slave map tables to the pl080 devices's
> platform_data in order to support the new channel request API.
> A few devices for which there was no DMA support with current
> code are omitted from the tables.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---
>  arch/arm/mach-s3c64xx/pl080.c | 32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/arch/arm/mach-s3c64xx/pl080.c b/arch/arm/mach-s3c64xx/pl080.c
> index 89c5a62..8c88680 100644
> --- a/arch/arm/mach-s3c64xx/pl080.c
> +++ b/arch/arm/mach-s3c64xx/pl080.c
<snip>
> @@ -134,6 +153,8 @@ struct pl08x_platform_data s3c64xx_dma0_plat_data = {
>  	.put_xfer_signal = pl08x_put_xfer_signal,
>  	.slave_channels = s3c64xx_dma0_info,
>  	.num_slave_channels = ARRAY_SIZE(s3c64xx_dma0_info),
> +	.slave_map = s3c64xx_dma0_slave_map,
> +	.slavecnt = ARRAY_SIZE(s3c64xx_dma0_slave_map),
>  };

Here we add a .slavecnt but the pl08x_platform_data structure doesn't
contain that field. I can't see it on the branch you linked in
the cover letter either, is it added by a patch on another branch
I am missing?

> @@ -224,6 +254,8 @@ struct pl08x_platform_data s3c64xx_dma1_plat_data = {
>  	.put_xfer_signal = pl08x_put_xfer_signal,
>  	.slave_channels = s3c64xx_dma1_info,
>  	.num_slave_channels = ARRAY_SIZE(s3c64xx_dma1_info),
> +	.slave_map = s3c64xx_dma1_slave_map,
> +	.slavecnt = ARRAY_SIZE(s3c64xx_dma1_slave_map),
>  };

ditto.

Thanks,
Charles

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

* Re: [PATCH RFC 2/7] ARM: S3C64XX: Add DMA slave maps for PL080 devices
  2016-11-08 14:44     ` Charles Keepax
@ 2016-11-08 14:55       ` Charles Keepax
  -1 siblings, 0 replies; 56+ messages in thread
From: Charles Keepax @ 2016-11-08 14:55 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, linux-arm-kernel, dmaengine, vinod.koul,
	broonie, ym0914, arnd, kgene, javier, andi.shyti, sbkim73

On Tue, Nov 08, 2016 at 02:44:45PM +0000, Charles Keepax wrote:
> On Fri, Nov 04, 2016 at 05:14:49PM +0100, Sylwester Nawrocki wrote:
> > This patch adds DMA slave map tables to the pl080 devices's
> > platform_data in order to support the new channel request API.
> > A few devices for which there was no DMA support with current
> > code are omitted from the tables.
> > 
> > Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> > ---
> >  arch/arm/mach-s3c64xx/pl080.c | 32 ++++++++++++++++++++++++++++++++
> >  1 file changed, 32 insertions(+)
> > 
> > diff --git a/arch/arm/mach-s3c64xx/pl080.c b/arch/arm/mach-s3c64xx/pl080.c
> > index 89c5a62..8c88680 100644
> > --- a/arch/arm/mach-s3c64xx/pl080.c
> > +++ b/arch/arm/mach-s3c64xx/pl080.c
> <snip>
> > @@ -134,6 +153,8 @@ struct pl08x_platform_data s3c64xx_dma0_plat_data = {
> >  	.put_xfer_signal = pl08x_put_xfer_signal,
> >  	.slave_channels = s3c64xx_dma0_info,
> >  	.num_slave_channels = ARRAY_SIZE(s3c64xx_dma0_info),
> > +	.slave_map = s3c64xx_dma0_slave_map,
> > +	.slavecnt = ARRAY_SIZE(s3c64xx_dma0_slave_map),
> >  };
> 
> Here we add a .slavecnt but the pl08x_platform_data structure doesn't
> contain that field. I can't see it on the branch you linked in
> the cover letter either, is it added by a patch on another branch
> I am missing?
> 

Ah I think I see it should be .slave_map_len here.

Thanks,
Charles

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

* [PATCH RFC 2/7] ARM: S3C64XX: Add DMA slave maps for PL080 devices
@ 2016-11-08 14:55       ` Charles Keepax
  0 siblings, 0 replies; 56+ messages in thread
From: Charles Keepax @ 2016-11-08 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 08, 2016 at 02:44:45PM +0000, Charles Keepax wrote:
> On Fri, Nov 04, 2016 at 05:14:49PM +0100, Sylwester Nawrocki wrote:
> > This patch adds DMA slave map tables to the pl080 devices's
> > platform_data in order to support the new channel request API.
> > A few devices for which there was no DMA support with current
> > code are omitted from the tables.
> > 
> > Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> > ---
> >  arch/arm/mach-s3c64xx/pl080.c | 32 ++++++++++++++++++++++++++++++++
> >  1 file changed, 32 insertions(+)
> > 
> > diff --git a/arch/arm/mach-s3c64xx/pl080.c b/arch/arm/mach-s3c64xx/pl080.c
> > index 89c5a62..8c88680 100644
> > --- a/arch/arm/mach-s3c64xx/pl080.c
> > +++ b/arch/arm/mach-s3c64xx/pl080.c
> <snip>
> > @@ -134,6 +153,8 @@ struct pl08x_platform_data s3c64xx_dma0_plat_data = {
> >  	.put_xfer_signal = pl08x_put_xfer_signal,
> >  	.slave_channels = s3c64xx_dma0_info,
> >  	.num_slave_channels = ARRAY_SIZE(s3c64xx_dma0_info),
> > +	.slave_map = s3c64xx_dma0_slave_map,
> > +	.slavecnt = ARRAY_SIZE(s3c64xx_dma0_slave_map),
> >  };
> 
> Here we add a .slavecnt but the pl08x_platform_data structure doesn't
> contain that field. I can't see it on the branch you linked in
> the cover letter either, is it added by a patch on another branch
> I am missing?
> 

Ah I think I see it should be .slave_map_len here.

Thanks,
Charles

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

* Re: [PATCH RFC 0/7] DMA: S3C64XX: Conversion to the new channel request API
  2016-11-04 16:14   ` Sylwester Nawrocki
@ 2016-11-08 15:39     ` Charles Keepax
  -1 siblings, 0 replies; 56+ messages in thread
From: Charles Keepax @ 2016-11-08 15:39 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, linux-arm-kernel, dmaengine, vinod.koul,
	broonie, ym0914, arnd, kgene, javier, andi.shyti, sbkim73

On Fri, Nov 04, 2016 at 05:14:47PM +0100, Sylwester Nawrocki wrote:
> This patch series aims to convert the s3c64xx platform to use
> the new universal DMA channel request API, i.e. this is only
> meaningful for non-dt systems using s3c64xx SoCs.
> 
> I'm sending the whole series as RFC since I didn't test it
> yet, I'm going to prepare smd6410 for testing this series.
> It would be great if someone else could also test it,
> either SPI or sound functionality verification would be 
> useful.
> 
> Then we could queue the first two patches in this series
> for v4.10-rc1 and the remaining patches for subsequent
> release.
> 
> The whole series can be pulled from git repository:
>  git://linuxtv.org/snawrocki/samsung.git 
>  branch: for-v4.10/dma/pl080-s3c64xx
> 
> Thanks.
> 
> Sylwester Nawrocki (7):
>   dma: pl08x: Add support for the DMA slave map
>   ARM: S3C64XX: Add DMA slave maps for PL080 devices
>   spi: s3c64xx: Do not use platform_data for DMA parameters
>   ASoC: samsung: i2s: Do not use platform_data for DMA parameters
>   ASoC: samsung: pcm: Do not use platform_data for DMA parameters
>   ARM: S3C64XX: Drop unused DMA fields from struct s3c64xx_spi_csinfo
>   ARM: S3C64XX: Drop initialization of unused struct s3c_audio_pdata
>     fields
> 

Hmm... fixing the bug I mentioned in my other email this still
seems to cause some problems with my SPI on Cragganmore:

[  200.210213] wm0010 spi0.0: I/O Error: rx-1 tx-1 res:rx-f tx-f len-2632
[  200.211275] wm0010 spi0.0: SPI transfer failed: -5

I am still looking into it, without your patches work the wm0010
comes up. A few other small things seem to have been broken in
mainline since last time I fired up this board as well which is
slowing me down a little (network seems to have stopped coming
up and one of the regulators on the SD card is spamming me with
warnings).

Thanks,
Charles

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

* [PATCH RFC 0/7] DMA: S3C64XX: Conversion to the new channel request API
@ 2016-11-08 15:39     ` Charles Keepax
  0 siblings, 0 replies; 56+ messages in thread
From: Charles Keepax @ 2016-11-08 15:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 04, 2016 at 05:14:47PM +0100, Sylwester Nawrocki wrote:
> This patch series aims to convert the s3c64xx platform to use
> the new universal DMA channel request API, i.e. this is only
> meaningful for non-dt systems using s3c64xx SoCs.
> 
> I'm sending the whole series as RFC since I didn't test it
> yet, I'm going to prepare smd6410 for testing this series.
> It would be great if someone else could also test it,
> either SPI or sound functionality verification would be 
> useful.
> 
> Then we could queue the first two patches in this series
> for v4.10-rc1 and the remaining patches for subsequent
> release.
> 
> The whole series can be pulled from git repository:
>  git://linuxtv.org/snawrocki/samsung.git 
>  branch: for-v4.10/dma/pl080-s3c64xx
> 
> Thanks.
> 
> Sylwester Nawrocki (7):
>   dma: pl08x: Add support for the DMA slave map
>   ARM: S3C64XX: Add DMA slave maps for PL080 devices
>   spi: s3c64xx: Do not use platform_data for DMA parameters
>   ASoC: samsung: i2s: Do not use platform_data for DMA parameters
>   ASoC: samsung: pcm: Do not use platform_data for DMA parameters
>   ARM: S3C64XX: Drop unused DMA fields from struct s3c64xx_spi_csinfo
>   ARM: S3C64XX: Drop initialization of unused struct s3c_audio_pdata
>     fields
> 

Hmm... fixing the bug I mentioned in my other email this still
seems to cause some problems with my SPI on Cragganmore:

[  200.210213] wm0010 spi0.0: I/O Error: rx-1 tx-1 res:rx-f tx-f len-2632
[  200.211275] wm0010 spi0.0: SPI transfer failed: -5

I am still looking into it, without your patches work the wm0010
comes up. A few other small things seem to have been broken in
mainline since last time I fired up this board as well which is
slowing me down a little (network seems to have stopped coming
up and one of the regulators on the SD card is spamming me with
warnings).

Thanks,
Charles

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

* Re: [PATCH RFC 2/7] ARM: S3C64XX: Add DMA slave maps for PL080 devices
  2016-11-08 14:55       ` Charles Keepax
@ 2016-11-08 15:53         ` Sylwester Nawrocki
  -1 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-08 15:53 UTC (permalink / raw)
  To: Charles Keepax
  Cc: linux-samsung-soc, linux-arm-kernel, dmaengine, vinod.koul,
	broonie, ym0914, arnd, kgene, javier, andi.shyti, sbkim73

On 11/08/2016 03:55 PM, Charles Keepax wrote:
>>> diff --git a/arch/arm/mach-s3c64xx/pl080.c b/arch/arm/mach-s3c64xx/pl080.c
>>> > > index 89c5a62..8c88680 100644
>>> > > --- a/arch/arm/mach-s3c64xx/pl080.c
>>> > > +++ b/arch/arm/mach-s3c64xx/pl080.c
>> > <snip>
>>> > > @@ -134,6 +153,8 @@ struct pl08x_platform_data s3c64xx_dma0_plat_data = {
>>> > >  	.put_xfer_signal = pl08x_put_xfer_signal,
>>> > >  	.slave_channels = s3c64xx_dma0_info,
>>> > >  	.num_slave_channels = ARRAY_SIZE(s3c64xx_dma0_info),
>>> > > +	.slave_map = s3c64xx_dma0_slave_map,
>>> > > +	.slavecnt = ARRAY_SIZE(s3c64xx_dma0_slave_map),
>>> > >  };
>> > 
>> > Here we add a .slavecnt but the pl08x_platform_data structure doesn't
>> > contain that field. I can't see it on the branch you linked in
>> > the cover letter either, is it added by a patch on another branch
>> > I am missing?
>> > 
> Ah I think I see it should be .slave_map_len here.

Yeah, sorry, I fixed it after getting report from the kbuild test
but have forgotten to push changes to the git tree.

I pushed now to branch for-v4.10/dma/pl080-s3c64xx-v2 with this
issue fixed and added initialization of the filer function.

-------------------8<-------------------------
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 939a7c3..d441c4b 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -2307,6 +2307,10 @@ static int pl08x_probe(struct amba_device *adev, const
struct amba_id *id)
                        ret = -EINVAL;
                        goto out_no_platdata;
                }
+       } else {
+               pl08x->slave.filter.map = pl08x->pd->slave_map;
+               pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len;
+               pl08x->slave.filter.fn = pl08x_filter_id;
        }
-------------------8<-------------------------

--
Thanks,
Sylwester

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

* [PATCH RFC 2/7] ARM: S3C64XX: Add DMA slave maps for PL080 devices
@ 2016-11-08 15:53         ` Sylwester Nawrocki
  0 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-08 15:53 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/08/2016 03:55 PM, Charles Keepax wrote:
>>> diff --git a/arch/arm/mach-s3c64xx/pl080.c b/arch/arm/mach-s3c64xx/pl080.c
>>> > > index 89c5a62..8c88680 100644
>>> > > --- a/arch/arm/mach-s3c64xx/pl080.c
>>> > > +++ b/arch/arm/mach-s3c64xx/pl080.c
>> > <snip>
>>> > > @@ -134,6 +153,8 @@ struct pl08x_platform_data s3c64xx_dma0_plat_data = {
>>> > >  	.put_xfer_signal = pl08x_put_xfer_signal,
>>> > >  	.slave_channels = s3c64xx_dma0_info,
>>> > >  	.num_slave_channels = ARRAY_SIZE(s3c64xx_dma0_info),
>>> > > +	.slave_map = s3c64xx_dma0_slave_map,
>>> > > +	.slavecnt = ARRAY_SIZE(s3c64xx_dma0_slave_map),
>>> > >  };
>> > 
>> > Here we add a .slavecnt but the pl08x_platform_data structure doesn't
>> > contain that field. I can't see it on the branch you linked in
>> > the cover letter either, is it added by a patch on another branch
>> > I am missing?
>> > 
> Ah I think I see it should be .slave_map_len here.

Yeah, sorry, I fixed it after getting report from the kbuild test
but have forgotten to push changes to the git tree.

I pushed now to branch for-v4.10/dma/pl080-s3c64xx-v2 with this
issue fixed and added initialization of the filer function.

-------------------8<-------------------------
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 939a7c3..d441c4b 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -2307,6 +2307,10 @@ static int pl08x_probe(struct amba_device *adev, const
struct amba_id *id)
                        ret = -EINVAL;
                        goto out_no_platdata;
                }
+       } else {
+               pl08x->slave.filter.map = pl08x->pd->slave_map;
+               pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len;
+               pl08x->slave.filter.fn = pl08x_filter_id;
        }
-------------------8<-------------------------

--
Thanks,
Sylwester

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

* Re: [PATCH RFC 0/7] DMA: S3C64XX: Conversion to the new channel request API
  2016-11-08 15:39     ` Charles Keepax
@ 2016-11-08 16:02       ` Sylwester Nawrocki
  -1 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-08 16:02 UTC (permalink / raw)
  To: Charles Keepax
  Cc: linux-samsung-soc, linux-arm-kernel, dmaengine, vinod.koul,
	broonie, ym0914, arnd, kgene, javier, andi.shyti, sbkim73

On 11/08/2016 04:39 PM, Charles Keepax wrote:
> Hmm... fixing the bug I mentioned in my other email this still
> seems to cause some problems with my SPI on Cragganmore:
> 
> [  200.210213] wm0010 spi0.0: I/O Error: rx-1 tx-1 res:rx-f tx-f len-2632
> [  200.211275] wm0010 spi0.0: SPI transfer failed: -5
> 
> I am still looking into it, without your patches work the wm0010
> comes up. A few other small things seem to have been broken in
> mainline since last time I fired up this board as well which is
> slowing me down a little (network seems to have stopped coming
> up and one of the regulators on the SD card is spamming me with
> warnings).

Thanks for giving it a try.  Is it any better with a change as below?

diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index d5c75c8..d441c4b 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -2310,6 +2310,7 @@ static int pl08x_probe(struct amba_device *adev, const
struct amba_id *id)
        } else {
                pl08x->slave.filter.map = pl08x->pd->slave_map;
                pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len;
+               pl08x->slave.filter.fn = pl08x_filter_id;
        }

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

* [PATCH RFC 0/7] DMA: S3C64XX: Conversion to the new channel request API
@ 2016-11-08 16:02       ` Sylwester Nawrocki
  0 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-08 16:02 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/08/2016 04:39 PM, Charles Keepax wrote:
> Hmm... fixing the bug I mentioned in my other email this still
> seems to cause some problems with my SPI on Cragganmore:
> 
> [  200.210213] wm0010 spi0.0: I/O Error: rx-1 tx-1 res:rx-f tx-f len-2632
> [  200.211275] wm0010 spi0.0: SPI transfer failed: -5
> 
> I am still looking into it, without your patches work the wm0010
> comes up. A few other small things seem to have been broken in
> mainline since last time I fired up this board as well which is
> slowing me down a little (network seems to have stopped coming
> up and one of the regulators on the SD card is spamming me with
> warnings).

Thanks for giving it a try.  Is it any better with a change as below?

diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index d5c75c8..d441c4b 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -2310,6 +2310,7 @@ static int pl08x_probe(struct amba_device *adev, const
struct amba_id *id)
        } else {
                pl08x->slave.filter.map = pl08x->pd->slave_map;
                pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len;
+               pl08x->slave.filter.fn = pl08x_filter_id;
        }

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

* Re: [PATCH RFC 2/7] ARM: S3C64XX: Add DMA slave maps for PL080 devices
  2016-11-08 15:53         ` Sylwester Nawrocki
@ 2016-11-10 11:03           ` Charles Keepax
  -1 siblings, 0 replies; 56+ messages in thread
From: Charles Keepax @ 2016-11-10 11:03 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, linux-arm-kernel, dmaengine, vinod.koul,
	broonie, ym0914, arnd, kgene, javier, andi.shyti, sbkim73

On Tue, Nov 08, 2016 at 04:53:40PM +0100, Sylwester Nawrocki wrote:
> On 11/08/2016 03:55 PM, Charles Keepax wrote:
> >>> diff --git a/arch/arm/mach-s3c64xx/pl080.c b/arch/arm/mach-s3c64xx/pl080.c
> >>> > > index 89c5a62..8c88680 100644
> >>> > > --- a/arch/arm/mach-s3c64xx/pl080.c
> >>> > > +++ b/arch/arm/mach-s3c64xx/pl080.c
> >> > <snip>
> >>> > > @@ -134,6 +153,8 @@ struct pl08x_platform_data s3c64xx_dma0_plat_data = {
> >>> > >  	.put_xfer_signal = pl08x_put_xfer_signal,
> >>> > >  	.slave_channels = s3c64xx_dma0_info,
> >>> > >  	.num_slave_channels = ARRAY_SIZE(s3c64xx_dma0_info),
> >>> > > +	.slave_map = s3c64xx_dma0_slave_map,
> >>> > > +	.slavecnt = ARRAY_SIZE(s3c64xx_dma0_slave_map),
> >>> > >  };
> >> > 
> >> > Here we add a .slavecnt but the pl08x_platform_data structure doesn't
> >> > contain that field. I can't see it on the branch you linked in
> >> > the cover letter either, is it added by a patch on another branch
> >> > I am missing?
> >> > 
> > Ah I think I see it should be .slave_map_len here.
> 
> Yeah, sorry, I fixed it after getting report from the kbuild test
> but have forgotten to push changes to the git tree.
> 
> I pushed now to branch for-v4.10/dma/pl080-s3c64xx-v2 with this
> issue fixed and added initialization of the filer function.

Apologies for the delay got somewhat swamped with internal stuff
yesterday. Yeah using that branch it looks good to me, the SPI and
I2S are both working fine. I can download code to the wm0010
which should be a good work out of the SPI and play audio
correctly so the I2S should be fine. So for the series:

Tested-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>


I do still need to revert these two patches to get the I2S to
work properly:

commit d70e861a3154833467023123e218e9b1ba558809
ASoC: samsung: Remove SND_DMAENGINE_PCM_FLAG_NO_RESIDUE flag

commit acde50a7bf1fd6ae0baa4402f0a02c4b1bd4c990
ASoC: dmaengine_pcm: Make FLAG_NO_RESIDUE internal

But that is clearly an unrelated issue, which I haven't found
time to look into yet as we don't use this platform that often
these days.

Thanks,
Charles

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

* [PATCH RFC 2/7] ARM: S3C64XX: Add DMA slave maps for PL080 devices
@ 2016-11-10 11:03           ` Charles Keepax
  0 siblings, 0 replies; 56+ messages in thread
From: Charles Keepax @ 2016-11-10 11:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 08, 2016 at 04:53:40PM +0100, Sylwester Nawrocki wrote:
> On 11/08/2016 03:55 PM, Charles Keepax wrote:
> >>> diff --git a/arch/arm/mach-s3c64xx/pl080.c b/arch/arm/mach-s3c64xx/pl080.c
> >>> > > index 89c5a62..8c88680 100644
> >>> > > --- a/arch/arm/mach-s3c64xx/pl080.c
> >>> > > +++ b/arch/arm/mach-s3c64xx/pl080.c
> >> > <snip>
> >>> > > @@ -134,6 +153,8 @@ struct pl08x_platform_data s3c64xx_dma0_plat_data = {
> >>> > >  	.put_xfer_signal = pl08x_put_xfer_signal,
> >>> > >  	.slave_channels = s3c64xx_dma0_info,
> >>> > >  	.num_slave_channels = ARRAY_SIZE(s3c64xx_dma0_info),
> >>> > > +	.slave_map = s3c64xx_dma0_slave_map,
> >>> > > +	.slavecnt = ARRAY_SIZE(s3c64xx_dma0_slave_map),
> >>> > >  };
> >> > 
> >> > Here we add a .slavecnt but the pl08x_platform_data structure doesn't
> >> > contain that field. I can't see it on the branch you linked in
> >> > the cover letter either, is it added by a patch on another branch
> >> > I am missing?
> >> > 
> > Ah I think I see it should be .slave_map_len here.
> 
> Yeah, sorry, I fixed it after getting report from the kbuild test
> but have forgotten to push changes to the git tree.
> 
> I pushed now to branch for-v4.10/dma/pl080-s3c64xx-v2 with this
> issue fixed and added initialization of the filer function.

Apologies for the delay got somewhat swamped with internal stuff
yesterday. Yeah using that branch it looks good to me, the SPI and
I2S are both working fine. I can download code to the wm0010
which should be a good work out of the SPI and play audio
correctly so the I2S should be fine. So for the series:

Tested-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>


I do still need to revert these two patches to get the I2S to
work properly:

commit d70e861a3154833467023123e218e9b1ba558809
ASoC: samsung: Remove SND_DMAENGINE_PCM_FLAG_NO_RESIDUE flag

commit acde50a7bf1fd6ae0baa4402f0a02c4b1bd4c990
ASoC: dmaengine_pcm: Make FLAG_NO_RESIDUE internal

But that is clearly an unrelated issue, which I haven't found
time to look into yet as we don't use this platform that often
these days.

Thanks,
Charles

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

* Re: [PATCH RFC 2/7] ARM: S3C64XX: Add DMA slave maps for PL080 devices
  2016-11-10 11:03           ` Charles Keepax
@ 2016-11-10 15:10             ` Sylwester Nawrocki
  -1 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-10 15:10 UTC (permalink / raw)
  To: Charles Keepax
  Cc: linux-samsung-soc, linux-arm-kernel, dmaengine, vinod.koul,
	broonie, ym0914, arnd, kgene, javier, andi.shyti, sbkim73

On 11/10/2016 12:03 PM, Charles Keepax wrote:
>> On Tue, Nov 08, 2016 at 04:53:40PM +0100, Sylwester Nawrocki wrote:
[...]
>> I pushed now to branch for-v4.10/dma/pl080-s3c64xx-v2 with this
>> issue fixed and added initialization of the filer function.
> 
> Apologies for the delay got somewhat swamped with internal stuff
> yesterday. Yeah using that branch it looks good to me, the SPI and
> I2S are both working fine. I can download code to the wm0010
> which should be a good work out of the SPI and play audio
> correctly so the I2S should be fine. So for the series:
> 
> Tested-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

Great, thanks a lot!  I'm going to post the next iteration with
modified pl080 DMAC patches, addressing comments from Arnd.
I would be grateful if you could confirm it also works on your
platform.

> I do still need to revert these two patches to get the I2S to
> work properly:
> 
> commit d70e861a3154833467023123e218e9b1ba558809
> ASoC: samsung: Remove SND_DMAENGINE_PCM_FLAG_NO_RESIDUE flag
> 
> commit acde50a7bf1fd6ae0baa4402f0a02c4b1bd4c990
> ASoC: dmaengine_pcm: Make FLAG_NO_RESIDUE internal
> 
> But that is clearly an unrelated issue, which I haven't found
> time to look into yet as we don't use this platform that often
> these days.

Thanks for reporting this, I will see if I can find time to look
into this issue as well.

-- 
Thanks,
Sylwester

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

* [PATCH RFC 2/7] ARM: S3C64XX: Add DMA slave maps for PL080 devices
@ 2016-11-10 15:10             ` Sylwester Nawrocki
  0 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-10 15:10 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/10/2016 12:03 PM, Charles Keepax wrote:
>> On Tue, Nov 08, 2016 at 04:53:40PM +0100, Sylwester Nawrocki wrote:
[...]
>> I pushed now to branch for-v4.10/dma/pl080-s3c64xx-v2 with this
>> issue fixed and added initialization of the filer function.
> 
> Apologies for the delay got somewhat swamped with internal stuff
> yesterday. Yeah using that branch it looks good to me, the SPI and
> I2S are both working fine. I can download code to the wm0010
> which should be a good work out of the SPI and play audio
> correctly so the I2S should be fine. So for the series:
> 
> Tested-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

Great, thanks a lot!  I'm going to post the next iteration with
modified pl080 DMAC patches, addressing comments from Arnd.
I would be grateful if you could confirm it also works on your
platform.

> I do still need to revert these two patches to get the I2S to
> work properly:
> 
> commit d70e861a3154833467023123e218e9b1ba558809
> ASoC: samsung: Remove SND_DMAENGINE_PCM_FLAG_NO_RESIDUE flag
> 
> commit acde50a7bf1fd6ae0baa4402f0a02c4b1bd4c990
> ASoC: dmaengine_pcm: Make FLAG_NO_RESIDUE internal
> 
> But that is clearly an unrelated issue, which I haven't found
> time to look into yet as we don't use this platform that often
> these days.

Thanks for reporting this, I will see if I can find time to look
into this issue as well.

-- 
Thanks,
Sylwester

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

* Re: [PATCH RFC 2/7] ARM: S3C64XX: Add DMA slave maps for PL080 devices
  2016-11-10 15:10             ` Sylwester Nawrocki
@ 2016-11-10 15:18               ` Charles Keepax
  -1 siblings, 0 replies; 56+ messages in thread
From: Charles Keepax @ 2016-11-10 15:18 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, linux-arm-kernel, dmaengine, vinod.koul,
	broonie, ym0914, arnd, kgene, javier, andi.shyti, sbkim73

On Thu, Nov 10, 2016 at 04:10:56PM +0100, Sylwester Nawrocki wrote:
> On 11/10/2016 12:03 PM, Charles Keepax wrote:
> >> On Tue, Nov 08, 2016 at 04:53:40PM +0100, Sylwester Nawrocki wrote:
> [...]
> >> I pushed now to branch for-v4.10/dma/pl080-s3c64xx-v2 with this
> >> issue fixed and added initialization of the filer function.
> > 
> > Apologies for the delay got somewhat swamped with internal stuff
> > yesterday. Yeah using that branch it looks good to me, the SPI and
> > I2S are both working fine. I can download code to the wm0010
> > which should be a good work out of the SPI and play audio
> > correctly so the I2S should be fine. So for the series:
> > 
> > Tested-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> 
> Great, thanks a lot!  I'm going to post the next iteration with
> modified pl080 DMAC patches, addressing comments from Arnd.
> I would be grateful if you could confirm it also works on your
> platform.
> 

Yeah, no problem, I should be able to find time to test those as
well.

Thanks,
Charles

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

* [PATCH RFC 2/7] ARM: S3C64XX: Add DMA slave maps for PL080 devices
@ 2016-11-10 15:18               ` Charles Keepax
  0 siblings, 0 replies; 56+ messages in thread
From: Charles Keepax @ 2016-11-10 15:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 10, 2016 at 04:10:56PM +0100, Sylwester Nawrocki wrote:
> On 11/10/2016 12:03 PM, Charles Keepax wrote:
> >> On Tue, Nov 08, 2016 at 04:53:40PM +0100, Sylwester Nawrocki wrote:
> [...]
> >> I pushed now to branch for-v4.10/dma/pl080-s3c64xx-v2 with this
> >> issue fixed and added initialization of the filer function.
> > 
> > Apologies for the delay got somewhat swamped with internal stuff
> > yesterday. Yeah using that branch it looks good to me, the SPI and
> > I2S are both working fine. I can download code to the wm0010
> > which should be a good work out of the SPI and play audio
> > correctly so the I2S should be fine. So for the series:
> > 
> > Tested-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> 
> Great, thanks a lot!  I'm going to post the next iteration with
> modified pl080 DMAC patches, addressing comments from Arnd.
> I would be grateful if you could confirm it also works on your
> platform.
> 

Yeah, no problem, I should be able to find time to test those as
well.

Thanks,
Charles

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

* Re: [PATCH RFC 1/7] dma: pl08x: Add support for the DMA slave map
  2016-11-07 19:55         ` Arnd Bergmann
@ 2016-11-14 11:51           ` Sylwester Nawrocki
  -1 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-14 11:51 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: dmaengine, vinod.koul, linux-arm-kernel, linux-samsung-soc,
	sbkim73, andi.shyti, javier, broonie, kgene, ckeepax, ym0914

On 11/07/2016 08:55 PM, Arnd Bergmann wrote:
>> diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
>> > index d5c75c8..0d1eb2e 100644
>> > --- a/drivers/dma/amba-pl08x.c
>> > +++ b/drivers/dma/amba-pl08x.c
>> > @@ -1793,6 +1793,23 @@ bool pl08x_filter_id(struct dma_chan *chan, void *chan_id)
>> >  }
[...]
>> > +static bool pl08x_filter_fn(struct dma_chan *chan, void *chan_id)
>> > +{
>> > +       struct pl08x_dma_chan *plchan;
[...]
>> > +       plchan = to_pl08x_chan(chan);
>> > +
>> > +       /* Check that the channel is not taken! */
>> > +       if (plchan->cd == chan_id)
>> > +               return true;
> 
> What I had in mind was a bit different: Instead of comparing the
> channel, I was thinking of modifying the channel itself, something
> like:
> 
> 	plchan->signal = chan_id->signal;
> 	plchan->periph_buses = chan_id->periph_buses;
> 
> after that, remove the plchan->cd data. Unfortunately, the muxing in
> arch/arm/mach-spear/ makes this a bit harder. I'd have to think
> about it some more. It may be easier to do this after moving
> spear and lpc32xx over to use dma_slave_map.

I've posted updated version of this patch, please let me know
if you have any further comments.

-- 
Thanks,
Sylwester

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

* [PATCH RFC 1/7] dma: pl08x: Add support for the DMA slave map
@ 2016-11-14 11:51           ` Sylwester Nawrocki
  0 siblings, 0 replies; 56+ messages in thread
From: Sylwester Nawrocki @ 2016-11-14 11:51 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/07/2016 08:55 PM, Arnd Bergmann wrote:
>> diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
>> > index d5c75c8..0d1eb2e 100644
>> > --- a/drivers/dma/amba-pl08x.c
>> > +++ b/drivers/dma/amba-pl08x.c
>> > @@ -1793,6 +1793,23 @@ bool pl08x_filter_id(struct dma_chan *chan, void *chan_id)
>> >  }
[...]
>> > +static bool pl08x_filter_fn(struct dma_chan *chan, void *chan_id)
>> > +{
>> > +       struct pl08x_dma_chan *plchan;
[...]
>> > +       plchan = to_pl08x_chan(chan);
>> > +
>> > +       /* Check that the channel is not taken! */
>> > +       if (plchan->cd == chan_id)
>> > +               return true;
> 
> What I had in mind was a bit different: Instead of comparing the
> channel, I was thinking of modifying the channel itself, something
> like:
> 
> 	plchan->signal = chan_id->signal;
> 	plchan->periph_buses = chan_id->periph_buses;
> 
> after that, remove the plchan->cd data. Unfortunately, the muxing in
> arch/arm/mach-spear/ makes this a bit harder. I'd have to think
> about it some more. It may be easier to do this after moving
> spear and lpc32xx over to use dma_slave_map.

I've posted updated version of this patch, please let me know
if you have any further comments.

-- 
Thanks,
Sylwester

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

end of thread, other threads:[~2016-11-14 11:51 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-04 16:14 [PATCH RFC 0/7] DMA: S3C64XX: Conversion to the new channel request API Sylwester Nawrocki
2016-11-04 16:14 ` Sylwester Nawrocki
2016-11-04 16:14 ` Sylwester Nawrocki
2016-11-04 16:14   ` Sylwester Nawrocki
2016-11-08 15:39   ` Charles Keepax
2016-11-08 15:39     ` Charles Keepax
2016-11-08 16:02     ` Sylwester Nawrocki
2016-11-08 16:02       ` Sylwester Nawrocki
2016-11-04 16:14 ` [PATCH RFC 1/7] dma: pl08x: Add support for the DMA slave map Sylwester Nawrocki
2016-11-04 16:14   ` Sylwester Nawrocki
2016-11-04 23:26   ` Arnd Bergmann
2016-11-04 23:26     ` Arnd Bergmann
2016-11-07 15:41     ` Sylwester Nawrocki
2016-11-07 15:41       ` Sylwester Nawrocki
2016-11-07 19:55       ` Arnd Bergmann
2016-11-07 19:55         ` Arnd Bergmann
2016-11-14 11:51         ` Sylwester Nawrocki
2016-11-14 11:51           ` Sylwester Nawrocki
2016-11-04 16:14 ` [PATCH RFC 2/7] ARM: S3C64XX: Add DMA slave maps for PL080 devices Sylwester Nawrocki
2016-11-04 16:14   ` Sylwester Nawrocki
2016-11-08 14:44   ` Charles Keepax
2016-11-08 14:44     ` Charles Keepax
2016-11-08 14:55     ` Charles Keepax
2016-11-08 14:55       ` Charles Keepax
2016-11-08 15:53       ` Sylwester Nawrocki
2016-11-08 15:53         ` Sylwester Nawrocki
2016-11-10 11:03         ` Charles Keepax
2016-11-10 11:03           ` Charles Keepax
2016-11-10 15:10           ` Sylwester Nawrocki
2016-11-10 15:10             ` Sylwester Nawrocki
2016-11-10 15:18             ` Charles Keepax
2016-11-10 15:18               ` Charles Keepax
2016-11-04 16:14 ` [PATCH RFC 3/7] spi: s3c64xx: Do not use platform_data for DMA parameters Sylwester Nawrocki
2016-11-04 16:14   ` Sylwester Nawrocki
2016-11-04 17:12   ` Mark Brown
2016-11-04 17:12     ` Mark Brown
2016-11-07  2:51   ` Andi Shyti
2016-11-07  2:51     ` Andi Shyti
2016-11-04 16:14 ` [PATCH RFC 4/7] ASoC: samsung: i2s: " Sylwester Nawrocki
2016-11-04 16:14   ` Sylwester Nawrocki
2016-11-04 17:13   ` Mark Brown
2016-11-04 17:13     ` Mark Brown
2016-11-04 23:29   ` Arnd Bergmann
2016-11-04 23:29     ` Arnd Bergmann
2016-11-07 16:02     ` Sylwester Nawrocki
2016-11-07 16:02       ` Sylwester Nawrocki
2016-11-07 21:14       ` Arnd Bergmann
2016-11-07 21:14         ` Arnd Bergmann
2016-11-04 16:14 ` [PATCH RFC 5/7] ASoC: samsung: pcm: " Sylwester Nawrocki
2016-11-04 16:14   ` Sylwester Nawrocki
2016-11-04 17:13   ` Mark Brown
2016-11-04 17:13     ` Mark Brown
2016-11-04 16:14 ` [PATCH RFC 6/7] ARM: S3C64XX: Drop unused DMA fields from struct s3c64xx_spi_csinfo Sylwester Nawrocki
2016-11-04 16:14   ` Sylwester Nawrocki
2016-11-04 16:14 ` [PATCH RFC 7/7] ARM: S3C64XX: Drop initialization of unused struct s3c_audio_pdata fields Sylwester Nawrocki
2016-11-04 16:14   ` Sylwester Nawrocki

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.