* [PATCH 1/3] dma: zx: rename zx296702_dma.c to zx_dma.c
@ 2016-12-15 14:03 Shawn Guo
2016-12-15 14:03 ` [PATCH 2/3] dma: zx: set DMA_CYCLIC cap_mask bit Shawn Guo
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Shawn Guo @ 2016-12-15 14:03 UTC (permalink / raw)
To: linux-arm-kernel
From: Shawn Guo <shawn.guo@linaro.org>
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 <shawn.guo@linaro.org>
---
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] dma: zx: set DMA_CYCLIC cap_mask bit
2016-12-15 14:03 [PATCH 1/3] dma: zx: rename zx296702_dma.c to zx_dma.c Shawn Guo
@ 2016-12-15 14:03 ` Shawn Guo
2016-12-22 6:17 ` Jun Nie
2016-12-15 14:03 ` [PATCH 3/3] dma: zx: fix residue calculation Shawn Guo
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Shawn Guo @ 2016-12-15 14:03 UTC (permalink / raw)
To: linux-arm-kernel
From: Shawn Guo <shawn.guo@linaro.org>
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 <shawn.guo@linaro.org>
---
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] dma: zx: fix residue calculation
2016-12-15 14:03 [PATCH 1/3] dma: zx: rename zx296702_dma.c to zx_dma.c Shawn Guo
2016-12-15 14:03 ` [PATCH 2/3] dma: zx: set DMA_CYCLIC cap_mask bit Shawn Guo
@ 2016-12-15 14:03 ` Shawn Guo
2016-12-22 6:22 ` Jun Nie
2016-12-22 6:14 ` [PATCH 1/3] dma: zx: rename zx296702_dma.c to zx_dma.c Jun Nie
2017-01-02 5:24 ` Vinod Koul
3 siblings, 1 reply; 7+ messages in thread
From: Shawn Guo @ 2016-12-15 14:03 UTC (permalink / raw)
To: linux-arm-kernel
From: Shawn Guo <shawn.guo@linaro.org>
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 <shawn.guo@linaro.org>
---
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 1/3] dma: zx: rename zx296702_dma.c to zx_dma.c
2016-12-15 14:03 [PATCH 1/3] dma: zx: rename zx296702_dma.c to zx_dma.c Shawn Guo
2016-12-15 14:03 ` [PATCH 2/3] dma: zx: set DMA_CYCLIC cap_mask bit Shawn Guo
2016-12-15 14:03 ` [PATCH 3/3] dma: zx: fix residue calculation Shawn Guo
@ 2016-12-22 6:14 ` Jun Nie
2017-01-02 5:24 ` Vinod Koul
3 siblings, 0 replies; 7+ messages in thread
From: Jun Nie @ 2016-12-22 6:14 UTC (permalink / raw)
To: linux-arm-kernel
2016-12-15 22:03 GMT+08:00 Shawn Guo <shawnguo@kernel.org>:
> From: Shawn Guo <shawn.guo@linaro.org>
>
> 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 <shawn.guo@linaro.org>
> ---
> 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 <jun.nie@linaro.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] dma: zx: set DMA_CYCLIC cap_mask bit
2016-12-15 14:03 ` [PATCH 2/3] dma: zx: set DMA_CYCLIC cap_mask bit Shawn Guo
@ 2016-12-22 6:17 ` Jun Nie
0 siblings, 0 replies; 7+ messages in thread
From: Jun Nie @ 2016-12-22 6:17 UTC (permalink / raw)
To: linux-arm-kernel
2016-12-15 22:03 GMT+08:00 Shawn Guo <shawnguo@kernel.org>:
> From: Shawn Guo <shawn.guo@linaro.org>
>
> 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 <shawn.guo@linaro.org>
> ---
> drivers/dma/zx_dma.c | 1 +
> 1 file changed, 1 insertion(+)
>
Reviewed-by: Jun Nie <jun.nie@linaro.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] dma: zx: fix residue calculation
2016-12-15 14:03 ` [PATCH 3/3] dma: zx: fix residue calculation Shawn Guo
@ 2016-12-22 6:22 ` Jun Nie
0 siblings, 0 replies; 7+ messages in thread
From: Jun Nie @ 2016-12-22 6:22 UTC (permalink / raw)
To: linux-arm-kernel
2016-12-15 22:03 GMT+08:00 Shawn Guo <shawnguo@kernel.org>:
> From: Shawn Guo <shawn.guo@linaro.org>
>
> 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 <shawn.guo@linaro.org>
> ---
> drivers/dma/zx_dma.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
Reviewed-by: Jun Nie <jun.nie@linaro.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] dma: zx: rename zx296702_dma.c to zx_dma.c
2016-12-15 14:03 [PATCH 1/3] dma: zx: rename zx296702_dma.c to zx_dma.c Shawn Guo
` (2 preceding siblings ...)
2016-12-22 6:14 ` [PATCH 1/3] dma: zx: rename zx296702_dma.c to zx_dma.c Jun Nie
@ 2017-01-02 5:24 ` Vinod Koul
3 siblings, 0 replies; 7+ messages in thread
From: Vinod Koul @ 2017-01-02 5:24 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 15, 2016 at 10:03:35PM +0800, Shawn Guo wrote:
> From: Shawn Guo <shawn.guo@linaro.org>
>
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-01-02 5:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-15 14:03 [PATCH 1/3] dma: zx: rename zx296702_dma.c to zx_dma.c Shawn Guo
2016-12-15 14:03 ` [PATCH 2/3] dma: zx: set DMA_CYCLIC cap_mask bit Shawn Guo
2016-12-22 6:17 ` Jun Nie
2016-12-15 14:03 ` [PATCH 3/3] dma: zx: fix residue calculation Shawn Guo
2016-12-22 6:22 ` Jun Nie
2016-12-22 6:14 ` [PATCH 1/3] dma: zx: rename zx296702_dma.c to zx_dma.c Jun Nie
2017-01-02 5:24 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).