diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-10-20 12:30:25 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-10-20 12:30:25 -0400 |
commit | 995a0605a6665858d73f9e80053414909be33f27 (patch) | |
tree | fcc66a6a77acdaae492f77c0c58c0233db74a2b4 /arch/arm/plat-s5p/irq-gpioint.c | |
parent | a32750c2ca6f697903b19063fc86f4272865e3a1 (diff) | |
parent | 677d3e2f07d1b3d6d2f76fd5552d16a53b9236a0 (diff) |
Merge branch 'at91/trng' into next/driver
Diffstat (limited to 'arch/arm/plat-s5p/irq-gpioint.c')
-rw-r--r-- | arch/arm/plat-s5p/irq-gpioint.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/arm/plat-s5p/irq-gpioint.c b/arch/arm/plat-s5p/irq-gpioint.c index 327ab9f662e8..f88216d23991 100644 --- a/arch/arm/plat-s5p/irq-gpioint.c +++ b/arch/arm/plat-s5p/irq-gpioint.c | |||
@@ -23,6 +23,8 @@ | |||
23 | #include <plat/gpio-core.h> | 23 | #include <plat/gpio-core.h> |
24 | #include <plat/gpio-cfg.h> | 24 | #include <plat/gpio-cfg.h> |
25 | 25 | ||
26 | #include <asm/mach/irq.h> | ||
27 | |||
26 | #define GPIO_BASE(chip) (((unsigned long)(chip)->base) & 0xFFFFF000u) | 28 | #define GPIO_BASE(chip) (((unsigned long)(chip)->base) & 0xFFFFF000u) |
27 | 29 | ||
28 | #define CON_OFFSET 0x700 | 30 | #define CON_OFFSET 0x700 |
@@ -81,6 +83,9 @@ static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc) | |||
81 | int group, pend_offset, mask_offset; | 83 | int group, pend_offset, mask_offset; |
82 | unsigned int pend, mask; | 84 | unsigned int pend, mask; |
83 | 85 | ||
86 | struct irq_chip *chip = irq_get_chip(irq); | ||
87 | chained_irq_enter(chip, desc); | ||
88 | |||
84 | for (group = 0; group < bank->nr_groups; group++) { | 89 | for (group = 0; group < bank->nr_groups; group++) { |
85 | struct s3c_gpio_chip *chip = bank->chips[group]; | 90 | struct s3c_gpio_chip *chip = bank->chips[group]; |
86 | if (!chip) | 91 | if (!chip) |
@@ -102,23 +107,25 @@ static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc) | |||
102 | pend &= ~BIT(offset); | 107 | pend &= ~BIT(offset); |
103 | } | 108 | } |
104 | } | 109 | } |
110 | chained_irq_exit(chip, desc); | ||
105 | } | 111 | } |
106 | 112 | ||
107 | static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip) | 113 | static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip) |
108 | { | 114 | { |
109 | static int used_gpioint_groups = 0; | 115 | static int used_gpioint_groups = 0; |
110 | int group = chip->group; | 116 | int group = chip->group; |
111 | struct s5p_gpioint_bank *bank = NULL; | 117 | struct s5p_gpioint_bank *b, *bank = NULL; |
112 | struct irq_chip_generic *gc; | 118 | struct irq_chip_generic *gc; |
113 | struct irq_chip_type *ct; | 119 | struct irq_chip_type *ct; |
114 | 120 | ||
115 | if (used_gpioint_groups >= S5P_GPIOINT_GROUP_COUNT) | 121 | if (used_gpioint_groups >= S5P_GPIOINT_GROUP_COUNT) |
116 | return -ENOMEM; | 122 | return -ENOMEM; |
117 | 123 | ||
118 | list_for_each_entry(bank, &banks, list) { | 124 | list_for_each_entry(b, &banks, list) { |
119 | if (group >= bank->start && | 125 | if (group >= b->start && group < b->start + b->nr_groups) { |
120 | group < bank->start + bank->nr_groups) | 126 | bank = b; |
121 | break; | 127 | break; |
128 | } | ||
122 | } | 129 | } |
123 | if (!bank) | 130 | if (!bank) |
124 | return -EINVAL; | 131 | return -EINVAL; |