From: Tomasz Figa Date: Sat, 28 Sep 2013 17:52:51 +0000 (+0200) Subject: of/irq: Pass trigger type in IRQ resource flags X-Git-Tag: firefly_0821_release~3680^2~19^2~7^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a317907a68af5f1509b1b38e3bf378a5178f1c3a;p=firefly-linux-kernel-4.4.55.git of/irq: Pass trigger type in IRQ resource flags 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 [grant.likely: Merged the two assignments to r->flags] Signed-off-by: Grant Likely (cherry picked from commit 4a43d686fe336cc0e955c4400ba4d3fcff788786) Signed-off-by: Mark Brown --- diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 6953dfd1fbbd..5ecb3d83b212 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -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); }