diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-11-12 11:39:03 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-11-23 13:01:47 +0100 |
commit | f3cf8bb0d6c3c11ddedf01f02f856f2ae8c33aa4 (patch) | |
tree | f61cecf6747f73d028a5f5e87f25a5cede929c39 /include/linux/msi.h | |
parent | 9dde55b72dc80bfae4280ddce5dbd69ba8240813 (diff) | |
download | lwn-f3cf8bb0d6c3c11ddedf01f02f856f2ae8c33aa4.tar.gz lwn-f3cf8bb0d6c3c11ddedf01f02f856f2ae8c33aa4.zip |
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/msi.h')
-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 { void (*teardown_irq)(struct msi_controller *chip, unsigned int irq); }; +#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN +struct irq_domain; +struct irq_chip; +struct device_node; +struct msi_domain_info; + +/** + * struct msi_domain_ops - MSI interrupt domain callbacks + * @get_hwirq: Retrieve the resulting hw irq number + * @msi_init: Domain specific init function for MSI interrupts + * @msi_free: Domain specific function to free a MSI interrupts + */ +struct msi_domain_ops { + irq_hw_number_t (*get_hwirq)(struct msi_domain_info *info, void *arg); + int (*msi_init)(struct irq_domain *domain, + struct msi_domain_info *info, + unsigned int virq, irq_hw_number_t hwirq, + void *arg); + void (*msi_free)(struct irq_domain *domain, + struct msi_domain_info *info, + unsigned int virq); +}; + +/** + * struct msi_domain_info - MSI interrupt domain data + * @ops: The callback data structure + * @chip: The associated interrupt chip + * @data: Domain specific data + */ +struct msi_domain_info { + struct msi_domain_ops *ops; + struct irq_chip *chip; + void *data; +}; + +int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask, + bool force); + +struct irq_domain *msi_create_irq_domain(struct device_node *of_node, + struct msi_domain_info *info, + struct irq_domain *parent); +struct msi_domain_info *msi_get_domain_info(struct irq_domain *domain); + +#endif /* CONFIG_GENERIC_MSI_IRQ_DOMAIN */ + #endif /* LINUX_MSI_H */ |