diff options
author | Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> | 2009-03-15 23:22:07 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-03-16 07:14:25 -0400 |
commit | 988f831df398ff36f67b095245060c24c354e9e9 (patch) | |
tree | 9ad8250800cbd01c501e3f2f14e3c2187c2d6b18 /arch/sh/drivers/dma | |
parent | 50cca715a64b66ccf173767d94d4020ea0a6129c (diff) |
sh: Move IRQ multi definition of DMAC to defconfig
When SuperH CPU has IRQ multi of DMAC, SH_DMA_IRQ_MULTI becomes enable.
The following CPU's are Multi IRQ of DMAC now.
- SH775X and SH7091
- SH776X
- SH7780
- SH7785
If SH_DMA_IRQ_MULTI becomes enable, dma-sh api driver is optimized
for Multi IRQ.
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/drivers/dma')
-rw-r--r-- | arch/sh/drivers/dma/Kconfig | 8 | ||||
-rw-r--r-- | arch/sh/drivers/dma/dma-sh.c | 17 |
2 files changed, 13 insertions, 12 deletions
diff --git a/arch/sh/drivers/dma/Kconfig b/arch/sh/drivers/dma/Kconfig index 57d95fce0464..32bb8fa605c2 100644 --- a/arch/sh/drivers/dma/Kconfig +++ b/arch/sh/drivers/dma/Kconfig | |||
@@ -9,6 +9,14 @@ config SH_DMA | |||
9 | select SH_DMA_API | 9 | select SH_DMA_API |
10 | default n | 10 | default n |
11 | 11 | ||
12 | config SH_DMA_IRQ_MULTI | ||
13 | bool | ||
14 | depends on SH_DMA | ||
15 | default y if CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7751 || \ | ||
16 | CPU_SUBTYPE_SH7750S || CPU_SUBTYPE_SH7750R || CPU_SUBTYPE_SH7751R || \ | ||
17 | CPU_SUBTYPE_SH7091 || CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7764 || \ | ||
18 | CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785 | ||
19 | |||
12 | config NR_ONCHIP_DMA_CHANNELS | 20 | config NR_ONCHIP_DMA_CHANNELS |
13 | int | 21 | int |
14 | depends on SH_DMA | 22 | depends on SH_DMA |
diff --git a/arch/sh/drivers/dma/dma-sh.c b/arch/sh/drivers/dma/dma-sh.c index 31c2930f2f54..37fb5b8bbc3f 100644 --- a/arch/sh/drivers/dma/dma-sh.c +++ b/arch/sh/drivers/dma/dma-sh.c | |||
@@ -19,13 +19,6 @@ | |||
19 | #include <asm/io.h> | 19 | #include <asm/io.h> |
20 | #include <asm/dma-sh.h> | 20 | #include <asm/dma-sh.h> |
21 | 21 | ||
22 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) || \ | ||
23 | defined(CONFIG_CPU_SUBTYPE_SH7764) || \ | ||
24 | defined(CONFIG_CPU_SUBTYPE_SH7780) || \ | ||
25 | defined(CONFIG_CPU_SUBTYPE_SH7785) | ||
26 | #define DMAC_IRQ_MULTI 1 | ||
27 | #endif | ||
28 | |||
29 | #if defined(DMAE1_IRQ) | 22 | #if defined(DMAE1_IRQ) |
30 | #define NR_DMAE 2 | 23 | #define NR_DMAE 2 |
31 | #else | 24 | #else |
@@ -42,7 +35,7 @@ static inline unsigned int get_dmte_irq(unsigned int chan) | |||
42 | if (chan < ARRAY_SIZE(dmte_irq_map)) | 35 | if (chan < ARRAY_SIZE(dmte_irq_map)) |
43 | irq = dmte_irq_map[chan]; | 36 | irq = dmte_irq_map[chan]; |
44 | 37 | ||
45 | #if defined(DMAC_IRQ_MULTI) | 38 | #if defined(CONFIG_SH_DMA_IRQ_MULTI) |
46 | if (irq > DMTE6_IRQ) | 39 | if (irq > DMTE6_IRQ) |
47 | return DMTE6_IRQ; | 40 | return DMTE6_IRQ; |
48 | return DMTE0_IRQ; | 41 | return DMTE0_IRQ; |
@@ -96,7 +89,7 @@ static int sh_dmac_request_dma(struct dma_channel *chan) | |||
96 | return 0; | 89 | return 0; |
97 | 90 | ||
98 | return request_irq(get_dmte_irq(chan->chan), dma_tei, | 91 | return request_irq(get_dmte_irq(chan->chan), dma_tei, |
99 | #if defined(DMAC_IRQ_MULTI) | 92 | #if defined(CONFIG_SH_DMA_IRQ_MULTI) |
100 | IRQF_SHARED, | 93 | IRQF_SHARED, |
101 | #else | 94 | #else |
102 | IRQF_DISABLED, | 95 | IRQF_DISABLED, |
@@ -235,7 +228,7 @@ static inline int dmaor_reset(int no) | |||
235 | #if defined(CONFIG_CPU_SH4) | 228 | #if defined(CONFIG_CPU_SH4) |
236 | static irqreturn_t dma_err(int irq, void *dummy) | 229 | static irqreturn_t dma_err(int irq, void *dummy) |
237 | { | 230 | { |
238 | #if defined(DMAC_IRQ_MULTI) | 231 | #if defined(CONFIG_SH_DMA_IRQ_MULTI) |
239 | int cnt = 0; | 232 | int cnt = 0; |
240 | switch (irq) { | 233 | switch (irq) { |
241 | #if defined(DMTE6_IRQ) && defined(DMAE1_IRQ) | 234 | #if defined(DMTE6_IRQ) && defined(DMAE1_IRQ) |
@@ -283,7 +276,7 @@ static struct dma_info sh_dmac_info = { | |||
283 | #ifdef CONFIG_CPU_SH4 | 276 | #ifdef CONFIG_CPU_SH4 |
284 | static unsigned int get_dma_error_irq(int n) | 277 | static unsigned int get_dma_error_irq(int n) |
285 | { | 278 | { |
286 | #if defined(DMAC_IRQ_MULTI) | 279 | #if defined(CONFIG_SH_DMA_IRQ_MULTI) |
287 | return (n == 0) ? get_dmte_irq(0) : get_dmte_irq(6); | 280 | return (n == 0) ? get_dmte_irq(0) : get_dmte_irq(6); |
288 | #else | 281 | #else |
289 | return (n == 0) ? DMAE0_IRQ : | 282 | return (n == 0) ? DMAE0_IRQ : |
@@ -306,7 +299,7 @@ static int __init sh_dmac_init(void) | |||
306 | 299 | ||
307 | for (n = 0; n < NR_DMAE; n++) { | 300 | for (n = 0; n < NR_DMAE; n++) { |
308 | i = request_irq(get_dma_error_irq(n), dma_err, | 301 | i = request_irq(get_dma_error_irq(n), dma_err, |
309 | #if defined(DMAC_IRQ_MULTI) | 302 | #if defined(CONFIG_SH_DMA_IRQ_MULTI) |
310 | IRQF_SHARED, | 303 | IRQF_SHARED, |
311 | #else | 304 | #else |
312 | IRQF_DISABLED, | 305 | IRQF_DISABLED, |