Re: [PATCH v7 1/7] ARM: common: vic: Parse interrupt and resume masks from device tree

2013-08-22 Thread Tomasz Figa
On Thursday 22 of August 2013 01:19:34 Linus Walleij wrote:
 On Wed, Aug 21, 2013 at 11:21 PM, Tomasz Figa tomasz.f...@gmail.com 
wrote:
  +++ b/Documentation/devicetree/bindings/arm/vic.txt
  
  @@ -18,6 +18,9 @@ Required properties:
   Optional properties:
   
   - interrupts : Interrupt source for parent controllers if the VIC is
   nested. 
  +- interrupt-mask : Bit mask of valid interrupt sources (defaults to
  all valid) +- wakeup-mask : Bit mask of interrupt sources that can
  wake up the system +  (defaults to all allowed)
 
 The interrupt-mask is called valid-mask on the FPGA IRQ controller
 See
 Documentation/devicetree/bindings/arm/versatile-fpga-irq.txt
 
 Example:
 
 reg = 0x1040 0x100;
 clear-mask = 0x;
 valid-mask = 0x0007;
 
 Please use the same name.

Oh, I haven't noticed that. Thanks for the information.

Best regards,
Tomasz

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v7 1/7] ARM: common: vic: Parse interrupt and resume masks from device tree

2013-08-21 Thread Tomasz Figa
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.f...@gmail.com
---
 Documentation/devicetree/bindings/arm/vic.txt | 6 ++
 drivers/irqchip/irq-vic.c | 7 ++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/arm/vic.txt 
b/Documentation/devicetree/bindings/arm/vic.txt
index 266716b..bb7137c 100644
--- a/Documentation/devicetree/bindings/arm/vic.txt
+++ b/Documentation/devicetree/bindings/arm/vic.txt
@@ -18,6 +18,9 @@ Required properties:
 Optional properties:
 
 - interrupts : Interrupt source for parent controllers if the VIC is nested.
+- interrupt-mask : Bit mask of valid interrupt sources (defaults to all valid)
+- wakeup-mask : Bit mask of interrupt sources that can wake up the system
+  (defaults to all allowed)
 
 Example:
 
@@ -26,4 +29,7 @@ Example:
interrupt-controller;
#interrupt-cells = 1;
reg = 0x6 0x1000;
+
+   interrupt-mask = 0xff7f;
+   wakeup-mask = 0xff7f;
};
diff --git a/drivers/irqchip/irq-vic.c b/drivers/irqchip/irq-vic.c
index 2bbb004..d56750eb 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,
 int __init vic_of_init(struct device_node *node, struct device_node *parent)
 {
void __iomem *regs;
+   u32 interrupt_mask = ~0;
+   u32 wakeup_mask = ~0;
 
if (WARN(parent, non-root VICs are not supported))
return -EINVAL;
@@ -477,10 +479,13 @@ int __init vic_of_init(struct device_node *node, struct 
device_node *parent)
if (WARN_ON(!regs))
return -EIO;
 
+   of_property_read_u32(node, interrupt-mask, interrupt_mask);
+   of_property_read_u32(node, wakeup-mask, wakeup_mask);
+
/*
 * Passing 0 as first IRQ makes the simple domain allocate descriptors
 */
-   __vic_init(regs, 0, ~0, ~0, node);
+   __vic_init(regs, 0, interrupt_mask, wakeup_mask, node);
 
return 0;
 }
-- 
1.8.3.2

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v7 1/7] ARM: common: vic: Parse interrupt and resume masks from device tree

2013-08-21 Thread Linus Walleij
On Wed, Aug 21, 2013 at 11:21 PM, Tomasz Figa tomasz.f...@gmail.com wrote:

 +++ b/Documentation/devicetree/bindings/arm/vic.txt
 @@ -18,6 +18,9 @@ Required properties:
  Optional properties:

  - interrupts : Interrupt source for parent controllers if the VIC is nested.
 +- interrupt-mask : Bit mask of valid interrupt sources (defaults to all 
 valid)
 +- wakeup-mask : Bit mask of interrupt sources that can wake up the system
 +  (defaults to all allowed)

The interrupt-mask is called valid-mask on the FPGA IRQ controller
See
Documentation/devicetree/bindings/arm/versatile-fpga-irq.txt

Example:

reg = 0x1040 0x100;
clear-mask = 0x;
valid-mask = 0x0007;

Please use the same name.

(wakeup-mask is fine).

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html