diff options
author | Tomasz Figa <tomasz.figa@gmail.com> | 2013-04-21 01:56:00 +0200 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 11:44:08 +0900 |
commit | a0927258d07fd61654a1e59a509d9ed691418ccd (patch) | |
tree | 7161701022dd0705e97f84dcaac0920619f87dec | |
parent | c334fd7d791ea6cf4de3b5ff5206f599c54262b3 (diff) | |
download | linux-3.10-a0927258d07fd61654a1e59a509d9ed691418ccd.tar.gz linux-3.10-a0927258d07fd61654a1e59a509d9ed691418ccd.tar.bz2 linux-3.10-a0927258d07fd61654a1e59a509d9ed691418ccd.zip |
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 <tomasz.figa@gmail.com>
-rw-r--r-- | drivers/of/irq.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/of/irq.c b/drivers/of/irq.c index a3c1c5aae6a..79a7a263830 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -355,6 +355,16 @@ int of_irq_to_resource(struct device_node *dev, int index, struct resource *r) r->start = r->end = irq; r->flags = IORESOURCE_IRQ; r->name = name ? name : dev->full_name; + + /* + * Some drivers might rely on availability of trigger flags + * in IRQ resource. Since irq_of_parse_and_map() configures the + * trigger based on interrupt specifier and IRQD_TRIGGER_* + * flags are consistent with IORESOURCE_IRQ_*, we can get + * trigger type that was just set and pass it through resource + * flags as well. + */ + r->flags |= irqd_get_trigger_type(irq_get_irq_data(irq)); } return irq; |