Commit 2a5e9a07 authored by Marc Zyngier's avatar Marc Zyngier Committed by Thomas Gleixner

irqdomain: Introduce irq_domain_create_hierarchy

As we're about to start converting the various MSI layers to
use fwnode_handle instead of device_node, add irq_domain_create_hierarchy
as a directly equivalent of irq_domain_add_hierarchy (which still
exists as a compatibility interface).
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Tested-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
Tested-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: <linux-arm-kernel@lists.infradead.org>
Cc: Tomasz Nowicki <tomasz.nowicki@linaro.org>
Cc: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Cc: Graeme Gregory <graeme@xora.org.uk>
Cc: Jake Oshins <jakeo@microsoft.com>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Link: http://lkml.kernel.org/r/1444737105-31573-16-git-send-email-marc.zyngier@arm.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 462e4fc7
...@@ -340,10 +340,23 @@ extern void irq_domain_set_info(struct irq_domain *domain, unsigned int virq, ...@@ -340,10 +340,23 @@ extern void irq_domain_set_info(struct irq_domain *domain, unsigned int virq,
void *chip_data, irq_flow_handler_t handler, void *chip_data, irq_flow_handler_t handler,
void *handler_data, const char *handler_name); void *handler_data, const char *handler_name);
#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
extern struct irq_domain *irq_domain_add_hierarchy(struct irq_domain *parent, extern struct irq_domain *irq_domain_create_hierarchy(struct irq_domain *parent,
unsigned int flags, unsigned int size, unsigned int flags, unsigned int size,
struct device_node *node, struct fwnode_handle *fwnode,
const struct irq_domain_ops *ops, void *host_data); const struct irq_domain_ops *ops, void *host_data);
static inline struct irq_domain *irq_domain_add_hierarchy(struct irq_domain *parent,
unsigned int flags,
unsigned int size,
struct device_node *node,
const struct irq_domain_ops *ops,
void *host_data)
{
return irq_domain_create_hierarchy(parent, flags, size,
of_node_to_fwnode(node),
ops, host_data);
}
extern int __irq_domain_alloc_irqs(struct irq_domain *domain, int irq_base, extern int __irq_domain_alloc_irqs(struct irq_domain *domain, int irq_base,
unsigned int nr_irqs, int node, void *arg, unsigned int nr_irqs, int node, void *arg,
bool realloc); bool realloc);
......
...@@ -854,11 +854,11 @@ static int irq_domain_alloc_descs(int virq, unsigned int cnt, ...@@ -854,11 +854,11 @@ static int irq_domain_alloc_descs(int virq, unsigned int cnt,
#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
/** /**
* irq_domain_add_hierarchy - Add a irqdomain into the hierarchy * irq_domain_create_hierarchy - Add a irqdomain into the hierarchy
* @parent: Parent irq domain to associate with the new domain * @parent: Parent irq domain to associate with the new domain
* @flags: Irq domain flags associated to the domain * @flags: Irq domain flags associated to the domain
* @size: Size of the domain. See below * @size: Size of the domain. See below
* @node: Optional device-tree node of the interrupt controller * @fwnode: Optional fwnode of the interrupt controller
* @ops: Pointer to the interrupt domain callbacks * @ops: Pointer to the interrupt domain callbacks
* @host_data: Controller private data pointer * @host_data: Controller private data pointer
* *
...@@ -868,19 +868,19 @@ static int irq_domain_alloc_descs(int virq, unsigned int cnt, ...@@ -868,19 +868,19 @@ static int irq_domain_alloc_descs(int virq, unsigned int cnt,
* domain flags are set. * domain flags are set.
* Returns pointer to IRQ domain, or NULL on failure. * Returns pointer to IRQ domain, or NULL on failure.
*/ */
struct irq_domain *irq_domain_add_hierarchy(struct irq_domain *parent, struct irq_domain *irq_domain_create_hierarchy(struct irq_domain *parent,
unsigned int flags, unsigned int flags,
unsigned int size, unsigned int size,
struct device_node *node, struct fwnode_handle *fwnode,
const struct irq_domain_ops *ops, const struct irq_domain_ops *ops,
void *host_data) void *host_data)
{ {
struct irq_domain *domain; struct irq_domain *domain;
if (size) if (size)
domain = irq_domain_add_linear(node, size, ops, host_data); domain = irq_domain_create_linear(fwnode, size, ops, host_data);
else else
domain = irq_domain_add_tree(node, ops, host_data); domain = irq_domain_create_tree(fwnode, ops, host_data);
if (domain) { if (domain) {
domain->parent = parent; domain->parent = parent;
domain->flags |= flags; domain->flags |= flags;
......
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