diff options
author | Pannaga Bhushan <p.bhushan@samsung.com> | 2010-05-24 02:08:31 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-05-26 06:09:50 -0400 |
commit | 5fae405838527c136a920eb7b9a2edfc5d2b6198 (patch) | |
tree | 5d5bdf81c15d383c67632552d0a1f10efd31ee7c /arch/arm/plat-s5p/irq-eint.c | |
parent | b1cdc4670b9508fcd47a15fbd12f70d269880b37 (diff) |
ARM: S5P: Fix the platform external interrupt issues.
This patch does the following:
1. Corrects the common platform code for external interrupts for using the
VIC mask/unmask bits also.
2. Moves the common defines related to external interrupt for plat-s5p
to common files.
3. Based on the new common defines, corresponding changes are made in the
affected platforms (S5P6440, S5P6442 and S5PC100).
Signed-off-by: Pannaga Bhushan <p.bhushan@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s5p/irq-eint.c')
-rw-r--r-- | arch/arm/plat-s5p/irq-eint.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/arm/plat-s5p/irq-eint.c b/arch/arm/plat-s5p/irq-eint.c index eaa70aa0127b..e56c8075df97 100644 --- a/arch/arm/plat-s5p/irq-eint.c +++ b/arch/arm/plat-s5p/irq-eint.c | |||
@@ -60,7 +60,7 @@ static void s5p_irq_eint_maskack(unsigned int irq) | |||
60 | 60 | ||
61 | static int s5p_irq_eint_set_type(unsigned int irq, unsigned int type) | 61 | static int s5p_irq_eint_set_type(unsigned int irq, unsigned int type) |
62 | { | 62 | { |
63 | int offs = eint_offset(irq); | 63 | int offs = EINT_OFFSET(irq); |
64 | int shift; | 64 | int shift; |
65 | u32 ctrl, mask; | 65 | u32 ctrl, mask; |
66 | u32 newvalue = 0; | 66 | u32 newvalue = 0; |
@@ -139,17 +139,16 @@ static struct irq_chip s5p_irq_eint = { | |||
139 | */ | 139 | */ |
140 | static inline void s5p_irq_demux_eint(unsigned int start) | 140 | static inline void s5p_irq_demux_eint(unsigned int start) |
141 | { | 141 | { |
142 | u32 status; | 142 | u32 status = __raw_readl(S5P_EINT_PEND(EINT_REG_NR(start))); |
143 | u32 mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(start))); | 143 | u32 mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(start))); |
144 | unsigned int irq; | 144 | unsigned int irq; |
145 | 145 | ||
146 | status = __raw_readl(S5P_EINT_PEND(EINT_REG_NR(start))); | ||
147 | status &= ~mask; | 146 | status &= ~mask; |
148 | status &= 0xff; | 147 | status &= 0xff; |
149 | 148 | ||
150 | while (status) { | 149 | while (status) { |
151 | irq = fls(status); | 150 | irq = fls(status) - 1; |
152 | generic_handle_irq(irq - 1 + start); | 151 | generic_handle_irq(irq + start); |
153 | status &= ~(1 << irq); | 152 | status &= ~(1 << irq); |
154 | } | 153 | } |
155 | } | 154 | } |
@@ -162,12 +161,18 @@ static void s5p_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc) | |||
162 | 161 | ||
163 | static inline void s5p_irq_vic_eint_mask(unsigned int irq) | 162 | static inline void s5p_irq_vic_eint_mask(unsigned int irq) |
164 | { | 163 | { |
164 | void __iomem *base = get_irq_chip_data(irq); | ||
165 | |||
165 | s5p_irq_eint_mask(irq); | 166 | s5p_irq_eint_mask(irq); |
167 | writel(1 << EINT_OFFSET(irq), base + VIC_INT_ENABLE_CLEAR); | ||
166 | } | 168 | } |
167 | 169 | ||
168 | static void s5p_irq_vic_eint_unmask(unsigned int irq) | 170 | static void s5p_irq_vic_eint_unmask(unsigned int irq) |
169 | { | 171 | { |
172 | void __iomem *base = get_irq_chip_data(irq); | ||
173 | |||
170 | s5p_irq_eint_unmask(irq); | 174 | s5p_irq_eint_unmask(irq); |
175 | writel(1 << EINT_OFFSET(irq), base + VIC_INT_ENABLE); | ||
171 | } | 176 | } |
172 | 177 | ||
173 | static inline void s5p_irq_vic_eint_ack(unsigned int irq) | 178 | static inline void s5p_irq_vic_eint_ack(unsigned int irq) |