]>
Commit | Line | Data |
---|---|---|
d2912cb1 | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
e1f60b29 NM |
2 | /* |
3 | * Generic OPP Interface | |
4 | * | |
5 | * Copyright (C) 2009-2010 Texas Instruments Incorporated. | |
6 | * Nishanth Menon | |
7 | * Romit Dasgupta | |
8 | * Kevin Hilman | |
e1f60b29 NM |
9 | */ |
10 | ||
11 | #ifndef __LINUX_OPP_H__ | |
12 | #define __LINUX_OPP_H__ | |
13 | ||
0e0ffa85 | 14 | #include <linux/energy_model.h> |
e1f60b29 | 15 | #include <linux/err.h> |
03ca370f | 16 | #include <linux/notifier.h> |
e1f60b29 | 17 | |
94735585 VK |
18 | struct clk; |
19 | struct regulator; | |
47d43ba7 | 20 | struct dev_pm_opp; |
313162d0 | 21 | struct device; |
91291d9a | 22 | struct opp_table; |
e1f60b29 | 23 | |
47d43ba7 | 24 | enum dev_pm_opp_event { |
129eec55 | 25 | OPP_EVENT_ADD, OPP_EVENT_REMOVE, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE, |
25cb20a2 | 26 | OPP_EVENT_ADJUST_VOLTAGE, |
03ca370f MH |
27 | }; |
28 | ||
0f0fe7e0 VK |
29 | /** |
30 | * struct dev_pm_opp_supply - Power supply voltage/current values | |
31 | * @u_volt: Target voltage in microvolts corresponding to this OPP | |
32 | * @u_volt_min: Minimum voltage in microvolts corresponding to this OPP | |
33 | * @u_volt_max: Maximum voltage in microvolts corresponding to this OPP | |
34 | * @u_amp: Maximum current drawn by the device in microamperes | |
35 | * | |
36 | * This structure stores the voltage/current values for a single power supply. | |
37 | */ | |
38 | struct dev_pm_opp_supply { | |
39 | unsigned long u_volt; | |
40 | unsigned long u_volt_min; | |
41 | unsigned long u_volt_max; | |
42 | unsigned long u_amp; | |
43 | }; | |
44 | ||
6d3f922c GD |
45 | /** |
46 | * struct dev_pm_opp_icc_bw - Interconnect bandwidth values | |
47 | * @avg: Average bandwidth corresponding to this OPP (in icc units) | |
48 | * @peak: Peak bandwidth corresponding to this OPP (in icc units) | |
49 | * | |
50 | * This structure stores the bandwidth values for a single interconnect path. | |
51 | */ | |
52 | struct dev_pm_opp_icc_bw { | |
53 | u32 avg; | |
54 | u32 peak; | |
55 | }; | |
56 | ||
94735585 VK |
57 | /** |
58 | * struct dev_pm_opp_info - OPP freq/voltage/current values | |
59 | * @rate: Target clk rate in hz | |
60 | * @supplies: Array of voltage/current values for all power supplies | |
61 | * | |
62 | * This structure stores the freq/voltage/current values for a single OPP. | |
63 | */ | |
64 | struct dev_pm_opp_info { | |
65 | unsigned long rate; | |
66 | struct dev_pm_opp_supply *supplies; | |
67 | }; | |
68 | ||
69 | /** | |
70 | * struct dev_pm_set_opp_data - Set OPP data | |
71 | * @old_opp: Old OPP info | |
72 | * @new_opp: New OPP info | |
73 | * @regulators: Array of regulator pointers | |
74 | * @regulator_count: Number of regulators | |
75 | * @clk: Pointer to clk | |
76 | * @dev: Pointer to the struct device | |
77 | * | |
78 | * This structure contains all information required for setting an OPP. | |
79 | */ | |
80 | struct dev_pm_set_opp_data { | |
81 | struct dev_pm_opp_info old_opp; | |
82 | struct dev_pm_opp_info new_opp; | |
83 | ||
84 | struct regulator **regulators; | |
85 | unsigned int regulator_count; | |
86 | struct clk *clk; | |
87 | struct device *dev; | |
88 | }; | |
89 | ||
e1f60b29 NM |
90 | #if defined(CONFIG_PM_OPP) |
91 | ||
f067a982 VK |
92 | struct opp_table *dev_pm_opp_get_opp_table(struct device *dev); |
93 | void dev_pm_opp_put_opp_table(struct opp_table *opp_table); | |
94 | ||
47d43ba7 | 95 | unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp); |
e1f60b29 | 96 | |
47d43ba7 | 97 | unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp); |
e1f60b29 | 98 | |
5b93ac54 RN |
99 | unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp); |
100 | ||
597ff543 DO |
101 | unsigned int dev_pm_opp_get_required_pstate(struct dev_pm_opp *opp, |
102 | unsigned int index); | |
103 | ||
19445b25 BZ |
104 | bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp); |
105 | ||
5d4879cd | 106 | int dev_pm_opp_get_opp_count(struct device *dev); |
3ca9bb33 | 107 | unsigned long dev_pm_opp_get_max_clock_latency(struct device *dev); |
655c9df9 | 108 | unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev); |
21743447 | 109 | unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev); |
3aa26a3b | 110 | unsigned long dev_pm_opp_get_suspend_opp_freq(struct device *dev); |
e1f60b29 | 111 | |
47d43ba7 NM |
112 | struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev, |
113 | unsigned long freq, | |
114 | bool available); | |
71419d84 NC |
115 | struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev, |
116 | unsigned int level); | |
8dd5cada DO |
117 | struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev, |
118 | unsigned int *level); | |
e1f60b29 | 119 | |
47d43ba7 NM |
120 | struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev, |
121 | unsigned long *freq); | |
2f36bde0 AC |
122 | struct dev_pm_opp *dev_pm_opp_find_freq_ceil_by_volt(struct device *dev, |
123 | unsigned long u_volt); | |
e1f60b29 | 124 | |
47d43ba7 NM |
125 | struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev, |
126 | unsigned long *freq); | |
7034764a | 127 | void dev_pm_opp_put(struct dev_pm_opp *opp); |
e1f60b29 | 128 | |
5d4879cd NM |
129 | int dev_pm_opp_add(struct device *dev, unsigned long freq, |
130 | unsigned long u_volt); | |
129eec55 | 131 | void dev_pm_opp_remove(struct device *dev, unsigned long freq); |
1690d8bb | 132 | void dev_pm_opp_remove_all_dynamic(struct device *dev); |
e1f60b29 | 133 | |
25cb20a2 SB |
134 | int dev_pm_opp_adjust_voltage(struct device *dev, unsigned long freq, |
135 | unsigned long u_volt, unsigned long u_volt_min, | |
136 | unsigned long u_volt_max); | |
137 | ||
5d4879cd | 138 | int dev_pm_opp_enable(struct device *dev, unsigned long freq); |
e1f60b29 | 139 | |
5d4879cd | 140 | int dev_pm_opp_disable(struct device *dev, unsigned long freq); |
e1f60b29 | 141 | |
dc2c9ad5 VK |
142 | int dev_pm_opp_register_notifier(struct device *dev, struct notifier_block *nb); |
143 | int dev_pm_opp_unregister_notifier(struct device *dev, struct notifier_block *nb); | |
144 | ||
fa30184d VK |
145 | struct opp_table *dev_pm_opp_set_supported_hw(struct device *dev, const u32 *versions, unsigned int count); |
146 | void dev_pm_opp_put_supported_hw(struct opp_table *opp_table); | |
9c4f220f | 147 | int devm_pm_opp_set_supported_hw(struct device *dev, const u32 *versions, unsigned int count); |
fa30184d VK |
148 | struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char *name); |
149 | void dev_pm_opp_put_prop_name(struct opp_table *opp_table); | |
dfbe4678 VK |
150 | struct opp_table *dev_pm_opp_set_regulators(struct device *dev, const char * const names[], unsigned int count); |
151 | void dev_pm_opp_put_regulators(struct opp_table *opp_table); | |
32aee78b | 152 | int devm_pm_opp_set_regulators(struct device *dev, const char * const names[], unsigned int count); |
f3988bc5 | 153 | struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char *name); |
829a4e8c | 154 | void dev_pm_opp_put_clkname(struct opp_table *opp_table); |
a74f681c | 155 | int devm_pm_opp_set_clkname(struct device *dev, const char *name); |
fa30184d | 156 | struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data)); |
604a7aeb | 157 | void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table); |
a3c47af6 | 158 | struct opp_table *devm_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data)); |
17a8f868 | 159 | struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names, struct device ***virt_devs); |
6319aee1 | 160 | void dev_pm_opp_detach_genpd(struct opp_table *opp_table); |
b4b9e223 | 161 | struct opp_table *devm_pm_opp_attach_genpd(struct device *dev, const char **names, struct device ***virt_devs); |
7d8658ef | 162 | struct dev_pm_opp *dev_pm_opp_xlate_required_opp(struct opp_table *src_table, struct opp_table *dst_table, struct dev_pm_opp *src_opp); |
c8a59103 | 163 | int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate); |
6a0712f6 | 164 | int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq); |
abbe3483 | 165 | int dev_pm_opp_set_opp(struct device *dev, struct dev_pm_opp *opp); |
ddbb74bc AB |
166 | int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const struct cpumask *cpumask); |
167 | int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask); | |
411466c5 SH |
168 | void dev_pm_opp_remove_table(struct device *dev); |
169 | void dev_pm_opp_cpumask_remove_table(const struct cpumask *cpumask); | |
ce8073d8 | 170 | int dev_pm_opp_sync_regulators(struct device *dev); |
e1f60b29 | 171 | #else |
f067a982 VK |
172 | static inline struct opp_table *dev_pm_opp_get_opp_table(struct device *dev) |
173 | { | |
1d614920 | 174 | return ERR_PTR(-EOPNOTSUPP); |
f067a982 VK |
175 | } |
176 | ||
eb7c8743 VK |
177 | static inline struct opp_table *dev_pm_opp_get_opp_table_indexed(struct device *dev, int index) |
178 | { | |
1d614920 | 179 | return ERR_PTR(-EOPNOTSUPP); |
eb7c8743 VK |
180 | } |
181 | ||
f067a982 VK |
182 | static inline void dev_pm_opp_put_opp_table(struct opp_table *opp_table) {} |
183 | ||
47d43ba7 | 184 | static inline unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp) |
e1f60b29 NM |
185 | { |
186 | return 0; | |
187 | } | |
188 | ||
47d43ba7 | 189 | static inline unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp) |
e1f60b29 NM |
190 | { |
191 | return 0; | |
192 | } | |
193 | ||
5b93ac54 RN |
194 | static inline unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp) |
195 | { | |
196 | return 0; | |
197 | } | |
198 | ||
597ff543 DO |
199 | static inline |
200 | unsigned int dev_pm_opp_get_required_pstate(struct dev_pm_opp *opp, | |
201 | unsigned int index) | |
202 | { | |
203 | return 0; | |
204 | } | |
205 | ||
19445b25 BZ |
206 | static inline bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp) |
207 | { | |
208 | return false; | |
209 | } | |
210 | ||
5d4879cd | 211 | static inline int dev_pm_opp_get_opp_count(struct device *dev) |
e1f60b29 NM |
212 | { |
213 | return 0; | |
214 | } | |
215 | ||
3ca9bb33 VK |
216 | static inline unsigned long dev_pm_opp_get_max_clock_latency(struct device *dev) |
217 | { | |
218 | return 0; | |
219 | } | |
220 | ||
655c9df9 VK |
221 | static inline unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev) |
222 | { | |
223 | return 0; | |
224 | } | |
225 | ||
21743447 VK |
226 | static inline unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev) |
227 | { | |
228 | return 0; | |
229 | } | |
230 | ||
3aa26a3b | 231 | static inline unsigned long dev_pm_opp_get_suspend_opp_freq(struct device *dev) |
4eafbd15 | 232 | { |
3aa26a3b | 233 | return 0; |
4eafbd15 BZ |
234 | } |
235 | ||
47d43ba7 | 236 | static inline struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev, |
e1f60b29 NM |
237 | unsigned long freq, bool available) |
238 | { | |
1d614920 | 239 | return ERR_PTR(-EOPNOTSUPP); |
e1f60b29 NM |
240 | } |
241 | ||
71419d84 NC |
242 | static inline struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev, |
243 | unsigned int level) | |
244 | { | |
1d614920 | 245 | return ERR_PTR(-EOPNOTSUPP); |
71419d84 NC |
246 | } |
247 | ||
8dd5cada DO |
248 | static inline struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev, |
249 | unsigned int *level) | |
250 | { | |
1d614920 | 251 | return ERR_PTR(-EOPNOTSUPP); |
8dd5cada DO |
252 | } |
253 | ||
47d43ba7 | 254 | static inline struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev, |
e1f60b29 NM |
255 | unsigned long *freq) |
256 | { | |
1d614920 | 257 | return ERR_PTR(-EOPNOTSUPP); |
e1f60b29 NM |
258 | } |
259 | ||
2f36bde0 AC |
260 | static inline struct dev_pm_opp *dev_pm_opp_find_freq_ceil_by_volt(struct device *dev, |
261 | unsigned long u_volt) | |
262 | { | |
1d614920 | 263 | return ERR_PTR(-EOPNOTSUPP); |
2f36bde0 AC |
264 | } |
265 | ||
47d43ba7 | 266 | static inline struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev, |
e1f60b29 NM |
267 | unsigned long *freq) |
268 | { | |
1d614920 | 269 | return ERR_PTR(-EOPNOTSUPP); |
e1f60b29 NM |
270 | } |
271 | ||
7034764a VK |
272 | static inline void dev_pm_opp_put(struct dev_pm_opp *opp) {} |
273 | ||
5d4879cd | 274 | static inline int dev_pm_opp_add(struct device *dev, unsigned long freq, |
e1f60b29 NM |
275 | unsigned long u_volt) |
276 | { | |
1d614920 | 277 | return -EOPNOTSUPP; |
e1f60b29 NM |
278 | } |
279 | ||
129eec55 VK |
280 | static inline void dev_pm_opp_remove(struct device *dev, unsigned long freq) |
281 | { | |
282 | } | |
283 | ||
1690d8bb VK |
284 | static inline void dev_pm_opp_remove_all_dynamic(struct device *dev) |
285 | { | |
286 | } | |
287 | ||
25cb20a2 SB |
288 | static inline int |
289 | dev_pm_opp_adjust_voltage(struct device *dev, unsigned long freq, | |
290 | unsigned long u_volt, unsigned long u_volt_min, | |
291 | unsigned long u_volt_max) | |
292 | { | |
293 | return 0; | |
294 | } | |
295 | ||
5d4879cd | 296 | static inline int dev_pm_opp_enable(struct device *dev, unsigned long freq) |
e1f60b29 NM |
297 | { |
298 | return 0; | |
299 | } | |
300 | ||
5d4879cd | 301 | static inline int dev_pm_opp_disable(struct device *dev, unsigned long freq) |
e1f60b29 NM |
302 | { |
303 | return 0; | |
304 | } | |
03ca370f | 305 | |
dc2c9ad5 | 306 | static inline int dev_pm_opp_register_notifier(struct device *dev, struct notifier_block *nb) |
03ca370f | 307 | { |
1d614920 | 308 | return -EOPNOTSUPP; |
dc2c9ad5 VK |
309 | } |
310 | ||
311 | static inline int dev_pm_opp_unregister_notifier(struct device *dev, struct notifier_block *nb) | |
312 | { | |
1d614920 | 313 | return -EOPNOTSUPP; |
03ca370f | 314 | } |
7de36b0a | 315 | |
fa30184d VK |
316 | static inline struct opp_table *dev_pm_opp_set_supported_hw(struct device *dev, |
317 | const u32 *versions, | |
318 | unsigned int count) | |
7de36b0a | 319 | { |
1d614920 | 320 | return ERR_PTR(-EOPNOTSUPP); |
7de36b0a VK |
321 | } |
322 | ||
fa30184d | 323 | static inline void dev_pm_opp_put_supported_hw(struct opp_table *opp_table) {} |
7de36b0a | 324 | |
9c4f220f YL |
325 | static inline int devm_pm_opp_set_supported_hw(struct device *dev, |
326 | const u32 *versions, | |
327 | unsigned int count) | |
328 | { | |
329 | return -EOPNOTSUPP; | |
330 | } | |
331 | ||
fa30184d | 332 | static inline struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev, |
4dab160e VK |
333 | int (*set_opp)(struct dev_pm_set_opp_data *data)) |
334 | { | |
1d614920 | 335 | return ERR_PTR(-EOPNOTSUPP); |
4dab160e VK |
336 | } |
337 | ||
604a7aeb | 338 | static inline void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table) {} |
4dab160e | 339 | |
a3c47af6 DO |
340 | static inline struct opp_table * |
341 | devm_pm_opp_register_set_opp_helper(struct device *dev, | |
342 | int (*set_opp)(struct dev_pm_set_opp_data *data)) | |
343 | { | |
1d614920 | 344 | return ERR_PTR(-EOPNOTSUPP); |
a3c47af6 DO |
345 | } |
346 | ||
fa30184d | 347 | static inline struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char *name) |
01fb4d3c | 348 | { |
1d614920 | 349 | return ERR_PTR(-EOPNOTSUPP); |
01fb4d3c VK |
350 | } |
351 | ||
fa30184d | 352 | static inline void dev_pm_opp_put_prop_name(struct opp_table *opp_table) {} |
01fb4d3c | 353 | |
dfbe4678 | 354 | static inline struct opp_table *dev_pm_opp_set_regulators(struct device *dev, const char * const names[], unsigned int count) |
9f8ea969 | 355 | { |
1d614920 | 356 | return ERR_PTR(-EOPNOTSUPP); |
9f8ea969 VK |
357 | } |
358 | ||
dfbe4678 | 359 | static inline void dev_pm_opp_put_regulators(struct opp_table *opp_table) {} |
9f8ea969 | 360 | |
32aee78b YL |
361 | static inline int devm_pm_opp_set_regulators(struct device *dev, |
362 | const char * const names[], | |
363 | unsigned int count) | |
364 | { | |
365 | return -EOPNOTSUPP; | |
366 | } | |
367 | ||
f3988bc5 | 368 | static inline struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char *name) |
829a4e8c | 369 | { |
1d614920 | 370 | return ERR_PTR(-EOPNOTSUPP); |
829a4e8c VK |
371 | } |
372 | ||
373 | static inline void dev_pm_opp_put_clkname(struct opp_table *opp_table) {} | |
374 | ||
a74f681c YL |
375 | static inline int devm_pm_opp_set_clkname(struct device *dev, const char *name) |
376 | { | |
377 | return -EOPNOTSUPP; | |
378 | } | |
379 | ||
17a8f868 | 380 | static inline struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names, struct device ***virt_devs) |
4f018bc0 | 381 | { |
1d614920 | 382 | return ERR_PTR(-EOPNOTSUPP); |
4f018bc0 VK |
383 | } |
384 | ||
6319aee1 | 385 | static inline void dev_pm_opp_detach_genpd(struct opp_table *opp_table) {} |
c8a59103 | 386 | |
b4b9e223 DO |
387 | static inline struct opp_table *devm_pm_opp_attach_genpd(struct device *dev, |
388 | const char **names, struct device ***virt_devs) | |
389 | { | |
1d614920 | 390 | return ERR_PTR(-EOPNOTSUPP); |
b4b9e223 DO |
391 | } |
392 | ||
7d8658ef SK |
393 | static inline struct dev_pm_opp *dev_pm_opp_xlate_required_opp(struct opp_table *src_table, |
394 | struct opp_table *dst_table, struct dev_pm_opp *src_opp) | |
395 | { | |
396 | return ERR_PTR(-EOPNOTSUPP); | |
397 | } | |
398 | ||
c8a59103 VK |
399 | static inline int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate) |
400 | { | |
1d614920 | 401 | return -EOPNOTSUPP; |
c8a59103 VK |
402 | } |
403 | ||
6a0712f6 VK |
404 | static inline int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq) |
405 | { | |
1d614920 | 406 | return -EOPNOTSUPP; |
6a0712f6 VK |
407 | } |
408 | ||
abbe3483 VK |
409 | static inline int dev_pm_opp_set_opp(struct device *dev, struct dev_pm_opp *opp) |
410 | { | |
1d614920 | 411 | return -EOPNOTSUPP; |
abbe3483 VK |
412 | } |
413 | ||
ddbb74bc | 414 | static inline int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const struct cpumask *cpumask) |
642aa8ce | 415 | { |
1d614920 | 416 | return -EOPNOTSUPP; |
642aa8ce VK |
417 | } |
418 | ||
ddbb74bc | 419 | static inline int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask) |
6f707daa VK |
420 | { |
421 | return -EINVAL; | |
422 | } | |
423 | ||
411466c5 SH |
424 | static inline void dev_pm_opp_remove_table(struct device *dev) |
425 | { | |
426 | } | |
427 | ||
428 | static inline void dev_pm_opp_cpumask_remove_table(const struct cpumask *cpumask) | |
429 | { | |
430 | } | |
431 | ||
ce8073d8 DO |
432 | static inline int dev_pm_opp_sync_regulators(struct device *dev) |
433 | { | |
1d614920 | 434 | return -EOPNOTSUPP; |
ce8073d8 DO |
435 | } |
436 | ||
a96d69d1 | 437 | #endif /* CONFIG_PM_OPP */ |
e1f60b29 | 438 | |
d6561bb2 | 439 | #if defined(CONFIG_PM_OPP) && defined(CONFIG_OF) |
8f8d37b2 | 440 | int dev_pm_opp_of_add_table(struct device *dev); |
fa9b274f | 441 | int dev_pm_opp_of_add_table_indexed(struct device *dev, int index); |
559fef0d | 442 | int dev_pm_opp_of_add_table_noclk(struct device *dev, int index); |
8f8d37b2 | 443 | void dev_pm_opp_of_remove_table(struct device *dev); |
ddbb74bc AB |
444 | int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask); |
445 | void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask); | |
446 | int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask); | |
0764c604 | 447 | struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev); |
e2f4b5f8 | 448 | struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp); |
2feb5a89 | 449 | int of_get_required_opp_performance_state(struct device_node *np, int index); |
6d3f922c | 450 | int dev_pm_opp_of_find_icc_paths(struct device *dev, struct opp_table *opp_table); |
0e0ffa85 LL |
451 | int dev_pm_opp_of_register_em(struct device *dev, struct cpumask *cpus); |
452 | static inline void dev_pm_opp_of_unregister_em(struct device *dev) | |
453 | { | |
454 | em_dev_unregister_perf_domain(dev); | |
455 | } | |
d6561bb2 | 456 | #else |
8f8d37b2 | 457 | static inline int dev_pm_opp_of_add_table(struct device *dev) |
d6561bb2 | 458 | { |
1d614920 | 459 | return -EOPNOTSUPP; |
d6561bb2 | 460 | } |
129eec55 | 461 | |
fa9b274f VK |
462 | static inline int dev_pm_opp_of_add_table_indexed(struct device *dev, int index) |
463 | { | |
1d614920 | 464 | return -EOPNOTSUPP; |
fa9b274f VK |
465 | } |
466 | ||
559fef0d VK |
467 | static inline int dev_pm_opp_of_add_table_noclk(struct device *dev, int index) |
468 | { | |
1d614920 | 469 | return -EOPNOTSUPP; |
559fef0d VK |
470 | } |
471 | ||
8f8d37b2 | 472 | static inline void dev_pm_opp_of_remove_table(struct device *dev) |
129eec55 VK |
473 | { |
474 | } | |
8d4d4e98 | 475 | |
ddbb74bc | 476 | static inline int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask) |
8d4d4e98 | 477 | { |
1d614920 | 478 | return -EOPNOTSUPP; |
8d4d4e98 VK |
479 | } |
480 | ||
ddbb74bc | 481 | static inline void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask) |
8d4d4e98 VK |
482 | { |
483 | } | |
484 | ||
ddbb74bc | 485 | static inline int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask) |
8d4d4e98 | 486 | { |
1d614920 | 487 | return -EOPNOTSUPP; |
8d4d4e98 | 488 | } |
0764c604 DG |
489 | |
490 | static inline struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev) | |
491 | { | |
492 | return NULL; | |
493 | } | |
a88bd2a5 | 494 | |
e2f4b5f8 VK |
495 | static inline struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp) |
496 | { | |
497 | return NULL; | |
498 | } | |
a4f342b9 | 499 | |
0e0ffa85 LL |
500 | static inline int dev_pm_opp_of_register_em(struct device *dev, |
501 | struct cpumask *cpus) | |
502 | { | |
1d614920 | 503 | return -EOPNOTSUPP; |
0e0ffa85 LL |
504 | } |
505 | ||
506 | static inline void dev_pm_opp_of_unregister_em(struct device *dev) | |
a4f342b9 QP |
507 | { |
508 | } | |
509 | ||
2feb5a89 | 510 | static inline int of_get_required_opp_performance_state(struct device_node *np, int index) |
4c6a343e | 511 | { |
1d614920 | 512 | return -EOPNOTSUPP; |
4c6a343e | 513 | } |
6d3f922c GD |
514 | |
515 | static inline int dev_pm_opp_of_find_icc_paths(struct device *dev, struct opp_table *opp_table) | |
516 | { | |
1d614920 | 517 | return -EOPNOTSUPP; |
6d3f922c | 518 | } |
d6561bb2 SG |
519 | #endif |
520 | ||
e1f60b29 | 521 | #endif /* __LINUX_OPP_H__ */ |