diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-05-10 12:16:10 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-07-07 04:00:00 -0400 |
commit | 5a24d69c2cd3522e5ed6f8bd7a1e956138149dcd (patch) | |
tree | 3ba9d253a24c293f8f976605a3dcfed7a64cb8c2 /arch/arm | |
parent | fe31ad41590daf9c5262b53cf6947f3be5c24b60 (diff) |
ARM i.MX avic: do not depend on MXC_INTERNAL_IRQS
This becomes meaningless in subsequent patches.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/plat-mxc/avic.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/arm/plat-mxc/avic.c b/arch/arm/plat-mxc/avic.c index 09e2bd0fcdca..55d2534ec727 100644 --- a/arch/arm/plat-mxc/avic.c +++ b/arch/arm/plat-mxc/avic.c | |||
@@ -46,6 +46,8 @@ | |||
46 | #define AVIC_FIPNDH 0x60 /* fast int pending high */ | 46 | #define AVIC_FIPNDH 0x60 /* fast int pending high */ |
47 | #define AVIC_FIPNDL 0x64 /* fast int pending low */ | 47 | #define AVIC_FIPNDL 0x64 /* fast int pending low */ |
48 | 48 | ||
49 | #define AVIC_NUM_IRQS 64 | ||
50 | |||
49 | void __iomem *avic_base; | 51 | void __iomem *avic_base; |
50 | 52 | ||
51 | #ifdef CONFIG_MXC_IRQ_PRIOR | 53 | #ifdef CONFIG_MXC_IRQ_PRIOR |
@@ -54,7 +56,7 @@ static int avic_irq_set_priority(unsigned char irq, unsigned char prio) | |||
54 | unsigned int temp; | 56 | unsigned int temp; |
55 | unsigned int mask = 0x0F << irq % 8 * 4; | 57 | unsigned int mask = 0x0F << irq % 8 * 4; |
56 | 58 | ||
57 | if (irq >= MXC_INTERNAL_IRQS) | 59 | if (irq >= AVIC_NUM_IRQS) |
58 | return -EINVAL;; | 60 | return -EINVAL;; |
59 | 61 | ||
60 | temp = __raw_readl(avic_base + AVIC_NIPRIORITY(irq / 8)); | 62 | temp = __raw_readl(avic_base + AVIC_NIPRIORITY(irq / 8)); |
@@ -72,14 +74,14 @@ static int avic_set_irq_fiq(unsigned int irq, unsigned int type) | |||
72 | { | 74 | { |
73 | unsigned int irqt; | 75 | unsigned int irqt; |
74 | 76 | ||
75 | if (irq >= MXC_INTERNAL_IRQS) | 77 | if (irq >= AVIC_NUM_IRQS) |
76 | return -EINVAL; | 78 | return -EINVAL; |
77 | 79 | ||
78 | if (irq < MXC_INTERNAL_IRQS / 2) { | 80 | if (irq < AVIC_NUM_IRQS / 2) { |
79 | irqt = __raw_readl(avic_base + AVIC_INTTYPEL) & ~(1 << irq); | 81 | irqt = __raw_readl(avic_base + AVIC_INTTYPEL) & ~(1 << irq); |
80 | __raw_writel(irqt | (!!type << irq), avic_base + AVIC_INTTYPEL); | 82 | __raw_writel(irqt | (!!type << irq), avic_base + AVIC_INTTYPEL); |
81 | } else { | 83 | } else { |
82 | irq -= MXC_INTERNAL_IRQS / 2; | 84 | irq -= AVIC_NUM_IRQS / 2; |
83 | irqt = __raw_readl(avic_base + AVIC_INTTYPEH) & ~(1 << irq); | 85 | irqt = __raw_readl(avic_base + AVIC_INTTYPEH) & ~(1 << irq); |
84 | __raw_writel(irqt | (!!type << irq), avic_base + AVIC_INTTYPEH); | 86 | __raw_writel(irqt | (!!type << irq), avic_base + AVIC_INTTYPEH); |
85 | } | 87 | } |
@@ -138,7 +140,7 @@ void __init mxc_init_irq(void __iomem *irqbase) | |||
138 | /* all IRQ no FIQ */ | 140 | /* all IRQ no FIQ */ |
139 | __raw_writel(0, avic_base + AVIC_INTTYPEH); | 141 | __raw_writel(0, avic_base + AVIC_INTTYPEH); |
140 | __raw_writel(0, avic_base + AVIC_INTTYPEL); | 142 | __raw_writel(0, avic_base + AVIC_INTTYPEL); |
141 | for (i = 0; i < MXC_INTERNAL_IRQS; i++) { | 143 | for (i = 0; i < AVIC_NUM_IRQS; i++) { |
142 | irq_set_chip_and_handler(i, &mxc_avic_chip.base, | 144 | irq_set_chip_and_handler(i, &mxc_avic_chip.base, |
143 | handle_level_irq); | 145 | handle_level_irq); |
144 | set_irq_flags(i, IRQF_VALID); | 146 | set_irq_flags(i, IRQF_VALID); |