diff options
| -rw-r--r-- | arch/arm/mach-exynos/common.c | 3 | ||||
| -rw-r--r-- | arch/arm/mach-exynos/common.h | 2 | ||||
| -rw-r--r-- | drivers/irqchip/exynos-combiner.c | 23 |
3 files changed, 16 insertions, 12 deletions
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index 368fa4b01e7c..9208079d5d52 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c | |||
| @@ -447,7 +447,8 @@ void __init exynos4_init_irq(void) | |||
| 447 | #endif | 447 | #endif |
| 448 | 448 | ||
| 449 | if (!of_have_populated_dt()) | 449 | if (!of_have_populated_dt()) |
| 450 | combiner_init(S5P_VA_COMBINER_BASE, NULL, max_combiner_nr()); | 450 | combiner_init(S5P_VA_COMBINER_BASE, NULL, |
| 451 | max_combiner_nr(), COMBINER_IRQ(0, 0)); | ||
| 451 | 452 | ||
| 452 | /* | 453 | /* |
| 453 | * The parameters of s5p_init_irq() are for VIC init. | 454 | * The parameters of s5p_init_irq() are for VIC init. |
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index 4ba8cbecc144..3e72d03a385e 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h | |||
| @@ -70,7 +70,7 @@ void exynos4212_register_clocks(void); | |||
| 70 | 70 | ||
| 71 | struct device_node; | 71 | struct device_node; |
| 72 | void combiner_init(void __iomem *combiner_base, struct device_node *np, | 72 | void combiner_init(void __iomem *combiner_base, struct device_node *np, |
| 73 | unsigned int max_nr); | 73 | unsigned int max_nr, int irq_base); |
| 74 | 74 | ||
| 75 | extern struct smp_operations exynos_smp_ops; | 75 | extern struct smp_operations exynos_smp_ops; |
| 76 | 76 | ||
diff --git a/drivers/irqchip/exynos-combiner.c b/drivers/irqchip/exynos-combiner.c index acb9c74b070a..6855c92c2262 100644 --- a/drivers/irqchip/exynos-combiner.c +++ b/drivers/irqchip/exynos-combiner.c | |||
| @@ -206,27 +206,22 @@ static unsigned int combiner_lookup_irq(int group) | |||
| 206 | 206 | ||
| 207 | void __init combiner_init(void __iomem *combiner_base, | 207 | void __init combiner_init(void __iomem *combiner_base, |
| 208 | struct device_node *np, | 208 | struct device_node *np, |
| 209 | unsigned int max_nr) | 209 | unsigned int max_nr, |
| 210 | int irq_base) | ||
| 210 | { | 211 | { |
| 211 | int i, irq, irq_base; | 212 | int i, irq; |
| 212 | unsigned int nr_irq; | 213 | unsigned int nr_irq; |
| 213 | struct combiner_chip_data *combiner_data; | 214 | struct combiner_chip_data *combiner_data; |
| 214 | 215 | ||
| 215 | nr_irq = max_nr * IRQ_IN_COMBINER; | 216 | nr_irq = max_nr * IRQ_IN_COMBINER; |
| 216 | 217 | ||
| 217 | irq_base = irq_alloc_descs(COMBINER_IRQ(0, 0), 1, nr_irq, 0); | ||
| 218 | if (IS_ERR_VALUE(irq_base)) { | ||
| 219 | irq_base = COMBINER_IRQ(0, 0); | ||
| 220 | pr_warning("%s: irq desc alloc failed. Continuing with %d as linux irq base\n", __func__, irq_base); | ||
| 221 | } | ||
| 222 | |||
| 223 | combiner_data = kcalloc(max_nr, sizeof (*combiner_data), GFP_KERNEL); | 218 | combiner_data = kcalloc(max_nr, sizeof (*combiner_data), GFP_KERNEL); |
| 224 | if (!combiner_data) { | 219 | if (!combiner_data) { |
| 225 | pr_warning("%s: could not allocate combiner data\n", __func__); | 220 | pr_warning("%s: could not allocate combiner data\n", __func__); |
| 226 | return; | 221 | return; |
| 227 | } | 222 | } |
| 228 | 223 | ||
| 229 | combiner_irq_domain = irq_domain_add_legacy(np, nr_irq, irq_base, 0, | 224 | combiner_irq_domain = irq_domain_add_simple(np, nr_irq, irq_base, |
| 230 | &combiner_irq_domain_ops, combiner_data); | 225 | &combiner_irq_domain_ops, combiner_data); |
| 231 | if (WARN_ON(!combiner_irq_domain)) { | 226 | if (WARN_ON(!combiner_irq_domain)) { |
| 232 | pr_warning("%s: irq domain init failed\n", __func__); | 227 | pr_warning("%s: irq domain init failed\n", __func__); |
| @@ -253,6 +248,7 @@ static int __init combiner_of_init(struct device_node *np, | |||
| 253 | { | 248 | { |
| 254 | void __iomem *combiner_base; | 249 | void __iomem *combiner_base; |
| 255 | unsigned int max_nr = 20; | 250 | unsigned int max_nr = 20; |
| 251 | int irq_base = -1; | ||
| 256 | 252 | ||
| 257 | combiner_base = of_iomap(np, 0); | 253 | combiner_base = of_iomap(np, 0); |
| 258 | if (!combiner_base) { | 254 | if (!combiner_base) { |
| @@ -266,7 +262,14 @@ static int __init combiner_of_init(struct device_node *np, | |||
| 266 | __func__, max_nr); | 262 | __func__, max_nr); |
| 267 | } | 263 | } |
| 268 | 264 | ||
| 269 | combiner_init(combiner_base, np, max_nr); | 265 | /* |
| 266 | * FIXME: This is a hardwired COMBINER_IRQ(0,0). Once all devices | ||
| 267 | * get their IRQ from DT, remove this in order to get dynamic | ||
| 268 | * allocation. | ||
| 269 | */ | ||
| 270 | irq_base = 160; | ||
| 271 | |||
| 272 | combiner_init(combiner_base, np, max_nr, irq_base); | ||
| 270 | 273 | ||
| 271 | return 0; | 274 | return 0; |
| 272 | } | 275 | } |
