diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2024-06-23 17:18:34 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2024-07-18 20:31:19 +0200 |
commit | 72e257c6f058032daba1c4fe0c81003d545d0f81 (patch) | |
tree | 6b67f1b769d51e846efd94bf20b23a9144fa9d87 /drivers/irqchip/irq-msi-lib.h | |
parent | 7d189c77106ed6df09829f7a419e35ada67b2bd0 (diff) | |
download | lwn-72e257c6f058032daba1c4fe0c81003d545d0f81.tar.gz lwn-72e257c6f058032daba1c4fe0c81003d545d0f81.zip |
irqchip: Provide irq-msi-lib
All irqdomains which provide MSI parent domain functionality for per device
MSI domains need to provide a select() callback for the irqdomain and a
function to initialize the child domain.
Most of these functions would just be copy&paste with minimal
modifications, so provide a library function which implements the required
functionality and is customizable via parent_domain::msi_parent_ops. The
check for the supported bus tokens in msi_lib_init_dev_msi_info() is
expanded step by step within the next patches.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Shivamurthy Shastri <shivamurthy.shastri@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240623142234.840975799@linutronix.de
Diffstat (limited to 'drivers/irqchip/irq-msi-lib.h')
-rw-r--r-- | drivers/irqchip/irq-msi-lib.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-msi-lib.h b/drivers/irqchip/irq-msi-lib.h new file mode 100644 index 000000000000..f0706cc28264 --- /dev/null +++ b/drivers/irqchip/irq-msi-lib.h @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright (C) 2022 Linutronix GmbH +// Copyright (C) 2022 Intel + +#ifndef _DRIVERS_IRQCHIP_IRQ_MSI_LIB_H +#define _DRIVERS_IRQCHIP_IRQ_MSI_LIB_H + +#include <linux/bits.h> +#include <linux/irqdomain.h> +#include <linux/msi.h> + +int msi_lib_irq_domain_select(struct irq_domain *d, struct irq_fwspec *fwspec, + enum irq_domain_bus_token bus_token); + +bool msi_lib_init_dev_msi_info(struct device *dev, struct irq_domain *domain, + struct irq_domain *real_parent, + struct msi_domain_info *info); + +#endif /* _DRIVERS_IRQCHIP_IRQ_MSI_LIB_H */ |