Commit f4ccb745 authored by Justin Chen's avatar Justin Chen Committed by Marc Zyngier

irqchip/bcm7120-l2: Set controller as wake-up source

Utilize the Broadcom interrupt controller standard property
"brcm,irq-can-wake" to flag whether this particular interrupt controller
instance is wake-up capable.

Since we do not know what type of parent interrupt controller we are
interfaced with, ensure that enable_irq_wake() is called early on.
Signed-off-by: default avatarJustin Chen <justinpopo6@gmail.com>
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200709223016.989-2-f.fainelli@gmail.com
parent 8ebf642f
...@@ -143,6 +143,9 @@ static int bcm7120_l2_intc_init_one(struct device_node *dn, ...@@ -143,6 +143,9 @@ static int bcm7120_l2_intc_init_one(struct device_node *dn,
irq_set_chained_handler_and_data(parent_irq, irq_set_chained_handler_and_data(parent_irq,
bcm7120_l2_intc_irq_handle, l1_data); bcm7120_l2_intc_irq_handle, l1_data);
if (data->can_wake)
enable_irq_wake(parent_irq);
return 0; return 0;
} }
...@@ -247,6 +250,8 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn, ...@@ -247,6 +250,8 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn,
if (ret < 0) if (ret < 0)
goto out_free_l1_data; goto out_free_l1_data;
data->can_wake = of_property_read_bool(dn, "brcm,irq-can-wake");
for (irq = 0; irq < data->num_parent_irqs; irq++) { for (irq = 0; irq < data->num_parent_irqs; irq++) {
ret = bcm7120_l2_intc_init_one(dn, data, irq, valid_mask); ret = bcm7120_l2_intc_init_one(dn, data, irq, valid_mask);
if (ret) if (ret)
...@@ -274,9 +279,6 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn, ...@@ -274,9 +279,6 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn,
goto out_free_domain; goto out_free_domain;
} }
if (of_property_read_bool(dn, "brcm,irq-can-wake"))
data->can_wake = true;
for (idx = 0; idx < data->n_words; idx++) { for (idx = 0; idx < data->n_words; idx++) {
irq = idx * IRQS_PER_WORD; irq = idx * IRQS_PER_WORD;
gc = irq_get_domain_generic_chip(data->domain, irq); gc = irq_get_domain_generic_chip(data->domain, irq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment