diff options
author | Nipun Gupta <nipun.gupta@amd.com> | 2024-04-23 16:40:20 +0530 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2024-04-23 14:27:52 -0600 |
commit | 06fe8fd6808562971637c6b133c806bcf49097ad (patch) | |
tree | 3250a674f9e7ec5ea53889c4e143ab8db385aff5 /include/linux/msi.h | |
parent | 82b951e6fbd31d85ae7f4feb5f00ddd4c5d256e2 (diff) |
genirq/msi: Add MSI allocation helper and export MSI functions
MSI functions for allocation and free can be directly used by
the device drivers without any wrapper provided by bus drivers.
So export these MSI functions.
Also, add a wrapper API to allocate MSIs providing only the
number of interrupts rather than range for simpler driver usage.
Signed-off-by: Nipun Gupta <nipun.gupta@amd.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240423111021.1686144-1-nipun.gupta@amd.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/linux/msi.h')
-rw-r--r-- | include/linux/msi.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/msi.h b/include/linux/msi.h index 26d07e23052e..765a65581a66 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -676,6 +676,12 @@ int platform_device_msi_init_and_alloc_irqs(struct device *dev, unsigned int nve void platform_device_msi_free_irqs_all(struct device *dev); bool msi_device_has_isolated_msi(struct device *dev); + +static inline int msi_domain_alloc_irqs(struct device *dev, unsigned int domid, int nirqs) +{ + return msi_domain_alloc_irqs_range(dev, domid, 0, nirqs - 1); +} + #else /* CONFIG_GENERIC_MSI_IRQ */ static inline bool msi_device_has_isolated_msi(struct device *dev) { |