Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / drivers / acpi / irq.c
index c3b2222e21298e489c30fd9d330df1b1f821169d..e209081d644b5785e104ea6beda95c6a0eab735e 100644 (file)
@@ -1,12 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-only
 /*
  * ACPI GSI IRQ layer
  *
  * Copyright (C) 2015 ARM Ltd.
  * Author: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
  */
 #include <linux/acpi.h>
 #include <linux/irq.h>
@@ -295,3 +292,29 @@ void __init acpi_set_irq_model(enum acpi_irq_model_id model,
        acpi_irq_model = model;
        acpi_gsi_domain_id = fwnode;
 }
+
+/**
+ * acpi_irq_create_hierarchy - Create a hierarchical IRQ domain with the default
+ *                             GSI domain as its parent.
+ * @flags:      Irq domain flags associated with the domain
+ * @size:       Size of the domain.
+ * @fwnode:     Optional fwnode of the interrupt controller
+ * @ops:        Pointer to the interrupt domain callbacks
+ * @host_data:  Controller private data pointer
+ */
+struct irq_domain *acpi_irq_create_hierarchy(unsigned int flags,
+                                            unsigned int size,
+                                            struct fwnode_handle *fwnode,
+                                            const struct irq_domain_ops *ops,
+                                            void *host_data)
+{
+       struct irq_domain *d = irq_find_matching_fwnode(acpi_gsi_domain_id,
+                                                       DOMAIN_BUS_ANY);
+
+       if (!d)
+               return NULL;
+
+       return irq_domain_create_hierarchy(d, flags, size, fwnode, ops,
+                                          host_data);
+}
+EXPORT_SYMBOL_GPL(acpi_irq_create_hierarchy);