diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-11-12 05:39:03 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-11-23 07:01:47 -0500 |
commit | f3cf8bb0d6c3c11ddedf01f02f856f2ae8c33aa4 (patch) | |
tree | f61cecf6747f73d028a5f5e87f25a5cede929c39 /include/linux | |
parent | 9dde55b72dc80bfae4280ddce5dbd69ba8240813 (diff) |
genirq: Add generic msi irq domain support
Implement the basic functions for MSI interrupt support with
hierarchical interrupt domains.
[ tglx: Extracted and combined from several patches ]
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Yingjoe Chen <yingjoe.chen@mediatek.com>
Cc: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/msi.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/include/linux/msi.h b/include/linux/msi.h index e0d08517bd3d..b5ca2456769c 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
@@ -114,4 +114,49 @@ struct msi_controller { | |||
114 | void (*teardown_irq)(struct msi_controller *chip, unsigned int irq); | 114 | void (*teardown_irq)(struct msi_controller *chip, unsigned int irq); |
115 | }; | 115 | }; |
116 | 116 | ||
117 | #ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN | ||
118 | struct irq_domain; | ||
119 | struct irq_chip; | ||
120 | struct device_node; | ||
121 | struct msi_domain_info; | ||
122 | |||
123 | /** | ||
124 | * struct msi_domain_ops - MSI interrupt domain callbacks | ||
125 | * @get_hwirq: Retrieve the resulting hw irq number | ||
126 | * @msi_init: Domain specific init function for MSI interrupts | ||
127 | * @msi_free: Domain specific function to free a MSI interrupts | ||
128 | */ | ||
129 | struct msi_domain_ops { | ||
130 | irq_hw_number_t (*get_hwirq)(struct msi_domain_info *info, void *arg); | ||
131 | int (*msi_init)(struct irq_domain *domain, | ||
132 | struct msi_domain_info *info, | ||
133 | unsigned int virq, irq_hw_number_t hwirq, | ||
134 | void *arg); | ||
135 | void (*msi_free)(struct irq_domain *domain, | ||
136 | struct msi_domain_info *info, | ||
137 | unsigned int virq); | ||
138 | }; | ||
139 | |||
140 | /** | ||
141 | * struct msi_domain_info - MSI interrupt domain data | ||
142 | * @ops: The callback data structure | ||
143 | * @chip: The associated interrupt chip | ||
144 | * @data: Domain specific data | ||
145 | */ | ||
146 | struct msi_domain_info { | ||
147 | struct msi_domain_ops *ops; | ||
148 | struct irq_chip *chip; | ||
149 | void *data; | ||
150 | }; | ||
151 | |||
152 | int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask, | ||
153 | bool force); | ||
154 | |||
155 | struct irq_domain *msi_create_irq_domain(struct device_node *of_node, | ||
156 | struct msi_domain_info *info, | ||
157 | struct irq_domain *parent); | ||
158 | struct msi_domain_info *msi_get_domain_info(struct irq_domain *domain); | ||
159 | |||
160 | #endif /* CONFIG_GENERIC_MSI_IRQ_DOMAIN */ | ||
161 | |||
117 | #endif /* LINUX_MSI_H */ | 162 | #endif /* LINUX_MSI_H */ |