dma: zx: rename zx296702_dma.c to zx_dma.c
PATCH 1/3 dma: zx: rename zx296702_dma.c to zx_dma.c
From: Shawn Guo <[email protected]>
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.
---
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%)drivers/dma/Kconfig +2 -2
@@ -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
drivers/dma/Makefile +1 -1
@@ -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/
drivers/dma/zx_dma.c renamed from drivers/dma/zx296702_dma.c +0 -0
Signature · 1 line
1.9.1
PATCH 2/3 dma: zx: set DMA_CYCLIC cap_mask bit
From: Shawn Guo <[email protected]>
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.
--- drivers/dma/zx_dma.c | 1 + 1 file changed, 1 insertion(+)
drivers/dma/zx_dma.c +1 -0
@@ -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;
Signature · 1 line
1.9.1
PATCH 2/3 dma: zx: set DMA_CYCLIC cap_mask bit
2016-12-15 22:03 GMT+08:00 Shawn Guo <[email protected]>:
Quoted 7 lines
From: Shawn Guo <[email protected]>
The
zx_dmadriver supports cyclic transfer mode. Let's setDMA_CYCLICcap_maskbit to make that clear, and avoid unnecessary failure when clients request channel viadma_request_chan_by_mask()withDMA_CYCLICbit set in mask.
Quoted 5 lines
Signed-off-by Shawn Guo <[email protected]>--- drivers/dma/zx_dma.c | 1 + 1 file changed, 1 insertion(+)
PATCH 3/3 dma: zx: fix residue calculation
In reply to Shawn GuoFrom: Shawn Guo <[email protected]>
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.
--- drivers/dma/zx_dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/dma/zx_dma.c +2 -1
@@ -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 */
Signature · 1 line
1.9.1
PATCH 3/3 dma: zx: fix residue calculation
2016-12-15 22:03 GMT+08:00 Shawn Guo <[email protected]>:
Quoted 9 lines
From: Shawn Guo <[email protected]>
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 bothslave_sgand 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.
Quoted 8 lines
This fixes the HDMI audio noise issue we see on ZX296718 with SPDIF interface.
Signed-off-by Shawn Guo <[email protected]>--- drivers/dma/zx_dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
PATCH 1/3 dma: zx: rename zx296702_dma.c to zx_dma.c
In reply to Shawn Guo2016-12-15 22:03 GMT+08:00 Shawn Guo <[email protected]>:
Quoted 6 lines
From: Shawn Guo <[email protected]>
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.
Quoted 8 lines
Signed-off-by Shawn Guo <[email protected]>--- 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%)
PATCH 1/3 dma: zx: rename zx296702_dma.c to zx_dma.c
In reply to Shawn GuoQuoted 5 lines · Shawn Guo
From: Shawn Guo <[email protected]>
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
Signature · 1 line
~Vinod