irqdomain.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  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 << 1),
  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. * Quirk to handle MSI implementations which do not provide
  187. * masking. Currently known to affect x86, but partially
  188. * handled in core code.
  189. */
  190. IRQ_DOMAIN_MSI_NOMASK_QUIRK = (1 << 6),
  191. /*
  192. * Flags starting from IRQ_DOMAIN_FLAG_NONCORE are reserved
  193. * for implementation specific purposes and ignored by the
  194. * core code.
  195. */
  196. IRQ_DOMAIN_FLAG_NONCORE = (1 << 16),
  197. };
  198. static inline struct device_node *irq_domain_get_of_node(struct irq_domain *d)
  199. {
  200. return to_of_node(d->fwnode);
  201. }
  202. #ifdef CONFIG_IRQ_DOMAIN
  203. struct fwnode_handle *__irq_domain_alloc_fwnode(unsigned int type, int id,
  204. const char *name, void *data);
  205. enum {
  206. IRQCHIP_FWNODE_REAL,
  207. IRQCHIP_FWNODE_NAMED,
  208. IRQCHIP_FWNODE_NAMED_ID,
  209. };
  210. static inline
  211. struct fwnode_handle *irq_domain_alloc_named_fwnode(const char *name)
  212. {
  213. return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_NAMED, 0, name, NULL);
  214. }
  215. static inline
  216. struct fwnode_handle *irq_domain_alloc_named_id_fwnode(const char *name, int id)
  217. {
  218. return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_NAMED_ID, id, name,
  219. NULL);
  220. }
  221. static inline struct fwnode_handle *irq_domain_alloc_fwnode(void *data)
  222. {
  223. return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_REAL, 0, NULL, data);
  224. }
  225. void irq_domain_free_fwnode(struct fwnode_handle *fwnode);
  226. struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,
  227. irq_hw_number_t hwirq_max, int direct_max,
  228. const struct irq_domain_ops *ops,
  229. void *host_data);
  230. struct irq_domain *irq_domain_add_simple(struct device_node *of_node,
  231. unsigned int size,
  232. unsigned int first_irq,
  233. const struct irq_domain_ops *ops,
  234. void *host_data);
  235. struct irq_domain *irq_domain_add_legacy(struct device_node *of_node,
  236. unsigned int size,
  237. unsigned int first_irq,
  238. irq_hw_number_t first_hwirq,
  239. const struct irq_domain_ops *ops,
  240. void *host_data);
  241. extern struct irq_domain *irq_find_matching_fwspec(struct irq_fwspec *fwspec,
  242. enum irq_domain_bus_token bus_token);
  243. extern bool irq_domain_check_msi_remap(void);
  244. extern void irq_set_default_host(struct irq_domain *host);
  245. extern int irq_domain_alloc_descs(int virq, unsigned int nr_irqs,
  246. irq_hw_number_t hwirq, int node,
  247. const struct cpumask *affinity);
  248. static inline struct fwnode_handle *of_node_to_fwnode(struct device_node *node)
  249. {
  250. return node ? &node->fwnode : NULL;
  251. }
  252. extern const struct fwnode_operations irqchip_fwnode_ops;
  253. static inline bool is_fwnode_irqchip(struct fwnode_handle *fwnode)
  254. {
  255. return fwnode && fwnode->ops == &irqchip_fwnode_ops;
  256. }
  257. extern void irq_domain_update_bus_token(struct irq_domain *domain,
  258. enum irq_domain_bus_token bus_token);
  259. static inline
  260. struct irq_domain *irq_find_matching_fwnode(struct fwnode_handle *fwnode,
  261. enum irq_domain_bus_token bus_token)
  262. {
  263. struct irq_fwspec fwspec = {
  264. .fwnode = fwnode,
  265. };
  266. return irq_find_matching_fwspec(&fwspec, bus_token);
  267. }
  268. static inline struct irq_domain *irq_find_matching_host(struct device_node *node,
  269. enum irq_domain_bus_token bus_token)
  270. {
  271. return irq_find_matching_fwnode(of_node_to_fwnode(node), bus_token);
  272. }
  273. static inline struct irq_domain *irq_find_host(struct device_node *node)
  274. {
  275. struct irq_domain *d;
  276. d = irq_find_matching_host(node, DOMAIN_BUS_WIRED);
  277. if (!d)
  278. d = irq_find_matching_host(node, DOMAIN_BUS_ANY);
  279. return d;
  280. }
  281. /**
  282. * irq_domain_add_linear() - Allocate and register a linear revmap irq_domain.
  283. * @of_node: pointer to interrupt controller's device tree node.
  284. * @size: Number of interrupts in the domain.
  285. * @ops: map/unmap domain callbacks
  286. * @host_data: Controller private data pointer
  287. */
  288. static inline struct irq_domain *irq_domain_add_linear(struct device_node *of_node,
  289. unsigned int size,
  290. const struct irq_domain_ops *ops,
  291. void *host_data)
  292. {
  293. return __irq_domain_add(of_node_to_fwnode(of_node), size, size, 0, ops, host_data);
  294. }
  295. static inline struct irq_domain *irq_domain_add_nomap(struct device_node *of_node,
  296. unsigned int max_irq,
  297. const struct irq_domain_ops *ops,
  298. void *host_data)
  299. {
  300. return __irq_domain_add(of_node_to_fwnode(of_node), 0, max_irq, max_irq, ops, host_data);
  301. }
  302. static inline struct irq_domain *irq_domain_add_legacy_isa(
  303. struct device_node *of_node,
  304. const struct irq_domain_ops *ops,
  305. void *host_data)
  306. {
  307. return irq_domain_add_legacy(of_node, NUM_ISA_INTERRUPTS, 0, 0, ops,
  308. host_data);
  309. }
  310. static inline struct irq_domain *irq_domain_add_tree(struct device_node *of_node,
  311. const struct irq_domain_ops *ops,
  312. void *host_data)
  313. {
  314. return __irq_domain_add(of_node_to_fwnode(of_node), 0, ~0, 0, ops, host_data);
  315. }
  316. static inline struct irq_domain *irq_domain_create_linear(struct fwnode_handle *fwnode,
  317. unsigned int size,
  318. const struct irq_domain_ops *ops,
  319. void *host_data)
  320. {
  321. return __irq_domain_add(fwnode, size, size, 0, ops, host_data);
  322. }
  323. static inline struct irq_domain *irq_domain_create_tree(struct fwnode_handle *fwnode,
  324. const struct irq_domain_ops *ops,
  325. void *host_data)
  326. {
  327. return __irq_domain_add(fwnode, 0, ~0, 0, ops, host_data);
  328. }
  329. extern void irq_domain_remove(struct irq_domain *host);
  330. extern int irq_domain_associate(struct irq_domain *domain, unsigned int irq,
  331. irq_hw_number_t hwirq);
  332. extern void irq_domain_associate_many(struct irq_domain *domain,
  333. unsigned int irq_base,
  334. irq_hw_number_t hwirq_base, int count);
  335. extern void irq_domain_disassociate(struct irq_domain *domain,
  336. unsigned int irq);
  337. extern unsigned int irq_create_mapping(struct irq_domain *host,
  338. irq_hw_number_t hwirq);
  339. extern unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec);
  340. extern void irq_dispose_mapping(unsigned int virq);
  341. /**
  342. * irq_linear_revmap() - Find a linux irq from a hw irq number.
  343. * @domain: domain owning this hardware interrupt
  344. * @hwirq: hardware irq number in that domain space
  345. *
  346. * This is a fast path alternative to irq_find_mapping() that can be
  347. * called directly by irq controller code to save a handful of
  348. * instructions. It is always safe to call, but won't find irqs mapped
  349. * using the radix tree.
  350. */
  351. static inline unsigned int irq_linear_revmap(struct irq_domain *domain,
  352. irq_hw_number_t hwirq)
  353. {
  354. return hwirq < domain->revmap_size ? domain->linear_revmap[hwirq] : 0;
  355. }
  356. extern unsigned int irq_find_mapping(struct irq_domain *host,
  357. irq_hw_number_t hwirq);
  358. extern unsigned int irq_create_direct_mapping(struct irq_domain *host);
  359. extern int irq_create_strict_mappings(struct irq_domain *domain,
  360. unsigned int irq_base,
  361. irq_hw_number_t hwirq_base, int count);
  362. static inline int irq_create_identity_mapping(struct irq_domain *host,
  363. irq_hw_number_t hwirq)
  364. {
  365. return irq_create_strict_mappings(host, hwirq, hwirq, 1);
  366. }
  367. extern const struct irq_domain_ops irq_domain_simple_ops;
  368. /* stock xlate functions */
  369. int irq_domain_xlate_onecell(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. int irq_domain_xlate_twocell(struct irq_domain *d, struct device_node *ctrlr,
  373. const u32 *intspec, unsigned int intsize,
  374. irq_hw_number_t *out_hwirq, unsigned int *out_type);
  375. int irq_domain_xlate_onetwocell(struct irq_domain *d, struct device_node *ctrlr,
  376. const u32 *intspec, unsigned int intsize,
  377. irq_hw_number_t *out_hwirq, unsigned int *out_type);
  378. /* IPI functions */
  379. int irq_reserve_ipi(struct irq_domain *domain, const struct cpumask *dest);
  380. int irq_destroy_ipi(unsigned int irq, const struct cpumask *dest);
  381. /* V2 interfaces to support hierarchy IRQ domains. */
  382. extern struct irq_data *irq_domain_get_irq_data(struct irq_domain *domain,
  383. unsigned int virq);
  384. extern void irq_domain_set_info(struct irq_domain *domain, unsigned int virq,
  385. irq_hw_number_t hwirq, struct irq_chip *chip,
  386. void *chip_data, irq_flow_handler_t handler,
  387. void *handler_data, const char *handler_name);
  388. #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
  389. extern struct irq_domain *irq_domain_create_hierarchy(struct irq_domain *parent,
  390. unsigned int flags, unsigned int size,
  391. struct fwnode_handle *fwnode,
  392. const struct irq_domain_ops *ops, void *host_data);
  393. static inline struct irq_domain *irq_domain_add_hierarchy(struct irq_domain *parent,
  394. unsigned int flags,
  395. unsigned int size,
  396. struct device_node *node,
  397. const struct irq_domain_ops *ops,
  398. void *host_data)
  399. {
  400. return irq_domain_create_hierarchy(parent, flags, size,
  401. of_node_to_fwnode(node),
  402. ops, host_data);
  403. }
  404. extern int __irq_domain_alloc_irqs(struct irq_domain *domain, int irq_base,
  405. unsigned int nr_irqs, int node, void *arg,
  406. bool realloc, const struct cpumask *affinity);
  407. extern void irq_domain_free_irqs(unsigned int virq, unsigned int nr_irqs);
  408. extern int irq_domain_activate_irq(struct irq_data *irq_data, bool early);
  409. extern void irq_domain_deactivate_irq(struct irq_data *irq_data);
  410. static inline int irq_domain_alloc_irqs(struct irq_domain *domain,
  411. unsigned int nr_irqs, int node, void *arg)
  412. {
  413. return __irq_domain_alloc_irqs(domain, -1, nr_irqs, node, arg, false,
  414. NULL);
  415. }
  416. extern int irq_domain_alloc_irqs_hierarchy(struct irq_domain *domain,
  417. unsigned int irq_base,
  418. unsigned int nr_irqs, void *arg);
  419. extern int irq_domain_set_hwirq_and_chip(struct irq_domain *domain,
  420. unsigned int virq,
  421. irq_hw_number_t hwirq,
  422. struct irq_chip *chip,
  423. void *chip_data);
  424. extern void irq_domain_reset_irq_data(struct irq_data *irq_data);
  425. extern void irq_domain_free_irqs_common(struct irq_domain *domain,
  426. unsigned int virq,
  427. unsigned int nr_irqs);
  428. extern void irq_domain_free_irqs_top(struct irq_domain *domain,
  429. unsigned int virq, unsigned int nr_irqs);
  430. extern int irq_domain_push_irq(struct irq_domain *domain, int virq, void *arg);
  431. extern int irq_domain_pop_irq(struct irq_domain *domain, int virq);
  432. extern int irq_domain_alloc_irqs_parent(struct irq_domain *domain,
  433. unsigned int irq_base,
  434. unsigned int nr_irqs, void *arg);
  435. extern void irq_domain_free_irqs_parent(struct irq_domain *domain,
  436. unsigned int irq_base,
  437. unsigned int nr_irqs);
  438. static inline bool irq_domain_is_hierarchy(struct irq_domain *domain)
  439. {
  440. return domain->flags & IRQ_DOMAIN_FLAG_HIERARCHY;
  441. }
  442. static inline bool irq_domain_is_ipi(struct irq_domain *domain)
  443. {
  444. return domain->flags &
  445. (IRQ_DOMAIN_FLAG_IPI_PER_CPU | IRQ_DOMAIN_FLAG_IPI_SINGLE);
  446. }
  447. static inline bool irq_domain_is_ipi_per_cpu(struct irq_domain *domain)
  448. {
  449. return domain->flags & IRQ_DOMAIN_FLAG_IPI_PER_CPU;
  450. }
  451. static inline bool irq_domain_is_ipi_single(struct irq_domain *domain)
  452. {
  453. return domain->flags & IRQ_DOMAIN_FLAG_IPI_SINGLE;
  454. }
  455. static inline bool irq_domain_is_msi(struct irq_domain *domain)
  456. {
  457. return domain->flags & IRQ_DOMAIN_FLAG_MSI;
  458. }
  459. static inline bool irq_domain_is_msi_remap(struct irq_domain *domain)
  460. {
  461. return domain->flags & IRQ_DOMAIN_FLAG_MSI_REMAP;
  462. }
  463. extern bool irq_domain_hierarchical_is_msi_remap(struct irq_domain *domain);
  464. #else /* CONFIG_IRQ_DOMAIN_HIERARCHY */
  465. static inline int irq_domain_alloc_irqs(struct irq_domain *domain,
  466. unsigned int nr_irqs, int node, void *arg)
  467. {
  468. return -1;
  469. }
  470. static inline void irq_domain_free_irqs(unsigned int virq,
  471. unsigned int nr_irqs) { }
  472. static inline bool irq_domain_is_hierarchy(struct irq_domain *domain)
  473. {
  474. return false;
  475. }
  476. static inline bool irq_domain_is_ipi(struct irq_domain *domain)
  477. {
  478. return false;
  479. }
  480. static inline bool irq_domain_is_ipi_per_cpu(struct irq_domain *domain)
  481. {
  482. return false;
  483. }
  484. static inline bool irq_domain_is_ipi_single(struct irq_domain *domain)
  485. {
  486. return false;
  487. }
  488. static inline bool irq_domain_is_msi(struct irq_domain *domain)
  489. {
  490. return false;
  491. }
  492. static inline bool irq_domain_is_msi_remap(struct irq_domain *domain)
  493. {
  494. return false;
  495. }
  496. static inline bool
  497. irq_domain_hierarchical_is_msi_remap(struct irq_domain *domain)
  498. {
  499. return false;
  500. }
  501. #endif /* CONFIG_IRQ_DOMAIN_HIERARCHY */
  502. #else /* CONFIG_IRQ_DOMAIN */
  503. static inline void irq_dispose_mapping(unsigned int virq) { }
  504. static inline struct irq_domain *irq_find_matching_fwnode(
  505. struct fwnode_handle *fwnode, enum irq_domain_bus_token bus_token)
  506. {
  507. return NULL;
  508. }
  509. static inline bool irq_domain_check_msi_remap(void)
  510. {
  511. return false;
  512. }
  513. #endif /* !CONFIG_IRQ_DOMAIN */
  514. #endif /* _LINUX_IRQDOMAIN_H */