aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/pl330.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-24 12:49:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-24 12:49:37 -0400
commitd6a4c0e5d3d433ef296f8f417e835329a834a256 (patch)
treea65de394ea1afeeccee9f84dc7e6cd21e2660639 /drivers/dma/pl330.c
parent474095e46cd14421821da3201a9fd6a4c070996b (diff)
parentcdde0e61cf2d41123604c6c9d8f09ef5c23464ee (diff)
Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dmaengine updates from Vinod Koul: - new drivers for: - Ingenic JZ4780 controller - APM X-Gene controller - Freescale RaidEngine device - Renesas USB Controller - remove device_alloc_chan_resources dummy handlers - sh driver cleanups for peri peri and related emmc and asoc patches as well - fixes and enhancements spread over the drivers * 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (59 commits) dmaengine: dw: don't prompt for DW_DMAC_CORE dmaengine: shdmac: avoid unused variable warnings dmaengine: fix platform_no_drv_owner.cocci warnings dmaengine: pch_dma: fix memory leak on failure path in pch_dma_probe() dmaengine: at_xdmac: unlock spin lock before return dmaengine: xgene: devm_ioremap() returns NULL on error dmaengine: xgene: buffer overflow in xgene_dma_init_channels() dmaengine: usb-dmac: Fix dereferencing freed memory 'desc' dmaengine: sa11x0: report slave capabilities to upper layers dmaengine: vdma: Fix compilation warnings dmaengine: fsl_raid: statify fsl_re_chan_probe dmaengine: Driver support for FSL RaidEngine device. dmaengine: xgene_dma_init_ring_mngr() can be static Documentation: dma: Add documentation for the APM X-Gene SoC DMA device DTS binding arm64: dts: Add APM X-Gene SoC DMA device and DMA clock DTS nodes dmaengine: Add support for APM X-Gene SoC DMA engine driver dmaengine: usb-dmac: Add Renesas USB DMA Controller (USB-DMAC) driver dmaengine: renesas,usb-dmac: Add device tree bindings documentation dmaengine: edma: fixed wrongly initialized data parameter to the edma callback dmaengine: ste_dma40: fix implicit conversion ...
Diffstat (limited to 'drivers/dma/pl330.c')
-rw-r--r--drivers/dma/pl330.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 0e1f56772855..a7d9d3029b14 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -556,7 +556,7 @@ static inline u32 _emit_ADDH(unsigned dry_run, u8 buf[],
556 556
557 buf[0] = CMD_DMAADDH; 557 buf[0] = CMD_DMAADDH;
558 buf[0] |= (da << 1); 558 buf[0] |= (da << 1);
559 *((u16 *)&buf[1]) = val; 559 *((__le16 *)&buf[1]) = cpu_to_le16(val);
560 560
561 PL330_DBGCMD_DUMP(SZ_DMAADDH, "\tDMAADDH %s %u\n", 561 PL330_DBGCMD_DUMP(SZ_DMAADDH, "\tDMAADDH %s %u\n",
562 da == 1 ? "DA" : "SA", val); 562 da == 1 ? "DA" : "SA", val);
@@ -710,7 +710,7 @@ static inline u32 _emit_MOV(unsigned dry_run, u8 buf[],
710 710
711 buf[0] = CMD_DMAMOV; 711 buf[0] = CMD_DMAMOV;
712 buf[1] = dst; 712 buf[1] = dst;
713 *((u32 *)&buf[2]) = val; 713 *((__le32 *)&buf[2]) = cpu_to_le32(val);
714 714
715 PL330_DBGCMD_DUMP(SZ_DMAMOV, "\tDMAMOV %s 0x%x\n", 715 PL330_DBGCMD_DUMP(SZ_DMAMOV, "\tDMAMOV %s 0x%x\n",
716 dst == SAR ? "SAR" : (dst == DAR ? "DAR" : "CCR"), val); 716 dst == SAR ? "SAR" : (dst == DAR ? "DAR" : "CCR"), val);
@@ -888,7 +888,7 @@ static inline u32 _emit_GO(unsigned dry_run, u8 buf[],
888 888
889 buf[1] = chan & 0x7; 889 buf[1] = chan & 0x7;
890 890
891 *((u32 *)&buf[2]) = addr; 891 *((__le32 *)&buf[2]) = cpu_to_le32(addr);
892 892
893 return SZ_DMAGO; 893 return SZ_DMAGO;
894} 894}
@@ -928,7 +928,7 @@ static inline void _execute_DBGINSN(struct pl330_thread *thrd,
928 } 928 }
929 writel(val, regs + DBGINST0); 929 writel(val, regs + DBGINST0);
930 930
931 val = *((u32 *)&insn[2]); 931 val = le32_to_cpu(*((__le32 *)&insn[2]));
932 writel(val, regs + DBGINST1); 932 writel(val, regs + DBGINST1);
933 933
934 /* If timed out due to halted state-machine */ 934 /* If timed out due to halted state-machine */
@@ -2162,7 +2162,7 @@ static int pl330_terminate_all(struct dma_chan *chan)
2162 * DMA transfer again. This pause feature was implemented to 2162 * DMA transfer again. This pause feature was implemented to
2163 * allow safely read residue before channel termination. 2163 * allow safely read residue before channel termination.
2164 */ 2164 */
2165int pl330_pause(struct dma_chan *chan) 2165static int pl330_pause(struct dma_chan *chan)
2166{ 2166{
2167 struct dma_pl330_chan *pch = to_pchan(chan); 2167 struct dma_pl330_chan *pch = to_pchan(chan);
2168 struct pl330_dmac *pl330 = pch->dmac; 2168 struct pl330_dmac *pl330 = pch->dmac;
@@ -2203,8 +2203,8 @@ static void pl330_free_chan_resources(struct dma_chan *chan)
2203 pm_runtime_put_autosuspend(pch->dmac->ddma.dev); 2203 pm_runtime_put_autosuspend(pch->dmac->ddma.dev);
2204} 2204}
2205 2205
2206int pl330_get_current_xferred_count(struct dma_pl330_chan *pch, 2206static int pl330_get_current_xferred_count(struct dma_pl330_chan *pch,
2207 struct dma_pl330_desc *desc) 2207 struct dma_pl330_desc *desc)
2208{ 2208{
2209 struct pl330_thread *thrd = pch->thread; 2209 struct pl330_thread *thrd = pch->thread;
2210 struct pl330_dmac *pl330 = pch->dmac; 2210 struct pl330_dmac *pl330 = pch->dmac;
@@ -2259,7 +2259,17 @@ pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
2259 transferred = 0; 2259 transferred = 0;
2260 residual += desc->bytes_requested - transferred; 2260 residual += desc->bytes_requested - transferred;
2261 if (desc->txd.cookie == cookie) { 2261 if (desc->txd.cookie == cookie) {
2262 ret = desc->status; 2262 switch (desc->status) {
2263 case DONE:
2264 ret = DMA_COMPLETE;
2265 break;
2266 case PREP:
2267 case BUSY:
2268 ret = DMA_IN_PROGRESS;
2269 break;
2270 default:
2271 WARN_ON(1);
2272 }
2263 break; 2273 break;
2264 } 2274 }
2265 if (desc->last) 2275 if (desc->last)