This source file includes following definitions.
- icc_node_create
- icc_node_destroy
- icc_link_create
- icc_link_destroy
- icc_node_add
- icc_node_del
- icc_provider_add
- icc_provider_del
1
2
3
4
5
6
7 #ifndef __LINUX_INTERCONNECT_PROVIDER_H
8 #define __LINUX_INTERCONNECT_PROVIDER_H
9
10 #include <linux/interconnect.h>
11
12 #define icc_units_to_bps(bw) ((bw) * 1000ULL)
13
14 struct icc_node;
15 struct of_phandle_args;
16
17
18
19
20
21
22
23 struct icc_onecell_data {
24 unsigned int num_nodes;
25 struct icc_node *nodes[];
26 };
27
28 struct icc_node *of_icc_xlate_onecell(struct of_phandle_args *spec,
29 void *data);
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46 struct icc_provider {
47 struct list_head provider_list;
48 struct list_head nodes;
49 int (*set)(struct icc_node *src, struct icc_node *dst);
50 int (*aggregate)(struct icc_node *node, u32 tag, u32 avg_bw,
51 u32 peak_bw, u32 *agg_avg, u32 *agg_peak);
52 void (*pre_aggregate)(struct icc_node *node);
53 struct icc_node* (*xlate)(struct of_phandle_args *spec, void *data);
54 struct device *dev;
55 int users;
56 void *data;
57 };
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76 struct icc_node {
77 int id;
78 const char *name;
79 struct icc_node **links;
80 size_t num_links;
81
82 struct icc_provider *provider;
83 struct list_head node_list;
84 struct list_head search_list;
85 struct icc_node *reverse;
86 u8 is_traversed:1;
87 struct hlist_head req_list;
88 u32 avg_bw;
89 u32 peak_bw;
90 void *data;
91 };
92
93 #if IS_ENABLED(CONFIG_INTERCONNECT)
94
95 struct icc_node *icc_node_create(int id);
96 void icc_node_destroy(int id);
97 int icc_link_create(struct icc_node *node, const int dst_id);
98 int icc_link_destroy(struct icc_node *src, struct icc_node *dst);
99 void icc_node_add(struct icc_node *node, struct icc_provider *provider);
100 void icc_node_del(struct icc_node *node);
101 int icc_provider_add(struct icc_provider *provider);
102 int icc_provider_del(struct icc_provider *provider);
103
104 #else
105
106 static inline struct icc_node *icc_node_create(int id)
107 {
108 return ERR_PTR(-ENOTSUPP);
109 }
110
111 void icc_node_destroy(int id)
112 {
113 }
114
115 static inline int icc_link_create(struct icc_node *node, const int dst_id)
116 {
117 return -ENOTSUPP;
118 }
119
120 int icc_link_destroy(struct icc_node *src, struct icc_node *dst)
121 {
122 return -ENOTSUPP;
123 }
124
125 void icc_node_add(struct icc_node *node, struct icc_provider *provider)
126 {
127 }
128
129 void icc_node_del(struct icc_node *node)
130 {
131 }
132
133 static inline int icc_provider_add(struct icc_provider *provider)
134 {
135 return -ENOTSUPP;
136 }
137
138 static inline int icc_provider_del(struct icc_provider *provider)
139 {
140 return -ENOTSUPP;
141 }
142
143 #endif
144
145 #endif