|
@@ -45,6 +45,17 @@ struct irq_data;
|
|
|
/* Number of irqs reserved for a legacy isa controller */
|
|
|
#define NUM_ISA_INTERRUPTS 16
|
|
|
|
|
|
+/*
|
|
|
+ * Should several domains have the same device node, but serve
|
|
|
+ * different purposes (for example one domain is for PCI/MSI, and the
|
|
|
+ * other for wired IRQs), they can be distinguished using a
|
|
|
+ * bus-specific token. Most domains are expected to only carry
|
|
|
+ * DOMAIN_BUS_ANY.
|
|
|
+ */
|
|
|
+enum irq_domain_bus_token {
|
|
|
+ DOMAIN_BUS_ANY = 0,
|
|
|
+};
|
|
|
+
|
|
|
/**
|
|
|
* struct irq_domain_ops - Methods for irq_domain objects
|
|
|
* @match: Match an interrupt controller device node to a host, returns
|
|
@@ -61,7 +72,8 @@ struct irq_data;
|
|
|
* to setup the irq_desc when returning from map().
|
|
|
*/
|
|
|
struct irq_domain_ops {
|
|
|
- int (*match)(struct irq_domain *d, struct device_node *node);
|
|
|
+ int (*match)(struct irq_domain *d, struct device_node *node,
|
|
|
+ enum irq_domain_bus_token bus_token);
|
|
|
int (*map)(struct irq_domain *d, unsigned int virq, irq_hw_number_t hw);
|
|
|
void (*unmap)(struct irq_domain *d, unsigned int virq);
|
|
|
int (*xlate)(struct irq_domain *d, struct device_node *node,
|
|
@@ -116,6 +128,7 @@ struct irq_domain {
|
|
|
|
|
|
/* Optional data */
|
|
|
struct device_node *of_node;
|
|
|
+ enum irq_domain_bus_token bus_token;
|
|
|
struct irq_domain_chip_generic *gc;
|
|
|
#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
|
|
|
struct irq_domain *parent;
|
|
@@ -161,9 +174,15 @@ struct irq_domain *irq_domain_add_legacy(struct device_node *of_node,
|
|
|
irq_hw_number_t first_hwirq,
|
|
|
const struct irq_domain_ops *ops,
|
|
|
void *host_data);
|
|
|
-extern struct irq_domain *irq_find_host(struct device_node *node);
|
|
|
+extern struct irq_domain *irq_find_matching_host(struct device_node *node,
|
|
|
+ enum irq_domain_bus_token bus_token);
|
|
|
extern void irq_set_default_host(struct irq_domain *host);
|
|
|
|
|
|
+static inline struct irq_domain *irq_find_host(struct device_node *node)
|
|
|
+{
|
|
|
+ return irq_find_matching_host(node, DOMAIN_BUS_ANY);
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* irq_domain_add_linear() - Allocate and register a linear revmap irq_domain.
|
|
|
* @of_node: pointer to interrupt controller's device tree node.
|