regulator: max8973: add support for interrupt flags from DT
Laxman Dewangan [Tue, 19 May 2015 12:47:54 +0000 (17:47 +0530)]
Add support to read interrupt flags from DT for the given
platform. For ARM GIC interrupt controller, it is not possible
to send all irq flags through interrupt cells.

bug 1636415

Change-Id: Ic1b060b4a32d5d06414dfbca873909b2499f5fcb
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/744893

Documentation/devicetree/bindings/regulator/max8973-regulator.txt
drivers/regulator/max8973-regulator.c

index f781f11..ba6b84d 100644 (file)
@@ -11,6 +11,10 @@ Any standard regulator properties can be used to configure the single max8973
 DCDC.
 
 Optional properties:
+- interrupts: Interrupt number can be provided as detailed on
+       Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
+- interrupt-flags: Provide interrupt flags as per
+       include/dt-bindings/interrupt-controller/irq.h.
 - maxim,externally-enable: Boolean property which tells whether EN pin control
        the output enable or not.
 - maxim,dvs-gpio: DVS gpio. GPIO on which DVS pin is connected.
index 67c80a9..203a5f0 100644 (file)
@@ -604,6 +604,9 @@ static struct max8973_regulator_platform_data *max8973_parse_dt(
 
        if (irq_data) {
                pdata->irq_flags = irqd_get_trigger_type(irq_data);
+               pval = 0;
+               ret = of_property_read_u32(np, "interrupt-flags", &pval);
+               pdata->irq_flags |= (ret) ? 0 : pval;
                dev_info(dev, "Irq flag is 0x%08x\n", pdata->irq_flags);
        }
        return pdata;