Blame view

include/linux/pm_opp.h 12.7 KB
d2912cb15   Thomas Gleixner   treewide: Replace...
1
  /* SPDX-License-Identifier: GPL-2.0-only */
e1f60b292   Nishanth Menon   PM: Introduce lib...
2
3
4
5
6
7
8
  /*
   * Generic OPP Interface
   *
   * Copyright (C) 2009-2010 Texas Instruments Incorporated.
   *	Nishanth Menon
   *	Romit Dasgupta
   *	Kevin Hilman
e1f60b292   Nishanth Menon   PM: Introduce lib...
9
10
11
12
   */
  
  #ifndef __LINUX_OPP_H__
  #define __LINUX_OPP_H__
0e0ffa855   Lukasz Luba   OPP: refactor dev...
13
  #include <linux/energy_model.h>
e1f60b292   Nishanth Menon   PM: Introduce lib...
14
  #include <linux/err.h>
03ca370fb   MyungJoo Ham   PM / OPP: Add OPP...
15
  #include <linux/notifier.h>
e1f60b292   Nishanth Menon   PM: Introduce lib...
16

947355850   Viresh Kumar   PM / OPP: Separat...
17
18
  struct clk;
  struct regulator;
47d43ba73   Nishanth Menon   PM / OPP: rename ...
19
  struct dev_pm_opp;
313162d0b   Paul Gortmaker   device.h: audit a...
20
  struct device;
91291d9ad   Stephen Boyd   PM / OPP: Pass op...
21
  struct opp_table;
e1f60b292   Nishanth Menon   PM: Introduce lib...
22

47d43ba73   Nishanth Menon   PM / OPP: rename ...
23
  enum dev_pm_opp_event {
129eec55d   Viresh Kumar   PM / OPP Introduc...
24
  	OPP_EVENT_ADD, OPP_EVENT_REMOVE, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE,
25cb20a21   Stephen Boyd   PM / OPP: Support...
25
  	OPP_EVENT_ADJUST_VOLTAGE,
03ca370fb   MyungJoo Ham   PM / OPP: Add OPP...
26
  };
0f0fe7e01   Viresh Kumar   PM / OPP: Manage ...
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
  /**
   * struct dev_pm_opp_supply - Power supply voltage/current values
   * @u_volt:	Target voltage in microvolts corresponding to this OPP
   * @u_volt_min:	Minimum voltage in microvolts corresponding to this OPP
   * @u_volt_max:	Maximum voltage in microvolts corresponding to this OPP
   * @u_amp:	Maximum current drawn by the device in microamperes
   *
   * This structure stores the voltage/current values for a single power supply.
   */
  struct dev_pm_opp_supply {
  	unsigned long u_volt;
  	unsigned long u_volt_min;
  	unsigned long u_volt_max;
  	unsigned long u_amp;
  };
947355850   Viresh Kumar   PM / OPP: Separat...
42
  /**
6d3f922c4   Georgi Djakov   opp: Add support ...
43
44
45
46
47
48
49
50
51
52
53
54
   * struct dev_pm_opp_icc_bw - Interconnect bandwidth values
   * @avg:	Average bandwidth corresponding to this OPP (in icc units)
   * @peak:	Peak bandwidth corresponding to this OPP (in icc units)
   *
   * This structure stores the bandwidth values for a single interconnect path.
   */
  struct dev_pm_opp_icc_bw {
  	u32 avg;
  	u32 peak;
  };
  
  /**
947355850   Viresh Kumar   PM / OPP: Separat...
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
   * struct dev_pm_opp_info - OPP freq/voltage/current values
   * @rate:	Target clk rate in hz
   * @supplies:	Array of voltage/current values for all power supplies
   *
   * This structure stores the freq/voltage/current values for a single OPP.
   */
  struct dev_pm_opp_info {
  	unsigned long rate;
  	struct dev_pm_opp_supply *supplies;
  };
  
  /**
   * struct dev_pm_set_opp_data - Set OPP data
   * @old_opp:	Old OPP info
   * @new_opp:	New OPP info
   * @regulators:	Array of regulator pointers
   * @regulator_count: Number of regulators
   * @clk:	Pointer to clk
   * @dev:	Pointer to the struct device
   *
   * This structure contains all information required for setting an OPP.
   */
  struct dev_pm_set_opp_data {
  	struct dev_pm_opp_info old_opp;
  	struct dev_pm_opp_info new_opp;
  
  	struct regulator **regulators;
  	unsigned int regulator_count;
  	struct clk *clk;
  	struct device *dev;
  };
e1f60b292   Nishanth Menon   PM: Introduce lib...
86
  #if defined(CONFIG_PM_OPP)
f067a982c   Viresh Kumar   PM / OPP: Add 'st...
87
  struct opp_table *dev_pm_opp_get_opp_table(struct device *dev);
eb7c8743d   Viresh Kumar   OPP: Pass index t...
88
  struct opp_table *dev_pm_opp_get_opp_table_indexed(struct device *dev, int index);
f067a982c   Viresh Kumar   PM / OPP: Add 'st...
89
  void dev_pm_opp_put_opp_table(struct opp_table *opp_table);
47d43ba73   Nishanth Menon   PM / OPP: rename ...
90
  unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp);
e1f60b292   Nishanth Menon   PM: Introduce lib...
91

47d43ba73   Nishanth Menon   PM / OPP: rename ...
92
  unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp);
e1f60b292   Nishanth Menon   PM: Introduce lib...
93

5b93ac542   Rajendra Nayak   OPP: Add support ...
94
  unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp);
19445b25e   Bartlomiej Zolnierkiewicz   PM / OPP: add dev...
95
  bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp);
5d4879cda   Nishanth Menon   PM / OPP: rename ...
96
  int dev_pm_opp_get_opp_count(struct device *dev);
3ca9bb33c   Viresh Kumar   PM / OPP: Add clo...
97
  unsigned long dev_pm_opp_get_max_clock_latency(struct device *dev);
655c9df96   Viresh Kumar   PM / OPP: Introdu...
98
  unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev);
217434476   Viresh Kumar   PM / OPP: Introdu...
99
  unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev);
3aa26a3b2   Viresh Kumar   PM / OPP: Rename ...
100
  unsigned long dev_pm_opp_get_suspend_opp_freq(struct device *dev);
e1f60b292   Nishanth Menon   PM: Introduce lib...
101

47d43ba73   Nishanth Menon   PM / OPP: rename ...
102
103
104
  struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev,
  					      unsigned long freq,
  					      bool available);
71419d84c   Niklas Cassel   opp: Add dev_pm_o...
105
106
  struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev,
  					       unsigned int level);
e1f60b292   Nishanth Menon   PM: Introduce lib...
107

47d43ba73   Nishanth Menon   PM / OPP: rename ...
108
109
  struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
  					      unsigned long *freq);
2f36bde0f   Andrew-sh.Cheng   OPP: Introduce de...
110
111
  struct dev_pm_opp *dev_pm_opp_find_freq_ceil_by_volt(struct device *dev,
  						     unsigned long u_volt);
e1f60b292   Nishanth Menon   PM: Introduce lib...
112

47d43ba73   Nishanth Menon   PM / OPP: rename ...
113
114
  struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
  					     unsigned long *freq);
7034764a1   Viresh Kumar   PM / OPP: Add 'st...
115
  void dev_pm_opp_put(struct dev_pm_opp *opp);
e1f60b292   Nishanth Menon   PM: Introduce lib...
116

5d4879cda   Nishanth Menon   PM / OPP: rename ...
117
118
  int dev_pm_opp_add(struct device *dev, unsigned long freq,
  		   unsigned long u_volt);
129eec55d   Viresh Kumar   PM / OPP Introduc...
119
  void dev_pm_opp_remove(struct device *dev, unsigned long freq);
1690d8bb9   Viresh Kumar   cpufreq: scpi/scm...
120
  void dev_pm_opp_remove_all_dynamic(struct device *dev);
e1f60b292   Nishanth Menon   PM: Introduce lib...
121

25cb20a21   Stephen Boyd   PM / OPP: Support...
122
123
124
  int dev_pm_opp_adjust_voltage(struct device *dev, unsigned long freq,
  			      unsigned long u_volt, unsigned long u_volt_min,
  			      unsigned long u_volt_max);
5d4879cda   Nishanth Menon   PM / OPP: rename ...
125
  int dev_pm_opp_enable(struct device *dev, unsigned long freq);
e1f60b292   Nishanth Menon   PM: Introduce lib...
126

5d4879cda   Nishanth Menon   PM / OPP: rename ...
127
  int dev_pm_opp_disable(struct device *dev, unsigned long freq);
e1f60b292   Nishanth Menon   PM: Introduce lib...
128

dc2c9ad52   Viresh Kumar   PM / OPP: Don't e...
129
130
  int dev_pm_opp_register_notifier(struct device *dev, struct notifier_block *nb);
  int dev_pm_opp_unregister_notifier(struct device *dev, struct notifier_block *nb);
fa30184d1   Viresh Kumar   PM / OPP: Return ...
131
132
133
134
  struct opp_table *dev_pm_opp_set_supported_hw(struct device *dev, const u32 *versions, unsigned int count);
  void dev_pm_opp_put_supported_hw(struct opp_table *opp_table);
  struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char *name);
  void dev_pm_opp_put_prop_name(struct opp_table *opp_table);
dfbe4678d   Viresh Kumar   PM / OPP: Add inf...
135
136
  struct opp_table *dev_pm_opp_set_regulators(struct device *dev, const char * const names[], unsigned int count);
  void dev_pm_opp_put_regulators(struct opp_table *opp_table);
829a4e8c0   Viresh Kumar   PM / OPP: Add dev...
137
138
  struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char * name);
  void dev_pm_opp_put_clkname(struct opp_table *opp_table);
fa30184d1   Viresh Kumar   PM / OPP: Return ...
139
  struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data));
604a7aeb4   Viresh Kumar   PM / OPP: Rename ...
140
  void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table);
17a8f868a   Viresh Kumar   opp: Return genpd...
141
  struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names, struct device ***virt_devs);
6319aee10   Viresh Kumar   opp: Attach genpd...
142
  void dev_pm_opp_detach_genpd(struct opp_table *opp_table);
c8a59103e   Viresh Kumar   OPP: Add dev_pm_o...
143
  int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate);
6a0712f6f   Viresh Kumar   PM / OPP: Add dev...
144
  int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq);
3ae1f39ae   Sibi Sankar   OPP: Add and expo...
145
  int dev_pm_opp_set_bw(struct device *dev, struct dev_pm_opp *opp);
ddbb74bc7   Arnd Bergmann   PM / OPP: pass cp...
146
147
  int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const struct cpumask *cpumask);
  int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask);
411466c50   Sudeep Holla   PM / OPP: add non...
148
149
  void dev_pm_opp_remove_table(struct device *dev);
  void dev_pm_opp_cpumask_remove_table(const struct cpumask *cpumask);
e1f60b292   Nishanth Menon   PM: Introduce lib...
150
  #else
f067a982c   Viresh Kumar   PM / OPP: Add 'st...
151
152
153
154
  static inline struct opp_table *dev_pm_opp_get_opp_table(struct device *dev)
  {
  	return ERR_PTR(-ENOTSUPP);
  }
eb7c8743d   Viresh Kumar   OPP: Pass index t...
155
156
157
158
  static inline struct opp_table *dev_pm_opp_get_opp_table_indexed(struct device *dev, int index)
  {
  	return ERR_PTR(-ENOTSUPP);
  }
f067a982c   Viresh Kumar   PM / OPP: Add 'st...
159
  static inline void dev_pm_opp_put_opp_table(struct opp_table *opp_table) {}
47d43ba73   Nishanth Menon   PM / OPP: rename ...
160
  static inline unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp)
e1f60b292   Nishanth Menon   PM: Introduce lib...
161
162
163
  {
  	return 0;
  }
47d43ba73   Nishanth Menon   PM / OPP: rename ...
164
  static inline unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)
e1f60b292   Nishanth Menon   PM: Introduce lib...
165
166
167
  {
  	return 0;
  }
5b93ac542   Rajendra Nayak   OPP: Add support ...
168
169
170
171
  static inline unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp)
  {
  	return 0;
  }
19445b25e   Bartlomiej Zolnierkiewicz   PM / OPP: add dev...
172
173
174
175
  static inline bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp)
  {
  	return false;
  }
5d4879cda   Nishanth Menon   PM / OPP: rename ...
176
  static inline int dev_pm_opp_get_opp_count(struct device *dev)
e1f60b292   Nishanth Menon   PM: Introduce lib...
177
178
179
  {
  	return 0;
  }
3ca9bb33c   Viresh Kumar   PM / OPP: Add clo...
180
181
182
183
  static inline unsigned long dev_pm_opp_get_max_clock_latency(struct device *dev)
  {
  	return 0;
  }
655c9df96   Viresh Kumar   PM / OPP: Introdu...
184
185
186
187
  static inline unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev)
  {
  	return 0;
  }
217434476   Viresh Kumar   PM / OPP: Introdu...
188
189
190
191
  static inline unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev)
  {
  	return 0;
  }
3aa26a3b2   Viresh Kumar   PM / OPP: Rename ...
192
  static inline unsigned long dev_pm_opp_get_suspend_opp_freq(struct device *dev)
4eafbd15b   Bartlomiej Zolnierkiewicz   PM / OPP: add dev...
193
  {
3aa26a3b2   Viresh Kumar   PM / OPP: Rename ...
194
  	return 0;
4eafbd15b   Bartlomiej Zolnierkiewicz   PM / OPP: add dev...
195
  }
47d43ba73   Nishanth Menon   PM / OPP: rename ...
196
  static inline struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev,
e1f60b292   Nishanth Menon   PM: Introduce lib...
197
198
  					unsigned long freq, bool available)
  {
d708b384c   Viresh Kumar   PM / OPP: -ENOSYS...
199
  	return ERR_PTR(-ENOTSUPP);
e1f60b292   Nishanth Menon   PM: Introduce lib...
200
  }
71419d84c   Niklas Cassel   opp: Add dev_pm_o...
201
202
203
204
205
  static inline struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev,
  					unsigned int level)
  {
  	return ERR_PTR(-ENOTSUPP);
  }
47d43ba73   Nishanth Menon   PM / OPP: rename ...
206
  static inline struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
e1f60b292   Nishanth Menon   PM: Introduce lib...
207
208
  					unsigned long *freq)
  {
d708b384c   Viresh Kumar   PM / OPP: -ENOSYS...
209
  	return ERR_PTR(-ENOTSUPP);
e1f60b292   Nishanth Menon   PM: Introduce lib...
210
  }
2f36bde0f   Andrew-sh.Cheng   OPP: Introduce de...
211
212
213
214
215
  static inline struct dev_pm_opp *dev_pm_opp_find_freq_ceil_by_volt(struct device *dev,
  					unsigned long u_volt)
  {
  	return ERR_PTR(-ENOTSUPP);
  }
47d43ba73   Nishanth Menon   PM / OPP: rename ...
216
  static inline struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
e1f60b292   Nishanth Menon   PM: Introduce lib...
217
218
  					unsigned long *freq)
  {
d708b384c   Viresh Kumar   PM / OPP: -ENOSYS...
219
  	return ERR_PTR(-ENOTSUPP);
e1f60b292   Nishanth Menon   PM: Introduce lib...
220
  }
7034764a1   Viresh Kumar   PM / OPP: Add 'st...
221
  static inline void dev_pm_opp_put(struct dev_pm_opp *opp) {}
5d4879cda   Nishanth Menon   PM / OPP: rename ...
222
  static inline int dev_pm_opp_add(struct device *dev, unsigned long freq,
e1f60b292   Nishanth Menon   PM: Introduce lib...
223
224
  					unsigned long u_volt)
  {
d708b384c   Viresh Kumar   PM / OPP: -ENOSYS...
225
  	return -ENOTSUPP;
e1f60b292   Nishanth Menon   PM: Introduce lib...
226
  }
129eec55d   Viresh Kumar   PM / OPP Introduc...
227
228
229
  static inline void dev_pm_opp_remove(struct device *dev, unsigned long freq)
  {
  }
1690d8bb9   Viresh Kumar   cpufreq: scpi/scm...
230
231
232
  static inline void dev_pm_opp_remove_all_dynamic(struct device *dev)
  {
  }
25cb20a21   Stephen Boyd   PM / OPP: Support...
233
234
235
236
237
238
239
  static inline int
  dev_pm_opp_adjust_voltage(struct device *dev, unsigned long freq,
  			  unsigned long u_volt, unsigned long u_volt_min,
  			  unsigned long u_volt_max)
  {
  	return 0;
  }
5d4879cda   Nishanth Menon   PM / OPP: rename ...
240
  static inline int dev_pm_opp_enable(struct device *dev, unsigned long freq)
e1f60b292   Nishanth Menon   PM: Introduce lib...
241
242
243
  {
  	return 0;
  }
5d4879cda   Nishanth Menon   PM / OPP: rename ...
244
  static inline int dev_pm_opp_disable(struct device *dev, unsigned long freq)
e1f60b292   Nishanth Menon   PM: Introduce lib...
245
246
247
  {
  	return 0;
  }
03ca370fb   MyungJoo Ham   PM / OPP: Add OPP...
248

dc2c9ad52   Viresh Kumar   PM / OPP: Don't e...
249
  static inline int dev_pm_opp_register_notifier(struct device *dev, struct notifier_block *nb)
03ca370fb   MyungJoo Ham   PM / OPP: Add OPP...
250
  {
dc2c9ad52   Viresh Kumar   PM / OPP: Don't e...
251
252
253
254
255
256
  	return -ENOTSUPP;
  }
  
  static inline int dev_pm_opp_unregister_notifier(struct device *dev, struct notifier_block *nb)
  {
  	return -ENOTSUPP;
03ca370fb   MyungJoo Ham   PM / OPP: Add OPP...
257
  }
7de36b0aa   Viresh Kumar   PM / OPP: Parse '...
258

fa30184d1   Viresh Kumar   PM / OPP: Return ...
259
260
261
  static inline struct opp_table *dev_pm_opp_set_supported_hw(struct device *dev,
  							    const u32 *versions,
  							    unsigned int count)
7de36b0aa   Viresh Kumar   PM / OPP: Parse '...
262
  {
fa30184d1   Viresh Kumar   PM / OPP: Return ...
263
  	return ERR_PTR(-ENOTSUPP);
7de36b0aa   Viresh Kumar   PM / OPP: Parse '...
264
  }
fa30184d1   Viresh Kumar   PM / OPP: Return ...
265
  static inline void dev_pm_opp_put_supported_hw(struct opp_table *opp_table) {}
7de36b0aa   Viresh Kumar   PM / OPP: Parse '...
266

fa30184d1   Viresh Kumar   PM / OPP: Return ...
267
  static inline struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev,
4dab160eb   Viresh Kumar   PM / OPP: Allow p...
268
269
  			int (*set_opp)(struct dev_pm_set_opp_data *data))
  {
fa30184d1   Viresh Kumar   PM / OPP: Return ...
270
  	return ERR_PTR(-ENOTSUPP);
4dab160eb   Viresh Kumar   PM / OPP: Allow p...
271
  }
604a7aeb4   Viresh Kumar   PM / OPP: Rename ...
272
  static inline void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table) {}
4dab160eb   Viresh Kumar   PM / OPP: Allow p...
273

fa30184d1   Viresh Kumar   PM / OPP: Return ...
274
  static inline struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char *name)
01fb4d3c3   Viresh Kumar   PM / OPP: Parse '...
275
  {
fa30184d1   Viresh Kumar   PM / OPP: Return ...
276
  	return ERR_PTR(-ENOTSUPP);
01fb4d3c3   Viresh Kumar   PM / OPP: Parse '...
277
  }
fa30184d1   Viresh Kumar   PM / OPP: Return ...
278
  static inline void dev_pm_opp_put_prop_name(struct opp_table *opp_table) {}
01fb4d3c3   Viresh Kumar   PM / OPP: Parse '...
279

dfbe4678d   Viresh Kumar   PM / OPP: Add inf...
280
  static inline struct opp_table *dev_pm_opp_set_regulators(struct device *dev, const char * const names[], unsigned int count)
9f8ea969d   Viresh Kumar   PM / OPP: get/put...
281
  {
91291d9ad   Stephen Boyd   PM / OPP: Pass op...
282
  	return ERR_PTR(-ENOTSUPP);
9f8ea969d   Viresh Kumar   PM / OPP: get/put...
283
  }
dfbe4678d   Viresh Kumar   PM / OPP: Add inf...
284
  static inline void dev_pm_opp_put_regulators(struct opp_table *opp_table) {}
9f8ea969d   Viresh Kumar   PM / OPP: get/put...
285

829a4e8c0   Viresh Kumar   PM / OPP: Add dev...
286
287
288
289
290
291
  static inline struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char * name)
  {
  	return ERR_PTR(-ENOTSUPP);
  }
  
  static inline void dev_pm_opp_put_clkname(struct opp_table *opp_table) {}
17a8f868a   Viresh Kumar   opp: Return genpd...
292
  static inline struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names, struct device ***virt_devs)
4f018bc0e   Viresh Kumar   OPP: Add dev_pm_o...
293
294
295
  {
  	return ERR_PTR(-ENOTSUPP);
  }
6319aee10   Viresh Kumar   opp: Attach genpd...
296
  static inline void dev_pm_opp_detach_genpd(struct opp_table *opp_table) {}
c8a59103e   Viresh Kumar   OPP: Add dev_pm_o...
297
298
299
300
301
  
  static inline int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate)
  {
  	return -ENOTSUPP;
  }
6a0712f6f   Viresh Kumar   PM / OPP: Add dev...
302
303
  static inline int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
  {
d708b384c   Viresh Kumar   PM / OPP: -ENOSYS...
304
  	return -ENOTSUPP;
6a0712f6f   Viresh Kumar   PM / OPP: Add dev...
305
  }
3ae1f39ae   Sibi Sankar   OPP: Add and expo...
306
307
308
309
  static inline int dev_pm_opp_set_bw(struct device *dev, struct dev_pm_opp *opp)
  {
  	return -EOPNOTSUPP;
  }
ddbb74bc7   Arnd Bergmann   PM / OPP: pass cp...
310
  static inline int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const struct cpumask *cpumask)
642aa8cee   Viresh Kumar   PM / OPP: dev_pm_...
311
  {
d708b384c   Viresh Kumar   PM / OPP: -ENOSYS...
312
  	return -ENOTSUPP;
642aa8cee   Viresh Kumar   PM / OPP: dev_pm_...
313
  }
ddbb74bc7   Arnd Bergmann   PM / OPP: pass cp...
314
  static inline int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask)
6f707daa3   Viresh Kumar   PM / OPP: Add dev...
315
316
317
  {
  	return -EINVAL;
  }
411466c50   Sudeep Holla   PM / OPP: add non...
318
319
320
321
322
323
324
  static inline void dev_pm_opp_remove_table(struct device *dev)
  {
  }
  
  static inline void dev_pm_opp_cpumask_remove_table(const struct cpumask *cpumask)
  {
  }
a96d69d1b   Tony Lindgren   PM / OPP: Fix bui...
325
  #endif		/* CONFIG_PM_OPP */
e1f60b292   Nishanth Menon   PM: Introduce lib...
326

d6561bb20   Shawn Guo   PM / OPP: fix con...
327
  #if defined(CONFIG_PM_OPP) && defined(CONFIG_OF)
8f8d37b25   Viresh Kumar   PM / OPP: Prefix ...
328
  int dev_pm_opp_of_add_table(struct device *dev);
fa9b274f8   Viresh Kumar   PM / OPP: Impleme...
329
  int dev_pm_opp_of_add_table_indexed(struct device *dev, int index);
8f8d37b25   Viresh Kumar   PM / OPP: Prefix ...
330
  void dev_pm_opp_of_remove_table(struct device *dev);
ddbb74bc7   Arnd Bergmann   PM / OPP: pass cp...
331
332
333
  int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask);
  void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask);
  int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask);
0764c604c   Dave Gerlach   PM / OPP: Expose ...
334
  struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev);
e2f4b5f8d   Viresh Kumar   PM / OPP: Impleme...
335
  struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp);
2feb5a896   Viresh Kumar   OPP: Don't return...
336
  int of_get_required_opp_performance_state(struct device_node *np, int index);
6d3f922c4   Georgi Djakov   opp: Add support ...
337
  int dev_pm_opp_of_find_icc_paths(struct device *dev, struct opp_table *opp_table);
0e0ffa855   Lukasz Luba   OPP: refactor dev...
338
339
340
341
342
  int dev_pm_opp_of_register_em(struct device *dev, struct cpumask *cpus);
  static inline void dev_pm_opp_of_unregister_em(struct device *dev)
  {
  	em_dev_unregister_perf_domain(dev);
  }
d6561bb20   Shawn Guo   PM / OPP: fix con...
343
  #else
8f8d37b25   Viresh Kumar   PM / OPP: Prefix ...
344
  static inline int dev_pm_opp_of_add_table(struct device *dev)
d6561bb20   Shawn Guo   PM / OPP: fix con...
345
  {
d708b384c   Viresh Kumar   PM / OPP: -ENOSYS...
346
  	return -ENOTSUPP;
d6561bb20   Shawn Guo   PM / OPP: fix con...
347
  }
129eec55d   Viresh Kumar   PM / OPP Introduc...
348

fa9b274f8   Viresh Kumar   PM / OPP: Impleme...
349
350
351
352
  static inline int dev_pm_opp_of_add_table_indexed(struct device *dev, int index)
  {
  	return -ENOTSUPP;
  }
8f8d37b25   Viresh Kumar   PM / OPP: Prefix ...
353
  static inline void dev_pm_opp_of_remove_table(struct device *dev)
129eec55d   Viresh Kumar   PM / OPP Introduc...
354
355
  {
  }
8d4d4e98a   Viresh Kumar   PM / OPP: Add hel...
356

ddbb74bc7   Arnd Bergmann   PM / OPP: pass cp...
357
  static inline int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask)
8d4d4e98a   Viresh Kumar   PM / OPP: Add hel...
358
  {
d708b384c   Viresh Kumar   PM / OPP: -ENOSYS...
359
  	return -ENOTSUPP;
8d4d4e98a   Viresh Kumar   PM / OPP: Add hel...
360
  }
ddbb74bc7   Arnd Bergmann   PM / OPP: pass cp...
361
  static inline void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask)
8d4d4e98a   Viresh Kumar   PM / OPP: Add hel...
362
363
  {
  }
ddbb74bc7   Arnd Bergmann   PM / OPP: pass cp...
364
  static inline int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask)
8d4d4e98a   Viresh Kumar   PM / OPP: Add hel...
365
  {
d708b384c   Viresh Kumar   PM / OPP: -ENOSYS...
366
  	return -ENOTSUPP;
8d4d4e98a   Viresh Kumar   PM / OPP: Add hel...
367
  }
0764c604c   Dave Gerlach   PM / OPP: Expose ...
368
369
370
371
372
  
  static inline struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev)
  {
  	return NULL;
  }
a88bd2a51   Viresh Kumar   PM / OPP: Impleme...
373

e2f4b5f8d   Viresh Kumar   PM / OPP: Impleme...
374
375
376
377
  static inline struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp)
  {
  	return NULL;
  }
a4f342b96   Quentin Perret   PM / OPP: Introdu...
378

0e0ffa855   Lukasz Luba   OPP: refactor dev...
379
380
381
382
383
384
385
  static inline int dev_pm_opp_of_register_em(struct device *dev,
  					    struct cpumask *cpus)
  {
  	return -ENOTSUPP;
  }
  
  static inline void dev_pm_opp_of_unregister_em(struct device *dev)
a4f342b96   Quentin Perret   PM / OPP: Introdu...
386
387
  {
  }
2feb5a896   Viresh Kumar   OPP: Don't return...
388
  static inline int of_get_required_opp_performance_state(struct device_node *np, int index)
4c6a343e5   Viresh Kumar   OPP: Rename and r...
389
  {
2feb5a896   Viresh Kumar   OPP: Don't return...
390
  	return -ENOTSUPP;
4c6a343e5   Viresh Kumar   OPP: Rename and r...
391
  }
6d3f922c4   Georgi Djakov   opp: Add support ...
392
393
394
395
396
  
  static inline int dev_pm_opp_of_find_icc_paths(struct device *dev, struct opp_table *opp_table)
  {
  	return -ENOTSUPP;
  }
d6561bb20   Shawn Guo   PM / OPP: fix con...
397
  #endif
e1f60b292   Nishanth Menon   PM: Introduce lib...
398
  #endif		/* __LINUX_OPP_H__ */