diff options
author | Tomasz Figa <tomasz.figa@gmail.com> | 2013-08-25 13:37:24 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2013-09-16 17:48:27 -0400 |
commit | 81e9c1794f24376b0515756e300476d9fec77c0b (patch) | |
tree | 2b72dc49bfcbea22a5824ebf78166af630add6dc | |
parent | 66fcbe6b7c2827866100837611c9838298a28486 (diff) |
irqchip: vic: Parse interrupt and resume masks from device tree
This patch extends vic_of_init to parse valid interrupt sources
and resume sources masks from device tree.
If mask values are not specified in device tree, all sources
are assumed to be valid, as before this patch.
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r-- | Documentation/devicetree/bindings/arm/vic.txt | 12 | ||||
-rw-r--r-- | drivers/irqchip/irq-vic.c | 7 |
2 files changed, 18 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/arm/vic.txt b/Documentation/devicetree/bindings/arm/vic.txt index 266716b23437..dd527216c5fb 100644 --- a/Documentation/devicetree/bindings/arm/vic.txt +++ b/Documentation/devicetree/bindings/arm/vic.txt | |||
@@ -18,6 +18,15 @@ Required properties: | |||
18 | Optional properties: | 18 | Optional properties: |
19 | 19 | ||
20 | - interrupts : Interrupt source for parent controllers if the VIC is nested. | 20 | - interrupts : Interrupt source for parent controllers if the VIC is nested. |
21 | - valid-mask : A one cell big bit mask of valid interrupt sources. Each bit | ||
22 | represents single interrupt source, starting from source 0 at LSb and ending | ||
23 | at source 31 at MSb. A bit that is set means that the source is wired and | ||
24 | clear means otherwise. If unspecified, defaults to all valid. | ||
25 | - valid-wakeup-mask : A one cell big bit mask of interrupt sources that can be | ||
26 | configured as wake up source for the system. Order of bits is the same as for | ||
27 | valid-mask property. A set bit means that this interrupt source can be | ||
28 | configured as a wake up source for the system. If unspecied, defaults to all | ||
29 | interrupt sources configurable as wake up sources. | ||
21 | 30 | ||
22 | Example: | 31 | Example: |
23 | 32 | ||
@@ -26,4 +35,7 @@ Example: | |||
26 | interrupt-controller; | 35 | interrupt-controller; |
27 | #interrupt-cells = <1>; | 36 | #interrupt-cells = <1>; |
28 | reg = <0x60000 0x1000>; | 37 | reg = <0x60000 0x1000>; |
38 | |||
39 | valid-mask = <0xffffff7f>; | ||
40 | valid-wakeup-mask = <0x0000ff7f>; | ||
29 | }; | 41 | }; |
diff --git a/drivers/irqchip/irq-vic.c b/drivers/irqchip/irq-vic.c index 2bbb00404cf5..8e21ae0bab46 100644 --- a/drivers/irqchip/irq-vic.c +++ b/drivers/irqchip/irq-vic.c | |||
@@ -469,6 +469,8 @@ void __init vic_init(void __iomem *base, unsigned int irq_start, | |||
469 | int __init vic_of_init(struct device_node *node, struct device_node *parent) | 469 | int __init vic_of_init(struct device_node *node, struct device_node *parent) |
470 | { | 470 | { |
471 | void __iomem *regs; | 471 | void __iomem *regs; |
472 | u32 interrupt_mask = ~0; | ||
473 | u32 wakeup_mask = ~0; | ||
472 | 474 | ||
473 | if (WARN(parent, "non-root VICs are not supported")) | 475 | if (WARN(parent, "non-root VICs are not supported")) |
474 | return -EINVAL; | 476 | return -EINVAL; |
@@ -477,10 +479,13 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent) | |||
477 | if (WARN_ON(!regs)) | 479 | if (WARN_ON(!regs)) |
478 | return -EIO; | 480 | return -EIO; |
479 | 481 | ||
482 | of_property_read_u32(node, "valid-mask", &interrupt_mask); | ||
483 | of_property_read_u32(node, "valid-wakeup-mask", &wakeup_mask); | ||
484 | |||
480 | /* | 485 | /* |
481 | * Passing 0 as first IRQ makes the simple domain allocate descriptors | 486 | * Passing 0 as first IRQ makes the simple domain allocate descriptors |
482 | */ | 487 | */ |
483 | __vic_init(regs, 0, ~0, ~0, node); | 488 | __vic_init(regs, 0, interrupt_mask, wakeup_mask, node); |
484 | 489 | ||
485 | return 0; | 490 | return 0; |
486 | } | 491 | } |