diff options
Diffstat (limited to 'drivers/dma/shdma.c')
-rw-r--r-- | drivers/dma/shdma.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c index 7cc31b3f40d8..ed3ef22e68a4 100644 --- a/drivers/dma/shdma.c +++ b/drivers/dma/shdma.c | |||
@@ -26,8 +26,7 @@ | |||
26 | #include <linux/dma-mapping.h> | 26 | #include <linux/dma-mapping.h> |
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/pm_runtime.h> | 28 | #include <linux/pm_runtime.h> |
29 | 29 | #include <linux/sh_dma.h> | |
30 | #include <asm/dmaengine.h> | ||
31 | 30 | ||
32 | #include "shdma.h" | 31 | #include "shdma.h" |
33 | 32 | ||
@@ -45,7 +44,7 @@ enum sh_dmae_desc_status { | |||
45 | #define LOG2_DEFAULT_XFER_SIZE 2 | 44 | #define LOG2_DEFAULT_XFER_SIZE 2 |
46 | 45 | ||
47 | /* A bitmask with bits enough for enum sh_dmae_slave_chan_id */ | 46 | /* A bitmask with bits enough for enum sh_dmae_slave_chan_id */ |
48 | static unsigned long sh_dmae_slave_used[BITS_TO_LONGS(SHDMA_SLAVE_NUMBER)]; | 47 | static unsigned long sh_dmae_slave_used[BITS_TO_LONGS(SH_DMA_SLAVE_NUMBER)]; |
49 | 48 | ||
50 | static void sh_dmae_chan_ld_cleanup(struct sh_dmae_chan *sh_chan, bool all); | 49 | static void sh_dmae_chan_ld_cleanup(struct sh_dmae_chan *sh_chan, bool all); |
51 | 50 | ||
@@ -267,7 +266,7 @@ static struct sh_desc *sh_dmae_get_desc(struct sh_dmae_chan *sh_chan) | |||
267 | } | 266 | } |
268 | 267 | ||
269 | static struct sh_dmae_slave_config *sh_dmae_find_slave( | 268 | static struct sh_dmae_slave_config *sh_dmae_find_slave( |
270 | struct sh_dmae_chan *sh_chan, enum sh_dmae_slave_chan_id slave_id) | 269 | struct sh_dmae_chan *sh_chan, struct sh_dmae_slave *param) |
271 | { | 270 | { |
272 | struct dma_device *dma_dev = sh_chan->common.device; | 271 | struct dma_device *dma_dev = sh_chan->common.device; |
273 | struct sh_dmae_device *shdev = container_of(dma_dev, | 272 | struct sh_dmae_device *shdev = container_of(dma_dev, |
@@ -275,11 +274,11 @@ static struct sh_dmae_slave_config *sh_dmae_find_slave( | |||
275 | struct sh_dmae_pdata *pdata = shdev->pdata; | 274 | struct sh_dmae_pdata *pdata = shdev->pdata; |
276 | int i; | 275 | int i; |
277 | 276 | ||
278 | if ((unsigned)slave_id >= SHDMA_SLAVE_NUMBER) | 277 | if (param->slave_id >= SH_DMA_SLAVE_NUMBER) |
279 | return NULL; | 278 | return NULL; |
280 | 279 | ||
281 | for (i = 0; i < pdata->slave_num; i++) | 280 | for (i = 0; i < pdata->slave_num; i++) |
282 | if (pdata->slave[i].slave_id == slave_id) | 281 | if (pdata->slave[i].slave_id == param->slave_id) |
283 | return pdata->slave + i; | 282 | return pdata->slave + i; |
284 | 283 | ||
285 | return NULL; | 284 | return NULL; |
@@ -300,7 +299,7 @@ static int sh_dmae_alloc_chan_resources(struct dma_chan *chan) | |||
300 | if (param) { | 299 | if (param) { |
301 | struct sh_dmae_slave_config *cfg; | 300 | struct sh_dmae_slave_config *cfg; |
302 | 301 | ||
303 | cfg = sh_dmae_find_slave(sh_chan, param->slave_id); | 302 | cfg = sh_dmae_find_slave(sh_chan, param); |
304 | if (!cfg) | 303 | if (!cfg) |
305 | return -EINVAL; | 304 | return -EINVAL; |
306 | 305 | ||
@@ -795,7 +794,7 @@ static irqreturn_t sh_dmae_interrupt(int irq, void *data) | |||
795 | return ret; | 794 | return ret; |
796 | } | 795 | } |
797 | 796 | ||
798 | #if defined(CONFIG_CPU_SH4) | 797 | #if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_SHMOBILE) |
799 | static irqreturn_t sh_dmae_err(int irq, void *data) | 798 | static irqreturn_t sh_dmae_err(int irq, void *data) |
800 | { | 799 | { |
801 | struct sh_dmae_device *shdev = (struct sh_dmae_device *)data; | 800 | struct sh_dmae_device *shdev = (struct sh_dmae_device *)data; |
@@ -1036,7 +1035,7 @@ static int __init sh_dmae_probe(struct platform_device *pdev) | |||
1036 | /* Default transfer size of 32 bytes requires 32-byte alignment */ | 1035 | /* Default transfer size of 32 bytes requires 32-byte alignment */ |
1037 | shdev->common.copy_align = LOG2_DEFAULT_XFER_SIZE; | 1036 | shdev->common.copy_align = LOG2_DEFAULT_XFER_SIZE; |
1038 | 1037 | ||
1039 | #if defined(CONFIG_CPU_SH4) | 1038 | #if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_SHMOBILE) |
1040 | chanirq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 1); | 1039 | chanirq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 1); |
1041 | 1040 | ||
1042 | if (!chanirq_res) | 1041 | if (!chanirq_res) |
@@ -1061,7 +1060,7 @@ static int __init sh_dmae_probe(struct platform_device *pdev) | |||
1061 | 1060 | ||
1062 | #else | 1061 | #else |
1063 | chanirq_res = errirq_res; | 1062 | chanirq_res = errirq_res; |
1064 | #endif /* CONFIG_CPU_SH4 */ | 1063 | #endif /* CONFIG_CPU_SH4 || CONFIG_ARCH_SHMOBILE */ |
1065 | 1064 | ||
1066 | if (chanirq_res->start == chanirq_res->end && | 1065 | if (chanirq_res->start == chanirq_res->end && |
1067 | !platform_get_resource(pdev, IORESOURCE_IRQ, 1)) { | 1066 | !platform_get_resource(pdev, IORESOURCE_IRQ, 1)) { |
@@ -1108,7 +1107,7 @@ static int __init sh_dmae_probe(struct platform_device *pdev) | |||
1108 | chan_probe_err: | 1107 | chan_probe_err: |
1109 | sh_dmae_chan_remove(shdev); | 1108 | sh_dmae_chan_remove(shdev); |
1110 | eirqres: | 1109 | eirqres: |
1111 | #if defined(CONFIG_CPU_SH4) | 1110 | #if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_SHMOBILE) |
1112 | free_irq(errirq, shdev); | 1111 | free_irq(errirq, shdev); |
1113 | eirq_err: | 1112 | eirq_err: |
1114 | #endif | 1113 | #endif |