irqdomain: Implement a method to automatically call parent domains alloc/free
[firefly-linux-kernel-4.4.55.git] / include / linux / irqdomain.h
index 7aca1adb68a17dcba44d83d856e685d0b3d3eaf9..dd2709bdad567d33b32c1eca0802712803b11bd4 100644 (file)
@@ -134,6 +134,9 @@ enum {
        /* Irq domain is hierarchical */
        IRQ_DOMAIN_FLAG_HIERARCHY       = (1 << 0),
 
+       /* Core calls alloc/free recursive through the domain hierarchy. */
+       IRQ_DOMAIN_FLAG_AUTO_RECURSIVE  = (1 << 1),
+
        /*
         * Flags starting from IRQ_DOMAIN_FLAG_NONCORE are reserved
         * for implementation specific purposes and ignored by the
@@ -285,22 +288,13 @@ extern void irq_domain_free_irqs_common(struct irq_domain *domain,
 extern void irq_domain_free_irqs_top(struct irq_domain *domain,
                                     unsigned int virq, unsigned int nr_irqs);
 
-static inline int irq_domain_alloc_irqs_parent(struct irq_domain *domain,
-                                              unsigned int irq_base,
-                                              unsigned int nr_irqs, void *arg)
-{
-       if (domain->parent && domain->parent->ops->alloc)
-               return domain->parent->ops->alloc(domain->parent, irq_base,
-                                                 nr_irqs, arg);
-       return -ENOSYS;
-}
+extern int irq_domain_alloc_irqs_parent(struct irq_domain *domain,
+                                       unsigned int irq_base,
+                                       unsigned int nr_irqs, void *arg);
 
-static inline void irq_domain_free_irqs_parent(struct irq_domain *domain,
-                               unsigned int irq_base, unsigned int nr_irqs)
-{
-       if (domain->parent && domain->parent->ops->free)
-               domain->parent->ops->free(domain->parent, irq_base, nr_irqs);
-}
+extern void irq_domain_free_irqs_parent(struct irq_domain *domain,
+                                       unsigned int irq_base,
+                                       unsigned int nr_irqs);
 
 static inline bool irq_domain_is_hierarchy(struct irq_domain *domain)
 {