genirq: Add irqchip_set_wake_parent
authorMarc Zyngier <marc.zyngier@arm.com>
Wed, 11 Mar 2015 15:43:43 +0000 (15:43 +0000)
committerJason Cooper <jason@lakedaemon.net>
Sun, 15 Mar 2015 00:55:01 +0000 (00:55 +0000)
This proves to be useful with stacked domains, when the current
domain doesn't implement wake-up, but expect the parent to do so.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Link: https://lkml.kernel.org/r/1426088629-15377-2-git-send-email-marc.zyngier@arm.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
include/linux/irq.h
kernel/irq/chip.c

index d09ec7a1243e767dd95df2a4cc1d54775da0eb25..3057c48e4933b3a21b184b15a751c69cbffd5676 100644 (file)
@@ -460,6 +460,7 @@ extern void irq_chip_eoi_parent(struct irq_data *data);
 extern int irq_chip_set_affinity_parent(struct irq_data *data,
                                        const struct cpumask *dest,
                                        bool force);
+extern int irq_chip_set_wake_parent(struct irq_data *data, unsigned int on);
 #endif
 
 /* Handling of unhandled and spurious interrupts: */
index 6f1c7a566b95d4da4b4ef80a0450c28122915dac..eb9a4ea394ab33fdde25420f11cb9021df384824 100644 (file)
@@ -948,6 +948,22 @@ int irq_chip_retrigger_hierarchy(struct irq_data *data)
 
        return -ENOSYS;
 }
+
+/**
+ * irq_chip_set_wake_parent - Set/reset wake-up on the parent interrupt
+ * @data:      Pointer to interrupt specific data
+ * @on:                Whether to set or reset the wake-up capability of this irq
+ *
+ * Conditional, as the underlying parent chip might not implement it.
+ */
+int irq_chip_set_wake_parent(struct irq_data *data, unsigned int on)
+{
+       data = data->parent_data;
+       if (data->chip->irq_set_wake)
+               return data->chip->irq_set_wake(data, on);
+
+       return -ENOSYS;
+}
 #endif
 
 /**