of/irq: Add support code for multi-parent version of "msi-parent"

Since 126b16e2ad ("Docs: dt: add generic MSI bindings"),
the definition of "msi-parent" has evolved, while maintaining
some degree of compatibility. It can now express multiple MSI
controllers as parents, as well as some sideband data being
communicated to the controller.

This patch adds the parsing of the property, iterating over
the multiple parents until a suitable irqdomain is found.
It can also fallback to the original parsing if the old
binding is detected.

This support code gets used in the subsequent patches.

Suggested-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
This commit is contained in:
Marc Zyngier
2015-09-18 14:07:40 +01:00
parent ccf91e68a4
commit 48ae34fb39
2 changed files with 68 additions and 0 deletions

View File

@@ -46,6 +46,9 @@ extern int of_irq_get(struct device_node *dev, int index);
extern int of_irq_get_byname(struct device_node *dev, const char *name);
extern int of_irq_to_resource_table(struct device_node *dev,
struct resource *res, int nr_irqs);
extern struct irq_domain *of_msi_get_domain(struct device *dev,
struct device_node *np,
enum irq_domain_bus_token token);
#else
static inline int of_irq_count(struct device_node *dev)
{
@@ -64,6 +67,12 @@ static inline int of_irq_to_resource_table(struct device_node *dev,
{
return 0;
}
static inline struct irq_domain *of_msi_get_domain(struct device *dev,
struct device_node *np,
enum irq_domain_bus_token token)
{
return NULL;
}
#endif
#if defined(CONFIG_OF)