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