irqdomain.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * irq_domain - IRQ translation domains
  4. *
  5. * Translation infrastructure between hw and linux irq numbers. This is
  6. * helpful for interrupt controllers to implement mapping between hardware
  7. * irq numbers and the Linux irq number space.
  8. *
  9. * irq_domains also have hooks for translating device tree or other
  10. * firmware interrupt representations into a hardware irq number that
  11. * can be mapped back to a Linux irq number without any extra platform
  12. * support code.
  13. *
  14. * Interrupt controller "domain" data structure. This could be defined as a
  15. * irq domain controller. That is, it handles the mapping between hardware
  16. * and virtual interrupt numbers for a given interrupt domain. The domain
  17. * structure is generally created by the PIC code for a given PIC instance
  18. * (though a domain can cover more than one PIC if they have a flat number
  19. * model). It's the domain callbacks that are responsible for setting the
  20. * irq_chip on a given irq_desc after it's been mapped.
  21. *
  22. * The host code and data structures use a fwnode_handle pointer to
  23. * identify the domain. In some cases, and in order to preserve source
  24. * code compatibility, this fwnode pointer is "upgraded" to a DT
  25. * device_node. For those firmware infrastructures that do not provide
  26. * a unique identifier for an interrupt controller, the irq_domain
  27. * code offers a fwnode allocator.
  28. */
  29. #ifndef _LINUX_IRQDOMAIN_H
  30. #define _LINUX_IRQDOMAIN_H
  31. #include <linux/types.h>
  32. #include <linux/irqhandler.h>
  33. #include <linux/of.h>
  34. #include <linux/mutex.h>
  35. #include <linux/radix-tree.h>
  36. struct device_node;
  37. struct irq_domain;
  38. struct of_device_id;
  39. struct irq_chip;
  40. struct irq_data;
  41. struct cpumask;
  42. struct seq_file;
  43. /* Number of irqs reserved for a legacy isa controller */
  44. #define NUM_ISA_INTERRUPTS 16
  45. #define IRQ_DOMAIN_IRQ_SPEC_PARAMS 16
  46. /**
  47. * struct irq_fwspec - generic IRQ specifier structure
  48. *
  49. * @fwnode: Pointer to a firmware-specific descriptor
  50. * @param_count: Number of device-specific parameters
  51. * @param: Device-specific parameters
  52. *
  53. * This structure, directly modeled after of_phandle_args, is used to
  54. * pass a device-specific description of an interrupt.
  55. */
  56. struct irq_fwspec {
  57. struct fwnode_handle *fwnode;
  58. int param_count;
  59. u32 param[IRQ_DOMAIN_IRQ_SPEC_PARAMS];
  60. };
  61. /*
  62. * Should several domains have the same device node, but serve
  63. * different purposes (for example one domain is for PCI/MSI, and the
  64. * other for wired IRQs), they can be distinguished using a
  65. * bus-specific token. Most domains are expected to only carry
  66. * DOMAIN_BUS_ANY.
  67. */
  68. enum irq_domain_bus_token {
  69. DOMAIN_BUS_ANY = 0,
  70. DOMAIN_BUS_WIRED,
  71. DOMAIN_BUS_PCI_MSI,
  72. DOMAIN_BUS_PLATFORM_MSI,
  73. DOMAIN_BUS_NEXUS,
  74. DOMAIN_BUS_IPI,
  75. DOMAIN_BUS_FSL_MC_MSI,
  76. };
  77. /**
  78. * struct irq_domain_ops - Methods for irq_domain objects
  79. * @match: Match an interrupt controller device node to a host, returns
  80. * 1 on a match
  81. * @map: Create or update a mapping between a virtual irq number and a hw
  82. * irq number. This is called only once for a given mapping.
  83. * @unmap: Dispose of such a mapping
  84. * @xlate: Given a device tree node and interrupt specifier, decode
  85. * the hardware irq number and linux irq type value.
  86. *
  87. * Functions below are provided by the driver and called whenever a new mapping
  88. * is created or an old mapping is disposed. The driver can then proceed to
  89. * whatever internal data structures management is required. It also needs
  90. * to setup the irq_desc when returning from map().
  91. */
  92. struct irq_domain_ops {
  93. int (*match)(struct irq_domain *d, struct device_node *node,
  94. enum irq_domain_bus_token bus_token);
  95. int (*select)(struct irq_domain *d, struct irq_fwspec *fwspec,
  96. enum irq_domain_bus_token bus_token);
  97. int (*map)(struct irq_domain *d, unsigned int virq, irq_hw_number_t hw);
  98. void (*unmap)(struct irq_domain *d, unsigned int virq);
  99. int (*xlate)(struct irq_domain *d, struct device_node *node,
  100. const u32 *intspec, unsigned int intsize,
  101. unsigned long *out_hwirq, unsigned int *out_type);
  102. #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
  103. /* extended V2 interfaces to support hierarchy irq_domains */
  104. int (*alloc)(struct irq_domain *d, unsigned int virq,
  105. unsigned int nr_irqs, void *arg);
  106. void (*free)(struct irq_domain *d, unsigned int virq,
  107. unsigned int nr_irqs);
  108. int (*activate)(struct irq_domain *d, struct irq_data *irqd, bool reserve);
  109. void (*deactivate)(struct irq_domain *d, struct irq_data *irq_data);
  110. int (*translate)(struct irq_domain *d, struct irq_fwspec *fwspec,
  111. unsigned long *out_hwirq, unsigned int *out_type);
  112. #endif
  113. #ifdef CONFIG_GENERIC_IRQ_DEBUGFS
  114. void (*debug_show)(struct seq_file *m, struct irq_domain *d,
  115. struct irq_data *irqd, int ind);
  116. #endif
  117. };
  118. extern struct irq_domain_ops irq_generic_chip_ops;
  119. struct irq_domain_chip_generic;
  120. /**
  121. * struct irq_domain - Hardware interrupt number translation object
  122. * @link: Element in global irq_domain list.
  123. * @name: Name of interrupt domain
  124. * @ops: pointer to irq_domain methods
  125. * @host_data: private data pointer for use by owner. Not touched by irq_domain
  126. * core code.
  127. * @flags: host per irq_domain flags
  128. * @mapcount: The number of mapped interrupts
  129. *
  130. * Optional elements
  131. * @fwnode: Pointer to firmware node associated with the irq_domain. Pretty easy
  132. * to swap it for the of_node via the irq_domain_get_of_node accessor
  133. * @gc: Pointer to a list of generic chips. There is a helper function for
  134. * setting up one or more generic chips for interrupt controllers
  135. * drivers using the generic chip library which uses this pointer.
  136. * @parent: Pointer to parent irq_domain to support hierarchy irq_domains
  137. * @debugfs_file: dentry for the domain debugfs file
  138. *
  139. * Revmap data, used internally by irq_domain
  140. * @revmap_direct_max_irq: The largest hwirq that can be set for controllers that
  141. * support direct mapping
  142. * @revmap_size: Size of the linear map table @linear_revmap[]
  143. * @revmap_tree: Radix map tree for hwirqs that don't fit in the linear map
  144. * @linear_revmap: Linear table of hwirq->virq reverse mappings
  145. */
  146. struct irq_domain {
  147. struct list_head link;
  148. const char *name;
  149. const struct irq_domain_ops *ops;
  150. void *host_data;
  151. unsigned int flags;
  152. unsigned int mapcount;
  153. /* Optional data */
  154. struct fwnode_handle *fwnode;
  155. enum irq_domain_bus_token bus_token;
  156. struct irq_domain_chip_generic *gc;
  157. #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
  158. struct irq_domain *parent;
  159. #endif
  160. #ifdef CONFIG_GENERIC_IRQ_DEBUGFS
  161. struct dentry *debugfs_file;
  162. #endif
  163. /* reverse map data. The linear map gets appended to the irq_domain */
  164. irq_hw_number_t hwirq_max;
  165. unsigned int revmap_direct_max_irq;
  166. unsigned int revmap_size;
  167. struct radix_tree_root revmap_tree;
  168. struct mutex revmap_tree_mutex;
  169. unsigned int linear_revmap[];
  170. };
  171. /* Irq domain flags */
  172. enum {
  173. /* Irq domain is hierarchical */
  174. IRQ_DOMAIN_FLAG_HIERARCHY = (1 << 0),
  175. /* Irq domain name was allocated in __irq_domain_add() */
  176. IRQ_DOMAIN_NAME_ALLOCATED = (1 << 6),
  177. /* Irq domain is an IPI domain with virq per cpu */
  178. IRQ_DOMAIN_FLAG_IPI_PER_CPU = (1 << 2),
  179. /* Irq domain is an IPI domain with single virq */
  180. IRQ_DOMAIN_FLAG_IPI_SINGLE = (1 << 3),
  181. /* Irq domain implements MSIs */
  182. IRQ_DOMAIN_FLAG_MSI = (1 << 4),
  183. /* Irq domain implements MSI remapping */
  184. IRQ_DOMAIN_FLAG_MSI_REMAP = (1 << 5),
  185. /*
  186. * Flags starting from IRQ_DOMAIN_FLAG_NONCORE are reserved
  187. * for implementation specific purposes and ignored by the
  188. * core code.
  189. */
  190. IRQ_DOMAIN_FLAG_NONCORE = (1 << 16),
  191. };
  192. static inline struct device_node *irq_domain_get_of_node(struct irq_domain *d)
  193. {
  194. return to_of_node(d->fwnode);
  195. }
  196. #ifdef CONFIG_IRQ_DOMAIN
  197. struct fwnode_handle *__irq_domain_alloc_fwnode(unsigned int type, int id,
  198. const char *name, void *data);
  199. enum {
  200. IRQCHIP_FWNODE_REAL,
  201. IRQCHIP_FWNODE_NAMED,
  202. IRQCHIP_FWNODE_NAMED_ID,
  203. };
  204. static inline
  205. struct fwnode_handle *irq_domain_alloc_named_fwnode(const char *name)
  206. {
  207. return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_NAMED, 0, name, NULL);
  208. }
  209. static inline
  210. struct fwnode_handle *irq_domain_alloc_named_id_fwnode(const char *name, int id)
  211. {
  212. return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_NAMED_ID, id, name,
  213. NULL);
  214. }
  215. static inline struct fwnode_handle *irq_domain_alloc_fwnode(void *data)
  216. {
  217. return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_REAL, 0, NULL, data);
  218. }
  219. void irq_domain_free_fwnode(struct fwnode_handle *fwnode);
  220. struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,
  221. irq_hw_number_t hwirq_max, int direct_max,
  222. const struct irq_domain_ops *ops,
  223. void *host_data);
  224. struct irq_domain *irq_domain_add_simple(struct device_node *of_node,
  225. unsigned int size,
  226. unsigned int first_irq,
  227. const struct irq_domain_ops *ops,
  228. void *host_data);
  229. struct irq_domain *irq_domain_add_legacy(struct device_node *of_node,
  230. unsigned int size,
  231. unsigned int first_irq,
  232. irq_hw_number_t first_hwirq,
  233. const struct irq_domain_ops *ops,
  234. void *host_data);
  235. extern struct irq_domain *irq_find_matching_fwspec(struct irq_fwspec *fwspec,
  236. enum irq_domain_bus_token bus_token);
  237. extern bool irq_domain_check_msi_remap(void);
  238. extern void irq_set_default_host(struct irq_domain *host);
  239. extern int irq_domain_alloc_descs(int virq, unsigned int nr_irqs,
  240. irq_hw_number_t hwirq, int node,
  241. const struct cpumask *affinity);
  242. static inline struct fwnode_handle *of_node_to_fwnode(struct device_node *node)
  243. {
  244. return node ? &node->fwnode : NULL;
  245. }
  246. extern const struct fwnode_operations irqchip_fwnode_ops;
  247. static inline bool is_fwnode_irqchip(struct fwnode_handle *fwnode)
  248. {
  249. return fwnode && fwnode->ops == &irqchip_fwnode_ops;
  250. }
  251. extern void irq_domain_update_bus_token(struct irq_domain *domain,
  252. enum irq_domain_bus_token bus_token);
  253. static inline
  254. struct irq_domain *irq_find_matching_fwnode(struct fwnode_handle *fwnode,
  255. enum irq_domain_bus_token bus_token)
  256. {
  257. struct irq_fwspec fwspec = {
  258. .fwnode = fwnode,
  259. };
  260. return irq_find_matching_fwspec(&fwspec, bus_token);
  261. }
  262. static inline struct irq_domain *irq_find_matching_host(struct device_node *node,
  263. enum irq_domain_bus_token bus_token)
  264. {
  265. return irq_find_matching_fwnode(of_node_to_fwnode(node), bus_token);
  266. }
  267. static inline struct irq_domain *irq_find_host(struct device_node *node)
  268. {
  269. struct irq_domain *d;
  270. d = irq_find_matching_host(node, DOMAIN_BUS_WIRED);
  271. if (!d)
  272. d = irq_find_matching_host(node, DOMAIN_BUS_ANY);
  273. return d;
  274. }
  275. /**
  276. * irq_domain_add_linear() - Allocate and register a linear revmap irq_domain.
  277. * @of_node: pointer to interrupt controller's device tree node.
  278. * @size: Number of interrupts in the domain.
  279. * @ops: map/unmap domain callbacks
  280. * @host_data: Controller private data pointer
  281. */
  282. static inline struct irq_domain *irq_domain_add_linear(struct device_node *of_node,
  283. unsigned int size,
  284. const struct irq_domain_ops *ops,
  285. void *host_data)
  286. {
  287. return __irq_domain_add(of_node_to_fwnode(of_node), size, size, 0, ops, host_data);
  288. }
  289. static inline struct irq_domain *irq_domain_add_nomap(struct device_node *of_node,
  290. unsigned int max_irq,
  291. const struct irq_domain_ops *ops,
  292. void *host_data)
  293. {
  294. return __irq_domain_add(of_node_to_fwnode(of_node), 0, max_irq, max_irq, ops, host_data);
  295. }
  296. static inline struct irq_domain *irq_domain_add_legacy_isa(
  297. struct device_node *of_node,
  298. const struct irq_domain_ops *ops,
  299. void *host_data)
  300. {
  301. return irq_domain_add_legacy(of_node, NUM_ISA_INTERRUPTS, 0, 0, ops,
  302. host_data);
  303. }
  304. static inline struct irq_domain *irq_domain_add_tree(struct device_node *of_node,
  305. const struct irq_domain_ops *ops,
  306. void *host_data)
  307. {
  308. return __irq_domain_add(of_node_to_fwnode(of_node), 0, ~0, 0, ops, host_data);
  309. }
  310. static inline struct irq_domain *irq_domain_create_linear(struct fwnode_handle *fwnode,
  311. unsigned int size,
  312. const struct irq_domain_ops *ops,
  313. void *host_data)
  314. {
  315. return __irq_domain_add(fwnode, size, size, 0, ops, host_data);
  316. }
  317. static inline struct irq_domain *irq_domain_create_tree(struct fwnode_handle *fwnode,
  318. const struct irq_domain_ops *ops,
  319. void *host_data)
  320. {
  321. return __irq_domain_add(fwnode, 0, ~0, 0, ops, host_data);
  322. }
  323. extern void irq_domain_remove(struct irq_domain *host);
  324. extern int irq_domain_associate(struct irq_domain *domain, unsigned int irq,
  325. irq_hw_number_t hwirq);
  326. extern void irq_domain_associate_many(struct irq_domain *domain,
  327. unsigned int irq_base,
  328. irq_hw_number_t hwirq_base, int count);
  329. extern void irq_domain_disassociate(struct irq_domain *domain,
  330. unsigned int irq);
  331. extern unsigned int irq_create_mapping(struct irq_domain *host,
  332. irq_hw_number_t hwirq);
  333. extern unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec);
  334. extern void irq_dispose_mapping(unsigned int virq);
  335. /**
  336. * irq_linear_revmap() - Find a linux irq from a hw irq number.
  337. * @domain: domain owning this hardware interrupt
  338. * @hwirq: hardware irq number in that domain space
  339. *
  340. * This is a fast path alternative to irq_find_mapping() that can be
  341. * called directly by irq controller code to save a handful of
  342. * instructions. It is always safe to call, but won't find irqs mapped
  343. * using the radix tree.
  344. */
  345. static inline unsigned int irq_linear_revmap(struct irq_domain *domain,
  346. irq_hw_number_t hwirq)
  347. {
  348. return hwirq < domain->revmap_size ? domain->linear_revmap[hwirq] : 0;
  349. }
  350. extern unsigned int irq_find_mapping(struct irq_domain *host,
  351. irq_hw_number_t hwirq);
  352. extern unsigned int irq_create_direct_mapping(struct irq_domain *host);
  353. extern int irq_create_strict_mappings(struct irq_domain *domain,
  354. unsigned int irq_base,
  355. irq_hw_number_t hwirq_base, int count);
  356. static inline int irq_create_identity_mapping(struct irq_domain *host,
  357. irq_hw_number_t hwirq)
  358. {
  359. return irq_create_strict_mappings(host, hwirq, hwirq, 1);
  360. }
  361. extern const struct irq_domain_ops irq_domain_simple_ops;
  362. /* stock xlate functions */
  363. int irq_domain_xlate_onecell(struct irq_domain *d, struct device_node *ctrlr,
  364. const u32 *intspec, unsigned int intsize,
  365. irq_hw_number_t *out_hwirq, unsigned int *out_type);
  366. int irq_domain_xlate_twocell(struct irq_domain *d, struct device_node *ctrlr,
  367. const u32 *intspec, unsigned int intsize,
  368. irq_hw_number_t *out_hwirq, unsigned int *out_type);
  369. int irq_domain_xlate_onetwocell(struct irq_domain *d, struct device_node *ctrlr,
  370. const u32 *intspec, unsigned int intsize,
  371. irq_hw_number_t *out_hwirq, unsigned int *out_type);
  372. /* IPI functions */
  373. int irq_reserve_ipi(struct irq_domain *domain, const struct cpumask *dest);
  374. int irq_destroy_ipi(unsigned int irq, const struct cpumask *dest);
  375. /* V2 interfaces to support hierarchy IRQ domains. */
  376. extern struct irq_data *irq_domain_get_irq_data(struct irq_domain *domain,
  377. unsigned int virq);
  378. extern void irq_domain_set_info(struct irq_domain *domain, unsigned int virq,
  379. irq_hw_number_t hwirq, struct irq_chip *chip,
  380. void *chip_data, irq_flow_handler_t handler,
  381. void *handler_data, const char *handler_name);
  382. #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
  383. extern struct irq_domain *irq_domain_create_hierarchy(struct irq_domain *parent,
  384. unsigned int flags, unsigned int size,
  385. struct fwnode_handle *fwnode,
  386. const struct irq_domain_ops *ops, void *host_data);
  387. static inline struct irq_domain *irq_domain_add_hierarchy(struct irq_domain *parent,
  388. unsigned int flags,
  389. unsigned int size,
  390. struct device_node *node,
  391. const struct irq_domain_ops *ops,
  392. void *host_data)
  393. {
  394. return irq_domain_create_hierarchy(parent, flags, size,
  395. of_node_to_fwnode(node),
  396. ops, host_data);
  397. }
  398. extern int __irq_domain_alloc_irqs(struct irq_domain *domain, int irq_base,
  399. unsigned int nr_irqs, int node, void *arg,
  400. bool realloc, const struct cpumask *affinity);
  401. extern void irq_domain_free_irqs(unsigned int virq, unsigned int nr_irqs);
  402. extern int irq_domain_activate_irq(struct irq_data *irq_data, bool early);
  403. extern void irq_domain_deactivate_irq(struct irq_data *irq_data);
  404. static inline int irq_domain_alloc_irqs(struct irq_domain *domain,
  405. unsigned int nr_irqs, int node, void *arg)
  406. {
  407. return __irq_domain_alloc_irqs(domain, -1, nr_irqs, node, arg, false,
  408. NULL);
  409. }
  410. extern int irq_domain_alloc_irqs_hierarchy(struct irq_domain *domain,
  411. unsigned int irq_base,
  412. unsigned int nr_irqs, void *arg);
  413. extern int irq_domain_set_hwirq_and_chip(struct irq_domain *domain,
  414. unsigned int virq,
  415. irq_hw_number_t hwirq,
  416. struct irq_chip *chip,
  417. void *chip_data);
  418. extern void irq_domain_reset_irq_data(struct irq_data *irq_data);
  419. extern void irq_domain_free_irqs_common(struct irq_domain *domain,
  420. unsigned int virq,
  421. unsigned int nr_irqs);
  422. extern void irq_domain_free_irqs_top(struct irq_domain *domain,
  423. unsigned int virq, unsigned int nr_irqs);
  424. extern int irq_domain_push_irq(struct irq_domain *domain, int virq, void *arg);
  425. extern int irq_domain_pop_irq(struct irq_domain *domain, int virq);
  426. extern int irq_domain_alloc_irqs_parent(struct irq_domain *domain,
  427. unsigned int irq_base,
  428. unsigned int nr_irqs, void *arg);
  429. extern void irq_domain_free_irqs_parent(struct irq_domain *domain,
  430. unsigned int irq_base,
  431. unsigned int nr_irqs);
  432. static inline bool irq_domain_is_hierarchy(struct irq_domain *domain)
  433. {
  434. return domain->flags & IRQ_DOMAIN_FLAG_HIERARCHY;
  435. }
  436. static inline bool irq_domain_is_ipi(struct irq_domain *domain)
  437. {
  438. return domain->flags &
  439. (IRQ_DOMAIN_FLAG_IPI_PER_CPU | IRQ_DOMAIN_FLAG_IPI_SINGLE);
  440. }
  441. static inline bool irq_domain_is_ipi_per_cpu(struct irq_domain *domain)
  442. {
  443. return domain->flags & IRQ_DOMAIN_FLAG_IPI_PER_CPU;
  444. }
  445. static inline bool irq_domain_is_ipi_single(struct irq_domain *domain)
  446. {
  447. return domain->flags & IRQ_DOMAIN_FLAG_IPI_SINGLE;
  448. }
  449. static inline bool irq_domain_is_msi(struct irq_domain *domain)
  450. {
  451. return domain->flags & IRQ_DOMAIN_FLAG_MSI;
  452. }
  453. static inline bool irq_domain_is_msi_remap(struct irq_domain *domain)
  454. {
  455. return domain->flags & IRQ_DOMAIN_FLAG_MSI_REMAP;
  456. }
  457. extern bool irq_domain_hierarchical_is_msi_remap(struct irq_domain *domain);
  458. #else /* CONFIG_IRQ_DOMAIN_HIERARCHY */
  459. static inline int irq_domain_alloc_irqs(struct irq_domain *domain,
  460. unsigned int nr_irqs, int node, void *arg)
  461. {
  462. return -1;
  463. }
  464. static inline void irq_domain_free_irqs(unsigned int virq,
  465. unsigned int nr_irqs) { }
  466. static inline bool irq_domain_is_hierarchy(struct irq_domain *domain)
  467. {
  468. return false;
  469. }
  470. static inline bool irq_domain_is_ipi(struct irq_domain *domain)
  471. {
  472. return false;
  473. }
  474. static inline bool irq_domain_is_ipi_per_cpu(struct irq_domain *domain)
  475. {
  476. return false;
  477. }
  478. static inline bool irq_domain_is_ipi_single(struct irq_domain *domain)
  479. {
  480. return false;
  481. }
  482. static inline bool irq_domain_is_msi(struct irq_domain *domain)
  483. {
  484. return false;
  485. }
  486. static inline bool irq_domain_is_msi_remap(struct irq_domain *domain)
  487. {
  488. return false;
  489. }
  490. static inline bool
  491. irq_domain_hierarchical_is_msi_remap(struct irq_domain *domain)
  492. {
  493. return false;
  494. }
  495. #endif /* CONFIG_IRQ_DOMAIN_HIERARCHY */
  496. #else /* CONFIG_IRQ_DOMAIN */
  497. static inline void irq_dispose_mapping(unsigned int virq) { }
  498. static inline struct irq_domain *irq_find_matching_fwnode(
  499. struct fwnode_handle *fwnode, enum irq_domain_bus_token bus_token)
  500. {
  501. return NULL;
  502. }
  503. static inline bool irq_domain_check_msi_remap(void)
  504. {
  505. return false;
  506. }
  507. #endif /* !CONFIG_IRQ_DOMAIN */
  508. #endif /* _LINUX_IRQDOMAIN_H */