1// SPDX-License-Identifier: GPL-2.0-only
2// Copyright (C) 2022 Linutronix GmbH
3// Copyright (C) 2022 Intel
4
5#ifndef _IRQCHIP_IRQ_MSI_LIB_H
6#define _IRQCHIP_IRQ_MSI_LIB_H
7
8#include <linux/bits.h>
9#include <linux/irqdomain.h>
10#include <linux/msi.h>
11
12#ifdef CONFIG_PCI_MSI
13#define MATCH_PCI_MSI BIT(DOMAIN_BUS_PCI_MSI)
14#else
15#define MATCH_PCI_MSI (0)
16#endif
17
18#define MATCH_PLATFORM_MSI BIT(DOMAIN_BUS_PLATFORM_MSI)
19
20struct msi_domain_info;
21int msi_lib_irq_domain_select(struct irq_domain *d, struct irq_fwspec *fwspec,
22 enum irq_domain_bus_token bus_token);
23
24bool msi_lib_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
25 struct irq_domain *real_parent,
26 struct msi_domain_info *info);
27
28#endif /* _IRQCHIP_IRQ_MSI_LIB_H */
29