aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-04-20 03:02:03 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-04-25 07:57:07 -0400
commitfa943bed68c85e1ebac4b9dd6398ad6fd0f53567 (patch)
treecb89076b24ef3c58c2aa901569300ed90195b1c7 /arch/arm
parent98fab064d321f740fde24785d1421523d249fc0e (diff)
ARM: 7394/1: VIC: respect list of valid sources
The current IRQ domain implementation in the VIC allocates 32 interrupts for each VIC instance no matter whether the controller actually use all the IRQs or not. Alter this so we only allocate a domain up until the last IRQ marked valid. Cc: Will Deacon <will.deacon@arm.com> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Rob Herring <rob.herring@calxeda.com> Acked-by: Jamie Iles <jamie@jamieiles.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/common/vic.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index 7e288f96cedf..c558a3e7f52e 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -168,6 +168,7 @@ late_initcall(vic_pm_init);
168 * vic_register() - Register a VIC. 168 * vic_register() - Register a VIC.
169 * @base: The base address of the VIC. 169 * @base: The base address of the VIC.
170 * @irq: The base IRQ for the VIC. 170 * @irq: The base IRQ for the VIC.
171 * @valid_sources: bitmask of valid interrupts
171 * @resume_sources: bitmask of interrupts allowed for resume sources. 172 * @resume_sources: bitmask of interrupts allowed for resume sources.
172 * @node: The device tree node associated with the VIC. 173 * @node: The device tree node associated with the VIC.
173 * 174 *
@@ -178,7 +179,8 @@ late_initcall(vic_pm_init);
178 * This also configures the IRQ domain for the VIC. 179 * This also configures the IRQ domain for the VIC.
179 */ 180 */
180static void __init vic_register(void __iomem *base, unsigned int irq, 181static void __init vic_register(void __iomem *base, unsigned int irq,
181 u32 resume_sources, struct device_node *node) 182 u32 valid_sources, u32 resume_sources,
183 struct device_node *node)
182{ 184{
183 struct vic_device *v; 185 struct vic_device *v;
184 186
@@ -192,8 +194,8 @@ static void __init vic_register(void __iomem *base, unsigned int irq,
192 v->resume_sources = resume_sources; 194 v->resume_sources = resume_sources;
193 v->irq = irq; 195 v->irq = irq;
194 vic_id++; 196 vic_id++;
195 v->domain = irq_domain_add_legacy(node, 32, irq, 0, 197 v->domain = irq_domain_add_legacy(node, fls(valid_sources), irq, 0,
196 &irq_domain_simple_ops, v); 198 &vic_irqdomain_ops, v);
197} 199}
198 200
199static void vic_ack_irq(struct irq_data *d) 201static void vic_ack_irq(struct irq_data *d)
@@ -339,7 +341,7 @@ static void __init vic_init_st(void __iomem *base, unsigned int irq_start,
339 } 341 }
340 342
341 vic_set_irq_sources(base, irq_start, vic_sources); 343 vic_set_irq_sources(base, irq_start, vic_sources);
342 vic_register(base, irq_start, 0, node); 344 vic_register(base, irq_start, vic_sources, 0, node);
343} 345}
344 346
345void __init __vic_init(void __iomem *base, unsigned int irq_start, 347void __init __vic_init(void __iomem *base, unsigned int irq_start,
@@ -381,7 +383,7 @@ void __init __vic_init(void __iomem *base, unsigned int irq_start,
381 383
382 vic_set_irq_sources(base, irq_start, vic_sources); 384 vic_set_irq_sources(base, irq_start, vic_sources);
383 385
384 vic_register(base, irq_start, resume_sources, node); 386 vic_register(base, irq_start, vic_sources, resume_sources, node);
385} 387}
386 388
387/** 389/**