1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (C) 2016 ARM Limited, All Rights Reserved.
4  * Author: Marc Zyngier <marc.zyngier@arm.com>
5  */
6 
7 #include <linux/fwnode.h>
8 #include <linux/cpumask.h>
9 #include <linux/irqdomain.h>
10 
11 struct partition_affinity {
12 	cpumask_t			mask;
13 	void				*partition_id;
14 };
15 
16 struct partition_desc;
17 
18 #ifdef CONFIG_PARTITION_PERCPU
19 int partition_translate_id(struct partition_desc *desc, void *partition_id);
20 struct partition_desc *partition_create_desc(struct fwnode_handle *fwnode,
21 					     struct partition_affinity *parts,
22 					     int nr_parts,
23 					     int chained_irq,
24 					     const struct irq_domain_ops *ops);
25 struct irq_domain *partition_get_domain(struct partition_desc *dsc);
26 #else
27 static inline int partition_translate_id(struct partition_desc *desc,
28 					 void *partition_id)
29 {
30 	return -EINVAL;
31 }
32 
33 static inline
34 struct partition_desc *partition_create_desc(struct fwnode_handle *fwnode,
35 					     struct partition_affinity *parts,
36 					     int nr_parts,
37 					     int chained_irq,
38 					     const struct irq_domain_ops *ops)
39 {
40 	return NULL;
41 }
42 
43 static inline
44 struct irq_domain *partition_get_domain(struct partition_desc *dsc)
45 {
46 	return NULL;
47 }
48 #endif
49