diff options
-rw-r--r-- | Documentation/devicetree/bindings/arm/versatile-fpga-irq.txt | 5 | ||||
-rw-r--r-- | drivers/irqchip/irq-versatile-fpga.c | 15 |
2 files changed, 18 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/arm/versatile-fpga-irq.txt b/Documentation/devicetree/bindings/arm/versatile-fpga-irq.txt index 9989eda755d9..c9cf605bb995 100644 --- a/Documentation/devicetree/bindings/arm/versatile-fpga-irq.txt +++ b/Documentation/devicetree/bindings/arm/versatile-fpga-irq.txt | |||
@@ -29,3 +29,8 @@ pic: pic@14000000 { | |||
29 | clear-mask = <0xffffffff>; | 29 | clear-mask = <0xffffffff>; |
30 | valid-mask = <0x003fffff>; | 30 | valid-mask = <0x003fffff>; |
31 | }; | 31 | }; |
32 | |||
33 | Optional properties: | ||
34 | - interrupts: if the FPGA IRQ controller is cascaded, i.e. if its IRQ | ||
35 | output is simply connected to the input of another IRQ controller, | ||
36 | then the parent IRQ shall be specified in this property. | ||
diff --git a/drivers/irqchip/irq-versatile-fpga.c b/drivers/irqchip/irq-versatile-fpga.c index 47a52ab580d8..3ae2bb8d9cf2 100644 --- a/drivers/irqchip/irq-versatile-fpga.c +++ b/drivers/irqchip/irq-versatile-fpga.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | #include <linux/of.h> | 10 | #include <linux/of.h> |
11 | #include <linux/of_address.h> | 11 | #include <linux/of_address.h> |
12 | #include <linux/of_irq.h> | ||
12 | 13 | ||
13 | #include <asm/exception.h> | 14 | #include <asm/exception.h> |
14 | #include <asm/mach/irq.h> | 15 | #include <asm/mach/irq.h> |
@@ -167,8 +168,12 @@ void __init fpga_irq_init(void __iomem *base, const char *name, int irq_start, | |||
167 | f->used_irqs++; | 168 | f->used_irqs++; |
168 | } | 169 | } |
169 | 170 | ||
170 | pr_info("FPGA IRQ chip %d \"%s\" @ %p, %u irqs\n", | 171 | pr_info("FPGA IRQ chip %d \"%s\" @ %p, %u irqs", |
171 | fpga_irq_id, name, base, f->used_irqs); | 172 | fpga_irq_id, name, base, f->used_irqs); |
173 | if (parent_irq != -1) | ||
174 | pr_cont(", parent IRQ: %d\n", parent_irq); | ||
175 | else | ||
176 | pr_cont("\n"); | ||
172 | 177 | ||
173 | fpga_irq_id++; | 178 | fpga_irq_id++; |
174 | } | 179 | } |
@@ -180,6 +185,7 @@ int __init fpga_irq_of_init(struct device_node *node, | |||
180 | void __iomem *base; | 185 | void __iomem *base; |
181 | u32 clear_mask; | 186 | u32 clear_mask; |
182 | u32 valid_mask; | 187 | u32 valid_mask; |
188 | int parent_irq; | ||
183 | 189 | ||
184 | if (WARN_ON(!node)) | 190 | if (WARN_ON(!node)) |
185 | return -ENODEV; | 191 | return -ENODEV; |
@@ -193,7 +199,12 @@ int __init fpga_irq_of_init(struct device_node *node, | |||
193 | if (of_property_read_u32(node, "valid-mask", &valid_mask)) | 199 | if (of_property_read_u32(node, "valid-mask", &valid_mask)) |
194 | valid_mask = 0; | 200 | valid_mask = 0; |
195 | 201 | ||
196 | fpga_irq_init(base, node->name, 0, -1, valid_mask, node); | 202 | /* Some chips are cascaded from a parent IRQ */ |
203 | parent_irq = irq_of_parse_and_map(node, 0); | ||
204 | if (!parent_irq) | ||
205 | parent_irq = -1; | ||
206 | |||
207 | fpga_irq_init(base, node->name, 0, parent_irq, valid_mask, node); | ||
197 | 208 | ||
198 | writel(clear_mask, base + IRQ_ENABLE_CLEAR); | 209 | writel(clear_mask, base + IRQ_ENABLE_CLEAR); |
199 | writel(clear_mask, base + FIQ_ENABLE_CLEAR); | 210 | writel(clear_mask, base + FIQ_ENABLE_CLEAR); |