]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
of/irq: Pass trigger type in IRQ resource flags
authorTomasz Figa <tomasz.figa@gmail.com>
Sat, 28 Sep 2013 17:52:51 +0000 (19:52 +0200)
committerGrant Likely <grant.likely@linaro.org>
Tue, 15 Oct 2013 19:09:20 +0000 (20:09 +0100)
Some drivers might rely on availability of trigger flags in IRQ
resource, for example to configure the hardware for particular interrupt
type. However current code creating IRQ resources from data in device
tree does not configure trigger flags in resulting resources.

This patch tries to solve the problem, based on the fact that
irq_of_parse_and_map() configures the trigger based on DT interrupt
specifier and IRQD_TRIGGER_* flags are consistent with IORESOURCE_IRQ_*,
and we can get correct trigger flags by calling irqd_get_trigger_type()
after mapping the interrupt.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
[grant.likely: Merged the two assignments to r->flags]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
drivers/of/irq.c

index f5fa5d84aa062c63c4ee13c1840eaa97e67f2326..90068f91491152da9d6445bd50cfbec1a5e163b0 100644 (file)
@@ -354,7 +354,7 @@ int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
                                              &name);
 
                r->start = r->end = irq;
-               r->flags = IORESOURCE_IRQ;
+               r->flags = IORESOURCE_IRQ | irqd_get_trigger_type(irq_get_irq_data(irq));
                r->name = name ? name : of_node_full_name(dev);
        }