base-files: define yes/no as valid boolean options
[openwrt.git] / target / linux / mvebu / patches-3.10 / 0182-of-irq-Pass-trigger-type-in-IRQ-resource-flags.patch
1 From 4bd60065fb935a5d390c9a442be3a18d2ea18eee Mon Sep 17 00:00:00 2001
2 From: Tomasz Figa <tomasz.figa@gmail.com>
3 Date: Thu, 19 Dec 2013 09:30:53 -0300
4 Subject: [PATCH 182/203] of/irq: Pass trigger type in IRQ resource flags
5
6 Some drivers might rely on availability of trigger flags in IRQ
7 resource, for example to configure the hardware for particular interrupt
8 type. However current code creating IRQ resources from data in device
9 tree does not configure trigger flags in resulting resources.
10
11 This patch tries to solve the problem, based on the fact that
12 irq_of_parse_and_map() configures the trigger based on DT interrupt
13 specifier and IRQD_TRIGGER_* flags are consistent with IORESOURCE_IRQ_*,
14 and we can get correct trigger flags by calling irqd_get_trigger_type()
15 after mapping the interrupt.
16
17 Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
18 [grant.likely: Merged the two assignments to r->flags]
19 Signed-off-by: Grant Likely <grant.likely@linaro.org>
20 ---
21  drivers/of/irq.c | 2 +-
22  1 file changed, 1 insertion(+), 1 deletion(-)
23
24 --- a/drivers/of/irq.c
25 +++ b/drivers/of/irq.c
26 @@ -360,7 +360,7 @@ int of_irq_to_resource(struct device_nod
27                                               &name);
28  
29                 r->start = r->end = irq;
30 -               r->flags = IORESOURCE_IRQ;
31 +               r->flags = IORESOURCE_IRQ | irqd_get_trigger_type(irq_get_irq_data(irq));
32                 r->name = name ? name : of_node_full_name(dev);
33         }
34