diff options
author | Ludovic Desroches <ludovic.desroches@atmel.com> | 2014-11-17 08:42:44 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2014-12-22 02:03:23 -0500 |
commit | 8ac82f889c525243b3b3b64117bbd8f810aac29b (patch) | |
tree | a2956ab78cf6f27757040d5821bcd051b7320a17 /drivers/dma/at_xdmac.c | |
parent | 7664cfe00151dcd801cee0c52ebc8688e1899110 (diff) |
dmaengine: at_xdmac: Declare slave capabilities for the generic code
Now that the generic slave caps code can make use of the device assigned
capabilities, instead of relying on a callback to be implemented.
Make use of this code.
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/at_xdmac.c')
-rw-r--r-- | drivers/dma/at_xdmac.c | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index c7f335088d1e..8c799f66a6dc 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c | |||
@@ -174,6 +174,13 @@ | |||
174 | 174 | ||
175 | #define AT_XDMAC_MAX_CHAN 0x20 | 175 | #define AT_XDMAC_MAX_CHAN 0x20 |
176 | 176 | ||
177 | #define AT_XDMAC_DMA_BUSWIDTHS\ | ||
178 | (BIT(DMA_SLAVE_BUSWIDTH_UNDEFINED) |\ | ||
179 | BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) |\ | ||
180 | BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) |\ | ||
181 | BIT(DMA_SLAVE_BUSWIDTH_4_BYTES) |\ | ||
182 | BIT(DMA_SLAVE_BUSWIDTH_8_BYTES)) | ||
183 | |||
177 | enum atc_status { | 184 | enum atc_status { |
178 | AT_XDMAC_CHAN_IS_CYCLIC = 0, | 185 | AT_XDMAC_CHAN_IS_CYCLIC = 0, |
179 | AT_XDMAC_CHAN_IS_PAUSED, | 186 | AT_XDMAC_CHAN_IS_PAUSED, |
@@ -1234,27 +1241,6 @@ static void at_xdmac_free_chan_resources(struct dma_chan *chan) | |||
1234 | return; | 1241 | return; |
1235 | } | 1242 | } |
1236 | 1243 | ||
1237 | #define AT_XDMAC_DMA_BUSWIDTHS\ | ||
1238 | (BIT(DMA_SLAVE_BUSWIDTH_UNDEFINED) |\ | ||
1239 | BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) |\ | ||
1240 | BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) |\ | ||
1241 | BIT(DMA_SLAVE_BUSWIDTH_4_BYTES) |\ | ||
1242 | BIT(DMA_SLAVE_BUSWIDTH_8_BYTES)) | ||
1243 | |||
1244 | static int at_xdmac_device_slave_caps(struct dma_chan *dchan, | ||
1245 | struct dma_slave_caps *caps) | ||
1246 | { | ||
1247 | |||
1248 | caps->src_addr_widths = AT_XDMAC_DMA_BUSWIDTHS; | ||
1249 | caps->dst_addr_widths = AT_XDMAC_DMA_BUSWIDTHS; | ||
1250 | caps->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); | ||
1251 | caps->cmd_pause = true; | ||
1252 | caps->cmd_terminate = true; | ||
1253 | caps->residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; | ||
1254 | |||
1255 | return 0; | ||
1256 | } | ||
1257 | |||
1258 | #ifdef CONFIG_PM | 1244 | #ifdef CONFIG_PM |
1259 | static int atmel_xdmac_prepare(struct device *dev) | 1245 | static int atmel_xdmac_prepare(struct device *dev) |
1260 | { | 1246 | { |
@@ -1428,7 +1414,10 @@ static int at_xdmac_probe(struct platform_device *pdev) | |||
1428 | atxdmac->dma.device_pause = at_xdmac_device_pause; | 1414 | atxdmac->dma.device_pause = at_xdmac_device_pause; |
1429 | atxdmac->dma.device_resume = at_xdmac_device_resume; | 1415 | atxdmac->dma.device_resume = at_xdmac_device_resume; |
1430 | atxdmac->dma.device_terminate_all = at_xdmac_device_terminate_all; | 1416 | atxdmac->dma.device_terminate_all = at_xdmac_device_terminate_all; |
1431 | atxdmac->dma.device_slave_caps = at_xdmac_device_slave_caps; | 1417 | atxdmac->dma.src_addr_widths = AT_XDMAC_DMA_BUSWIDTHS; |
1418 | atxdmac->dma.dst_addr_widths = AT_XDMAC_DMA_BUSWIDTHS; | ||
1419 | atxdmac->dma.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); | ||
1420 | atxdmac->dma.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; | ||
1432 | 1421 | ||
1433 | /* Disable all chans and interrupts. */ | 1422 | /* Disable all chans and interrupts. */ |
1434 | at_xdmac_off(atxdmac); | 1423 | at_xdmac_off(atxdmac); |