Skip to content

Commit 4a43d68

Browse files
tom3qglikely
authored andcommitted
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 <[email protected]> [grant.likely: Merged the two assignments to r->flags] Signed-off-by: Grant Likely <[email protected]>
1 parent 8804827 commit 4a43d68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/of/irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
354354
&name);
355355

356356
r->start = r->end = irq;
357-
r->flags = IORESOURCE_IRQ;
357+
r->flags = IORESOURCE_IRQ | irqd_get_trigger_type(irq_get_irq_data(irq));
358358
r->name = name ? name : of_node_full_name(dev);
359359
}
360360

0 commit comments

Comments
 (0)