diff options
author | Robin Gong <yibin.gong@nxp.com> | 2018-07-23 13:46:10 -0400 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2018-07-30 01:03:58 -0400 |
commit | 4a6b2e8a9a0216697405560f3a14b5f33812f444 (patch) | |
tree | 61630a36121c5ee8bd16fb3de7065f4a3f923d64 | |
parent | 24ca312dd66329b126230b6f5826f45a61ebb5a8 (diff) |
dmaengine: imx-sdma: add SDMA_BD_MAX_CNT to replace '0xffff'
Add macro SDMA_BD_MAX_CNT to replace '0xffff'.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r-- | drivers/dma/imx-sdma.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 3b622d660c8b..e3d5e73a97c7 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c | |||
@@ -185,6 +185,7 @@ | |||
185 | * Mode/Count of data node descriptors - IPCv2 | 185 | * Mode/Count of data node descriptors - IPCv2 |
186 | */ | 186 | */ |
187 | struct sdma_mode_count { | 187 | struct sdma_mode_count { |
188 | #define SDMA_BD_MAX_CNT 0xffff | ||
188 | u32 count : 16; /* size of the buffer pointed by this BD */ | 189 | u32 count : 16; /* size of the buffer pointed by this BD */ |
189 | u32 status : 8; /* E,R,I,C,W,D status bits stored here */ | 190 | u32 status : 8; /* E,R,I,C,W,D status bits stored here */ |
190 | u32 command : 8; /* command mostly used for channel 0 */ | 191 | u32 command : 8; /* command mostly used for channel 0 */ |
@@ -1344,9 +1345,9 @@ static struct dma_async_tx_descriptor *sdma_prep_slave_sg( | |||
1344 | 1345 | ||
1345 | count = sg_dma_len(sg); | 1346 | count = sg_dma_len(sg); |
1346 | 1347 | ||
1347 | if (count > 0xffff) { | 1348 | if (count > SDMA_BD_MAX_CNT) { |
1348 | dev_err(sdma->dev, "SDMA channel %d: maximum bytes for sg entry exceeded: %d > %d\n", | 1349 | dev_err(sdma->dev, "SDMA channel %d: maximum bytes for sg entry exceeded: %d > %d\n", |
1349 | channel, count, 0xffff); | 1350 | channel, count, SDMA_BD_MAX_CNT); |
1350 | goto err_bd_out; | 1351 | goto err_bd_out; |
1351 | } | 1352 | } |
1352 | 1353 | ||
@@ -1421,9 +1422,9 @@ static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic( | |||
1421 | 1422 | ||
1422 | sdmac->flags |= IMX_DMA_SG_LOOP; | 1423 | sdmac->flags |= IMX_DMA_SG_LOOP; |
1423 | 1424 | ||
1424 | if (period_len > 0xffff) { | 1425 | if (period_len > SDMA_BD_MAX_CNT) { |
1425 | dev_err(sdma->dev, "SDMA channel %d: maximum period size exceeded: %zu > %d\n", | 1426 | dev_err(sdma->dev, "SDMA channel %d: maximum period size exceeded: %zu > %d\n", |
1426 | channel, period_len, 0xffff); | 1427 | channel, period_len, SDMA_BD_MAX_CNT); |
1427 | goto err_bd_out; | 1428 | goto err_bd_out; |
1428 | } | 1429 | } |
1429 | 1430 | ||
@@ -1970,7 +1971,7 @@ static int sdma_probe(struct platform_device *pdev) | |||
1970 | sdma->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT; | 1971 | sdma->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT; |
1971 | sdma->dma_device.device_issue_pending = sdma_issue_pending; | 1972 | sdma->dma_device.device_issue_pending = sdma_issue_pending; |
1972 | sdma->dma_device.dev->dma_parms = &sdma->dma_parms; | 1973 | sdma->dma_device.dev->dma_parms = &sdma->dma_parms; |
1973 | dma_set_max_seg_size(sdma->dma_device.dev, 65535); | 1974 | dma_set_max_seg_size(sdma->dma_device.dev, SDMA_BD_MAX_CNT); |
1974 | 1975 | ||
1975 | platform_set_drvdata(pdev, sdma); | 1976 | platform_set_drvdata(pdev, sdma); |
1976 | 1977 | ||