[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-afb7da83b9f476728623130703acb553d7c7c4d9@git.kernel.org>
Date: Sun, 23 Nov 2014 10:11:44 -0800
From: tip-bot for Jiang Liu <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: matthias.bgg@...il.com, tony.luck@...el.com, tglx@...utronix.de,
benh@...nel.crashing.org, linux-kernel@...r.kernel.org,
hpa@...or.com, grant.likely@...aro.org, wangyijing@...wei.com,
marc.zyngier@....com, bhelgaas@...gle.com,
yingjoe.chen@...iatek.com, bp@...en8.de, mingo@...nel.org,
jiang.liu@...ux.intel.com
Subject: [tip:irq/irqdomain] irqdomain:
Introduce helper function irq_domain_add_hierarchy()
Commit-ID: afb7da83b9f476728623130703acb553d7c7c4d9
Gitweb: http://git.kernel.org/tip/afb7da83b9f476728623130703acb553d7c7c4d9
Author: Jiang Liu <jiang.liu@...ux.intel.com>
AuthorDate: Sat, 15 Nov 2014 22:24:02 +0800
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Sun, 23 Nov 2014 13:01:46 +0100
irqdomain: Introduce helper function irq_domain_add_hierarchy()
Introduce helper function irq_domain_add_hierarchy(), which creates
a linear irqdomain if parameter 'size' is not zero, otherwise creates
a tree irqdomain.
Signed-off-by: Jiang Liu <jiang.liu@...ux.intel.com>
Cc: Tony Luck <tony.luck@...el.com>
Cc: linux-arm-kernel@...ts.infradead.org
Cc: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Grant Likely <grant.likely@...aro.org>
Cc: Marc Zyngier <marc.zyngier@....com>
Cc: Yijing Wang <wangyijing@...wei.com>
Cc: Yingjoe Chen <yingjoe.chen@...iatek.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Matthias Brugger <matthias.bgg@...il.com>
Link: http://lkml.kernel.org/r/1416061447-9472-5-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
include/linux/irqdomain.h | 4 ++++
kernel/irq/irqdomain.c | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+)
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index dd2709b..676d730 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -259,6 +259,10 @@ int irq_domain_xlate_onetwocell(struct irq_domain *d, struct device_node *ctrlr,
extern struct irq_data *irq_domain_get_irq_data(struct irq_domain *domain,
unsigned int virq);
#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
+extern 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);
extern int __irq_domain_alloc_irqs(struct irq_domain *domain, int irq_base,
unsigned int nr_irqs, int node, void *arg,
bool realloc);
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 9c88db7..7fac311 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -742,6 +742,42 @@ static int irq_domain_alloc_descs(int virq, unsigned int cnt,
}
#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
+/**
+ * irq_domain_add_hierarchy - Add a irqdomain into the hierarchy
+ * @parent: Parent irq domain to associate with the new domain
+ * @flags: Irq domain flags associated to the domain
+ * @size: Size of the domain. See below
+ * @node: Optional device-tree node of the interrupt controller
+ * @ops: Pointer to the interrupt domain callbacks
+ * @host_data: Controller private data pointer
+ *
+ * If @size is 0 a tree domain is created, otherwise a linear domain.
+ *
+ * If successful the parent is associated to the new domain and the
+ * domain flags are set.
+ * Returns pointer to IRQ domain, or NULL on failure.
+ */
+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)
+{
+ struct irq_domain *domain;
+
+ if (size)
+ domain = irq_domain_add_linear(node, size, ops, host_data);
+ else
+ domain = irq_domain_add_tree(node, ops, host_data);
+ if (domain) {
+ domain->parent = parent;
+ domain->flags |= flags;
+ }
+
+ return domain;
+}
+
static void irq_domain_insert_irq(int virq)
{
struct irq_data *data;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists