[PATCH 1/3] dma: zx: rename zx296702_dma.c to zx_dma.c

Subsystems: dma generic offload engine subsystem, the rest

STALE3576d

7 messages, 3 authors, 2017-01-02 · open the first message on its own page

[PATCH 1/3] dma: zx: rename zx296702_dma.c to zx_dma.c

From: shawnguo@kernel.org (Shawn Guo)
Date: 2016-12-15 14:03:35

From: Shawn Guo <redacted>

ZTE ZX dma driver is not ZX296702 specific.  It works for not only
ZX296702 but also other ZTE ZX family platforms like ZX296718.  Let's
rename the file to reflect that.

Signed-off-by: Shawn Guo <redacted>
---
 drivers/dma/Kconfig                      | 4 ++--
 drivers/dma/Makefile                     | 2 +-
 drivers/dma/{zx296702_dma.c => zx_dma.c} | 0
 3 files changed, 3 insertions(+), 3 deletions(-)
 rename drivers/dma/{zx296702_dma.c => zx_dma.c} (100%)
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 263495d0adbd..eab7e12ee4a6 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -571,12 +571,12 @@ config XILINX_ZYNQMP_DMA
 	  Enable support for Xilinx ZynqMP DMA controller.
 
 config ZX_DMA
-	tristate "ZTE ZX296702 DMA support"
+	tristate "ZTE ZX DMA support"
 	depends on ARCH_ZX || COMPILE_TEST
 	select DMA_ENGINE
 	select DMA_VIRTUAL_CHANNELS
 	help
-	  Support the DMA engine for ZTE ZX296702 platform devices.
+	  Support the DMA engine for ZTE ZX family platform devices.
 
 
 # driver files
diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
index a4fa3360e609..0b723e94d9e6 100644
--- a/drivers/dma/Makefile
+++ b/drivers/dma/Makefile
@@ -66,7 +66,7 @@ obj-$(CONFIG_TI_CPPI41) += cppi41.o
 obj-$(CONFIG_TI_DMA_CROSSBAR) += ti-dma-crossbar.o
 obj-$(CONFIG_TI_EDMA) += edma.o
 obj-$(CONFIG_XGENE_DMA) += xgene-dma.o
-obj-$(CONFIG_ZX_DMA) += zx296702_dma.o
+obj-$(CONFIG_ZX_DMA) += zx_dma.o
 obj-$(CONFIG_ST_FDMA) += st_fdma.o
 
 obj-y += qcom/
diff --git a/drivers/dma/zx296702_dma.c b/drivers/dma/zx_dma.c
similarity index 100%
rename from drivers/dma/zx296702_dma.c
rename to drivers/dma/zx_dma.c
-- 
1.9.1

[PATCH 2/3] dma: zx: set DMA_CYCLIC cap_mask bit

From: shawnguo@kernel.org (Shawn Guo)
Date: 2016-12-15 14:03:36

From: Shawn Guo <redacted>

The zx_dma driver supports cyclic transfer mode.  Let's set DMA_CYCLIC
cap_mask bit to make that clear, and avoid unnecessary failure when
clients request channel via dma_request_chan_by_mask() with DMA_CYCLIC
bit set in mask.

Signed-off-by: Shawn Guo <redacted>
---
 drivers/dma/zx_dma.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/dma/zx_dma.c b/drivers/dma/zx_dma.c
index 380276d078b2..33155c6816cc 100644
--- a/drivers/dma/zx_dma.c
+++ b/drivers/dma/zx_dma.c
@@ -812,6 +812,7 @@ static int zx_dma_probe(struct platform_device *op)
 	INIT_LIST_HEAD(&d->slave.channels);
 	dma_cap_set(DMA_SLAVE, d->slave.cap_mask);
 	dma_cap_set(DMA_MEMCPY, d->slave.cap_mask);
+	dma_cap_set(DMA_CYCLIC, d->slave.cap_mask);
 	dma_cap_set(DMA_PRIVATE, d->slave.cap_mask);
 	d->slave.dev = &op->dev;
 	d->slave.device_free_chan_resources = zx_dma_free_chan_resources;
-- 
1.9.1

[PATCH 3/3] dma: zx: fix residue calculation

From: shawnguo@kernel.org (Shawn Guo)
Date: 2016-12-15 14:03:37

From: Shawn Guo <redacted>

The dma residue is defined as the free space to end of transfer buffer,
which could be multiple segments chained together.  So the residue
calculation in zx_dma_tx_status() works for both slave_sg and cyclic
case.  But unfortunately, the 'index' is wrong.  It should plus one,
because the current segment is already occupied and shouldn't be counted
into free space.

This fixes the HDMI audio noise issue we see on ZX296718 with SPDIF
interface.

Signed-off-by: Shawn Guo <redacted>
---
 drivers/dma/zx_dma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/zx_dma.c b/drivers/dma/zx_dma.c
index 33155c6816cc..42ff3e66c1e1 100644
--- a/drivers/dma/zx_dma.c
+++ b/drivers/dma/zx_dma.c
@@ -365,7 +365,8 @@ static enum dma_status zx_dma_tx_status(struct dma_chan *chan,
 
 		bytes = 0;
 		clli = zx_dma_get_curr_lli(p);
-		index = (clli - ds->desc_hw_lli) / sizeof(struct zx_desc_hw);
+		index = (clli - ds->desc_hw_lli) /
+				sizeof(struct zx_desc_hw) + 1;
 		for (; index < ds->desc_num; index++) {
 			bytes += ds->desc_hw[index].src_x;
 			/* end of lli */
-- 
1.9.1

[PATCH 1/3] dma: zx: rename zx296702_dma.c to zx_dma.c

From: Jun Nie <hidden>
Date: 2016-12-22 06:14:51

2016-12-15 22:03 GMT+08:00 Shawn Guo [off-list ref]:
From: Shawn Guo <redacted>

ZTE ZX dma driver is not ZX296702 specific.  It works for not only
ZX296702 but also other ZTE ZX family platforms like ZX296718.  Let's
rename the file to reflect that.

Signed-off-by: Shawn Guo <redacted>
---
 drivers/dma/Kconfig                      | 4 ++--
 drivers/dma/Makefile                     | 2 +-
 drivers/dma/{zx296702_dma.c => zx_dma.c} | 0
 3 files changed, 3 insertions(+), 3 deletions(-)
 rename drivers/dma/{zx296702_dma.c => zx_dma.c} (100%)
Reviewed-by:  Jun Nie <redacted>

[PATCH 2/3] dma: zx: set DMA_CYCLIC cap_mask bit

From: Jun Nie <hidden>
Date: 2016-12-22 06:17:50

2016-12-15 22:03 GMT+08:00 Shawn Guo [off-list ref]:
From: Shawn Guo <redacted>

The zx_dma driver supports cyclic transfer mode.  Let's set DMA_CYCLIC
cap_mask bit to make that clear, and avoid unnecessary failure when
clients request channel via dma_request_chan_by_mask() with DMA_CYCLIC
bit set in mask.

Signed-off-by: Shawn Guo <redacted>
---
 drivers/dma/zx_dma.c | 1 +
 1 file changed, 1 insertion(+)
Reviewed-by:  Jun Nie <redacted>

[PATCH 3/3] dma: zx: fix residue calculation

From: Jun Nie <hidden>
Date: 2016-12-22 06:22:06

2016-12-15 22:03 GMT+08:00 Shawn Guo [off-list ref]:
From: Shawn Guo <redacted>

The dma residue is defined as the free space to end of transfer buffer,
which could be multiple segments chained together.  So the residue
calculation in zx_dma_tx_status() works for both slave_sg and cyclic
case.  But unfortunately, the 'index' is wrong.  It should plus one,
because the current segment is already occupied and shouldn't be counted
into free space.

This fixes the HDMI audio noise issue we see on ZX296718 with SPDIF
interface.

Signed-off-by: Shawn Guo <redacted>
---
 drivers/dma/zx_dma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by:  Jun Nie <redacted>

[PATCH 1/3] dma: zx: rename zx296702_dma.c to zx_dma.c

From: Vinod Koul <hidden>
Date: 2017-01-02 05:24:43

On Thu, Dec 15, 2016 at 10:03:35PM +0800, Shawn Guo wrote:
From: Shawn Guo <redacted>

ZTE ZX dma driver is not ZX296702 specific.  It works for not only
ZX296702 but also other ZTE ZX family platforms like ZX296718.  Let's
rename the file to reflect that.
Applied all after fixing subsystem name

-- 
~Vinod
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help