diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/irqdomain.h | 48 |
1 files changed, 20 insertions, 28 deletions
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 1cbb7413c121..51ef84a3c990 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h | |||
@@ -73,50 +73,42 @@ struct irq_domain_chip_generic; | |||
73 | /** | 73 | /** |
74 | * struct irq_domain - Hardware interrupt number translation object | 74 | * struct irq_domain - Hardware interrupt number translation object |
75 | * @link: Element in global irq_domain list. | 75 | * @link: Element in global irq_domain list. |
76 | * @revmap_type: Method used for reverse mapping hwirq numbers to linux irq. This | 76 | * @name: Name of interrupt domain |
77 | * will be one of the IRQ_DOMAIN_MAP_* values. | ||
78 | * @ops: pointer to irq_domain methods | 77 | * @ops: pointer to irq_domain methods |
79 | * @host_data: private data pointer for use by owner. Not touched by irq_domain | 78 | * @host_data: private data pointer for use by owner. Not touched by irq_domain |
80 | * core code. | 79 | * core code. |
81 | * @irq_base: Start of irq_desc range assigned to the irq_domain. The creator | 80 | * |
82 | * of the irq_domain is responsible for allocating the array of | 81 | * Optional elements |
83 | * irq_desc structures. | 82 | * @of_node: Pointer to device tree nodes associated with the irq_domain. Used |
84 | * @nr_irq: Number of irqs managed by the irq domain | 83 | * when decoding device tree interrupt specifiers. |
85 | * @hwirq_base: Starting number for hwirqs managed by the irq domain | 84 | * @gc: Pointer to a list of generic chips. There is a helper function for |
86 | * @of_node: (optional) Pointer to device tree nodes associated with the | 85 | * setting up one or more generic chips for interrupt controllers |
87 | * irq_domain. Used when decoding device tree interrupt specifiers. | 86 | * drivers using the generic chip library which uses this pointer. |
87 | * | ||
88 | * Revmap data, used internally by irq_domain | ||
89 | * @revmap_direct_max_irq: The largest hwirq that can be set for controllers that | ||
90 | * support direct mapping | ||
91 | * @revmap_size: Size of the linear map table @linear_revmap[] | ||
92 | * @revmap_tree: Radix map tree for hwirqs that don't fit in the linear map | ||
93 | * @linear_revmap: Linear table of hwirq->virq reverse mappings | ||
88 | */ | 94 | */ |
89 | struct irq_domain { | 95 | struct irq_domain { |
90 | struct list_head link; | 96 | struct list_head link; |
91 | const char *name; | 97 | const char *name; |
92 | |||
93 | /* type of reverse mapping_technique */ | ||
94 | unsigned int revmap_type; | ||
95 | struct { | ||
96 | struct { | ||
97 | unsigned int size; | ||
98 | } linear; | ||
99 | struct { | ||
100 | unsigned int max_irq; | ||
101 | } nomap; | ||
102 | struct radix_tree_root tree; | ||
103 | } revmap_data; | ||
104 | const struct irq_domain_ops *ops; | 98 | const struct irq_domain_ops *ops; |
105 | void *host_data; | 99 | void *host_data; |
106 | irq_hw_number_t inval_irq; | ||
107 | 100 | ||
108 | /* Optional device node pointer */ | 101 | /* Optional data */ |
109 | struct device_node *of_node; | 102 | struct device_node *of_node; |
110 | /* Optional pointer to generic interrupt chips */ | ||
111 | struct irq_domain_chip_generic *gc; | 103 | struct irq_domain_chip_generic *gc; |
112 | 104 | ||
113 | /* Linear reverse map */ | 105 | /* reverse map data. The linear map gets appended to the irq_domain */ |
106 | unsigned int revmap_direct_max_irq; | ||
107 | unsigned int revmap_size; | ||
108 | struct radix_tree_root revmap_tree; | ||
114 | unsigned int linear_revmap[]; | 109 | unsigned int linear_revmap[]; |
115 | }; | 110 | }; |
116 | 111 | ||
117 | #define IRQ_DOMAIN_MAP_NOMAP 1 /* no fast reverse mapping */ | ||
118 | #define IRQ_DOMAIN_MAP_LINEAR 2 /* linear map of interrupts */ | ||
119 | |||
120 | #ifdef CONFIG_IRQ_DOMAIN | 112 | #ifdef CONFIG_IRQ_DOMAIN |
121 | struct irq_domain *irq_domain_add_simple(struct device_node *of_node, | 113 | struct irq_domain *irq_domain_add_simple(struct device_node *of_node, |
122 | unsigned int size, | 114 | unsigned int size, |