diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-27 20:29:34 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-27 20:29:34 -0400 |
commit | 93658cb8597ab76655220be43d3d7f74c66e9e4e (patch) | |
tree | e6da56aac9cda2c80315cc73ee31ef4c47af8472 /Documentation/power | |
parent | 6e0ca95aa3c83c47d13f9f400bfaaa853d0b224b (diff) | |
parent | ad7722dab7292dbc1c4586d701ac226b68122d39 (diff) |
Merge branch 'pm-cpufreq'
* pm-cpufreq: (167 commits)
cpufreq: create per policy rwsem instead of per CPU cpu_policy_rwsem
intel_pstate: Add Baytrail support
intel_pstate: Refactor driver to support CPUs with different MSR layouts
cpufreq: Implement light weight ->target_index() routine
PM / OPP: rename header to linux/pm_opp.h
PM / OPP: rename data structures to dev_pm equivalents
PM / OPP: rename functions to dev_pm_opp*
cpufreq / governor: Remove fossil comment
cpufreq: exynos4210: Use the common clock framework to set APLL clock rate
cpufreq: exynos4x12: Use the common clock framework to set APLL clock rate
cpufreq: Detect spurious invocations of update_policy_cpu()
cpufreq: pmac64: enable cpufreq on iMac G5 (iSight) model
cpufreq: pmac64: provide cpufreq transition latency for older G5 models
cpufreq: pmac64: speed up frequency switch
cpufreq: highbank-cpufreq: Enable Midway/ECX-2000
exynos-cpufreq: fix false return check from "regulator_set_voltage"
speedstep-centrino: Remove unnecessary braces
acpi-cpufreq: Add comment under ACPI_ADR_SPACE_SYSTEM_IO case
cpufreq: arm-big-little: use clk_get instead of clk_get_sys
cpufreq: exynos: Show a list of available frequencies
...
Conflicts:
drivers/devfreq/exynos/exynos5_bus.c
Diffstat (limited to 'Documentation/power')
-rw-r--r-- | Documentation/power/opp.txt | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/Documentation/power/opp.txt b/Documentation/power/opp.txt index 425c51d56aef..b8a907dc0169 100644 --- a/Documentation/power/opp.txt +++ b/Documentation/power/opp.txt | |||
@@ -42,7 +42,7 @@ We can represent these as three OPPs as the following {Hz, uV} tuples: | |||
42 | 42 | ||
43 | OPP library provides a set of helper functions to organize and query the OPP | 43 | OPP library provides a set of helper functions to organize and query the OPP |
44 | information. The library is located in drivers/base/power/opp.c and the header | 44 | information. The library is located in drivers/base/power/opp.c and the header |
45 | is located in include/linux/opp.h. OPP library can be enabled by enabling | 45 | is located in include/linux/pm_opp.h. OPP library can be enabled by enabling |
46 | CONFIG_PM_OPP from power management menuconfig menu. OPP library depends on | 46 | CONFIG_PM_OPP from power management menuconfig menu. OPP library depends on |
47 | CONFIG_PM as certain SoCs such as Texas Instrument's OMAP framework allows to | 47 | CONFIG_PM as certain SoCs such as Texas Instrument's OMAP framework allows to |
48 | optionally boot at a certain OPP without needing cpufreq. | 48 | optionally boot at a certain OPP without needing cpufreq. |
@@ -71,14 +71,14 @@ operations until that OPP could be re-enabled if possible. | |||
71 | 71 | ||
72 | OPP library facilitates this concept in it's implementation. The following | 72 | OPP library facilitates this concept in it's implementation. The following |
73 | operational functions operate only on available opps: | 73 | operational functions operate only on available opps: |
74 | opp_find_freq_{ceil, floor}, opp_get_voltage, opp_get_freq, opp_get_opp_count | 74 | opp_find_freq_{ceil, floor}, dev_pm_opp_get_voltage, dev_pm_opp_get_freq, dev_pm_opp_get_opp_count |
75 | and opp_init_cpufreq_table | 75 | and dev_pm_opp_init_cpufreq_table |
76 | 76 | ||
77 | opp_find_freq_exact is meant to be used to find the opp pointer which can then | 77 | dev_pm_opp_find_freq_exact is meant to be used to find the opp pointer which can then |
78 | be used for opp_enable/disable functions to make an opp available as required. | 78 | be used for dev_pm_opp_enable/disable functions to make an opp available as required. |
79 | 79 | ||
80 | WARNING: Users of OPP library should refresh their availability count using | 80 | WARNING: Users of OPP library should refresh their availability count using |
81 | get_opp_count if opp_enable/disable functions are invoked for a device, the | 81 | get_opp_count if dev_pm_opp_enable/disable functions are invoked for a device, the |
82 | exact mechanism to trigger these or the notification mechanism to other | 82 | exact mechanism to trigger these or the notification mechanism to other |
83 | dependent subsystems such as cpufreq are left to the discretion of the SoC | 83 | dependent subsystems such as cpufreq are left to the discretion of the SoC |
84 | specific framework which uses the OPP library. Similar care needs to be taken | 84 | specific framework which uses the OPP library. Similar care needs to be taken |
@@ -96,24 +96,24 @@ using RCU read locks. The opp_find_freq_{exact,ceil,floor}, | |||
96 | opp_get_{voltage, freq, opp_count} fall into this category. | 96 | opp_get_{voltage, freq, opp_count} fall into this category. |
97 | 97 | ||
98 | opp_{add,enable,disable} are updaters which use mutex and implement it's own | 98 | opp_{add,enable,disable} are updaters which use mutex and implement it's own |
99 | RCU locking mechanisms. opp_init_cpufreq_table acts as an updater and uses | 99 | RCU locking mechanisms. dev_pm_opp_init_cpufreq_table acts as an updater and uses |
100 | mutex to implment RCU updater strategy. These functions should *NOT* be called | 100 | mutex to implment RCU updater strategy. These functions should *NOT* be called |
101 | under RCU locks and other contexts that prevent blocking functions in RCU or | 101 | under RCU locks and other contexts that prevent blocking functions in RCU or |
102 | mutex operations from working. | 102 | mutex operations from working. |
103 | 103 | ||
104 | 2. Initial OPP List Registration | 104 | 2. Initial OPP List Registration |
105 | ================================ | 105 | ================================ |
106 | The SoC implementation calls opp_add function iteratively to add OPPs per | 106 | The SoC implementation calls dev_pm_opp_add function iteratively to add OPPs per |
107 | device. It is expected that the SoC framework will register the OPP entries | 107 | device. It is expected that the SoC framework will register the OPP entries |
108 | optimally- typical numbers range to be less than 5. The list generated by | 108 | optimally- typical numbers range to be less than 5. The list generated by |
109 | registering the OPPs is maintained by OPP library throughout the device | 109 | registering the OPPs is maintained by OPP library throughout the device |
110 | operation. The SoC framework can subsequently control the availability of the | 110 | operation. The SoC framework can subsequently control the availability of the |
111 | OPPs dynamically using the opp_enable / disable functions. | 111 | OPPs dynamically using the dev_pm_opp_enable / disable functions. |
112 | 112 | ||
113 | opp_add - Add a new OPP for a specific domain represented by the device pointer. | 113 | dev_pm_opp_add - Add a new OPP for a specific domain represented by the device pointer. |
114 | The OPP is defined using the frequency and voltage. Once added, the OPP | 114 | The OPP is defined using the frequency and voltage. Once added, the OPP |
115 | is assumed to be available and control of it's availability can be done | 115 | is assumed to be available and control of it's availability can be done |
116 | with the opp_enable/disable functions. OPP library internally stores | 116 | with the dev_pm_opp_enable/disable functions. OPP library internally stores |
117 | and manages this information in the opp struct. This function may be | 117 | and manages this information in the opp struct. This function may be |
118 | used by SoC framework to define a optimal list as per the demands of | 118 | used by SoC framework to define a optimal list as per the demands of |
119 | SoC usage environment. | 119 | SoC usage environment. |
@@ -124,7 +124,7 @@ opp_add - Add a new OPP for a specific domain represented by the device pointer. | |||
124 | soc_pm_init() | 124 | soc_pm_init() |
125 | { | 125 | { |
126 | /* Do things */ | 126 | /* Do things */ |
127 | r = opp_add(mpu_dev, 1000000, 900000); | 127 | r = dev_pm_opp_add(mpu_dev, 1000000, 900000); |
128 | if (!r) { | 128 | if (!r) { |
129 | pr_err("%s: unable to register mpu opp(%d)\n", r); | 129 | pr_err("%s: unable to register mpu opp(%d)\n", r); |
130 | goto no_cpufreq; | 130 | goto no_cpufreq; |
@@ -143,44 +143,44 @@ functions return the matching pointer representing the opp if a match is | |||
143 | found, else returns error. These errors are expected to be handled by standard | 143 | found, else returns error. These errors are expected to be handled by standard |
144 | error checks such as IS_ERR() and appropriate actions taken by the caller. | 144 | error checks such as IS_ERR() and appropriate actions taken by the caller. |
145 | 145 | ||
146 | opp_find_freq_exact - Search for an OPP based on an *exact* frequency and | 146 | dev_pm_opp_find_freq_exact - Search for an OPP based on an *exact* frequency and |
147 | availability. This function is especially useful to enable an OPP which | 147 | availability. This function is especially useful to enable an OPP which |
148 | is not available by default. | 148 | is not available by default. |
149 | Example: In a case when SoC framework detects a situation where a | 149 | Example: In a case when SoC framework detects a situation where a |
150 | higher frequency could be made available, it can use this function to | 150 | higher frequency could be made available, it can use this function to |
151 | find the OPP prior to call the opp_enable to actually make it available. | 151 | find the OPP prior to call the dev_pm_opp_enable to actually make it available. |
152 | rcu_read_lock(); | 152 | rcu_read_lock(); |
153 | opp = opp_find_freq_exact(dev, 1000000000, false); | 153 | opp = dev_pm_opp_find_freq_exact(dev, 1000000000, false); |
154 | rcu_read_unlock(); | 154 | rcu_read_unlock(); |
155 | /* dont operate on the pointer.. just do a sanity check.. */ | 155 | /* dont operate on the pointer.. just do a sanity check.. */ |
156 | if (IS_ERR(opp)) { | 156 | if (IS_ERR(opp)) { |
157 | pr_err("frequency not disabled!\n"); | 157 | pr_err("frequency not disabled!\n"); |
158 | /* trigger appropriate actions.. */ | 158 | /* trigger appropriate actions.. */ |
159 | } else { | 159 | } else { |
160 | opp_enable(dev,1000000000); | 160 | dev_pm_opp_enable(dev,1000000000); |
161 | } | 161 | } |
162 | 162 | ||
163 | NOTE: This is the only search function that operates on OPPs which are | 163 | NOTE: This is the only search function that operates on OPPs which are |
164 | not available. | 164 | not available. |
165 | 165 | ||
166 | opp_find_freq_floor - Search for an available OPP which is *at most* the | 166 | dev_pm_opp_find_freq_floor - Search for an available OPP which is *at most* the |
167 | provided frequency. This function is useful while searching for a lesser | 167 | provided frequency. This function is useful while searching for a lesser |
168 | match OR operating on OPP information in the order of decreasing | 168 | match OR operating on OPP information in the order of decreasing |
169 | frequency. | 169 | frequency. |
170 | Example: To find the highest opp for a device: | 170 | Example: To find the highest opp for a device: |
171 | freq = ULONG_MAX; | 171 | freq = ULONG_MAX; |
172 | rcu_read_lock(); | 172 | rcu_read_lock(); |
173 | opp_find_freq_floor(dev, &freq); | 173 | dev_pm_opp_find_freq_floor(dev, &freq); |
174 | rcu_read_unlock(); | 174 | rcu_read_unlock(); |
175 | 175 | ||
176 | opp_find_freq_ceil - Search for an available OPP which is *at least* the | 176 | dev_pm_opp_find_freq_ceil - Search for an available OPP which is *at least* the |
177 | provided frequency. This function is useful while searching for a | 177 | provided frequency. This function is useful while searching for a |
178 | higher match OR operating on OPP information in the order of increasing | 178 | higher match OR operating on OPP information in the order of increasing |
179 | frequency. | 179 | frequency. |
180 | Example 1: To find the lowest opp for a device: | 180 | Example 1: To find the lowest opp for a device: |
181 | freq = 0; | 181 | freq = 0; |
182 | rcu_read_lock(); | 182 | rcu_read_lock(); |
183 | opp_find_freq_ceil(dev, &freq); | 183 | dev_pm_opp_find_freq_ceil(dev, &freq); |
184 | rcu_read_unlock(); | 184 | rcu_read_unlock(); |
185 | Example 2: A simplified implementation of a SoC cpufreq_driver->target: | 185 | Example 2: A simplified implementation of a SoC cpufreq_driver->target: |
186 | soc_cpufreq_target(..) | 186 | soc_cpufreq_target(..) |
@@ -188,7 +188,7 @@ opp_find_freq_ceil - Search for an available OPP which is *at least* the | |||
188 | /* Do stuff like policy checks etc. */ | 188 | /* Do stuff like policy checks etc. */ |
189 | /* Find the best frequency match for the req */ | 189 | /* Find the best frequency match for the req */ |
190 | rcu_read_lock(); | 190 | rcu_read_lock(); |
191 | opp = opp_find_freq_ceil(dev, &freq); | 191 | opp = dev_pm_opp_find_freq_ceil(dev, &freq); |
192 | rcu_read_unlock(); | 192 | rcu_read_unlock(); |
193 | if (!IS_ERR(opp)) | 193 | if (!IS_ERR(opp)) |
194 | soc_switch_to_freq_voltage(freq); | 194 | soc_switch_to_freq_voltage(freq); |
@@ -208,34 +208,34 @@ as thermal considerations (e.g. don't use OPPx until the temperature drops). | |||
208 | 208 | ||
209 | WARNING: Do not use these functions in interrupt context. | 209 | WARNING: Do not use these functions in interrupt context. |
210 | 210 | ||
211 | opp_enable - Make a OPP available for operation. | 211 | dev_pm_opp_enable - Make a OPP available for operation. |
212 | Example: Lets say that 1GHz OPP is to be made available only if the | 212 | Example: Lets say that 1GHz OPP is to be made available only if the |
213 | SoC temperature is lower than a certain threshold. The SoC framework | 213 | SoC temperature is lower than a certain threshold. The SoC framework |
214 | implementation might choose to do something as follows: | 214 | implementation might choose to do something as follows: |
215 | if (cur_temp < temp_low_thresh) { | 215 | if (cur_temp < temp_low_thresh) { |
216 | /* Enable 1GHz if it was disabled */ | 216 | /* Enable 1GHz if it was disabled */ |
217 | rcu_read_lock(); | 217 | rcu_read_lock(); |
218 | opp = opp_find_freq_exact(dev, 1000000000, false); | 218 | opp = dev_pm_opp_find_freq_exact(dev, 1000000000, false); |
219 | rcu_read_unlock(); | 219 | rcu_read_unlock(); |
220 | /* just error check */ | 220 | /* just error check */ |
221 | if (!IS_ERR(opp)) | 221 | if (!IS_ERR(opp)) |
222 | ret = opp_enable(dev, 1000000000); | 222 | ret = dev_pm_opp_enable(dev, 1000000000); |
223 | else | 223 | else |
224 | goto try_something_else; | 224 | goto try_something_else; |
225 | } | 225 | } |
226 | 226 | ||
227 | opp_disable - Make an OPP to be not available for operation | 227 | dev_pm_opp_disable - Make an OPP to be not available for operation |
228 | Example: Lets say that 1GHz OPP is to be disabled if the temperature | 228 | Example: Lets say that 1GHz OPP is to be disabled if the temperature |
229 | exceeds a threshold value. The SoC framework implementation might | 229 | exceeds a threshold value. The SoC framework implementation might |
230 | choose to do something as follows: | 230 | choose to do something as follows: |
231 | if (cur_temp > temp_high_thresh) { | 231 | if (cur_temp > temp_high_thresh) { |
232 | /* Disable 1GHz if it was enabled */ | 232 | /* Disable 1GHz if it was enabled */ |
233 | rcu_read_lock(); | 233 | rcu_read_lock(); |
234 | opp = opp_find_freq_exact(dev, 1000000000, true); | 234 | opp = dev_pm_opp_find_freq_exact(dev, 1000000000, true); |
235 | rcu_read_unlock(); | 235 | rcu_read_unlock(); |
236 | /* just error check */ | 236 | /* just error check */ |
237 | if (!IS_ERR(opp)) | 237 | if (!IS_ERR(opp)) |
238 | ret = opp_disable(dev, 1000000000); | 238 | ret = dev_pm_opp_disable(dev, 1000000000); |
239 | else | 239 | else |
240 | goto try_something_else; | 240 | goto try_something_else; |
241 | } | 241 | } |
@@ -247,7 +247,7 @@ information from the OPP structure is necessary. Once an OPP pointer is | |||
247 | retrieved using the search functions, the following functions can be used by SoC | 247 | retrieved using the search functions, the following functions can be used by SoC |
248 | framework to retrieve the information represented inside the OPP layer. | 248 | framework to retrieve the information represented inside the OPP layer. |
249 | 249 | ||
250 | opp_get_voltage - Retrieve the voltage represented by the opp pointer. | 250 | dev_pm_opp_get_voltage - Retrieve the voltage represented by the opp pointer. |
251 | Example: At a cpufreq transition to a different frequency, SoC | 251 | Example: At a cpufreq transition to a different frequency, SoC |
252 | framework requires to set the voltage represented by the OPP using | 252 | framework requires to set the voltage represented by the OPP using |
253 | the regulator framework to the Power Management chip providing the | 253 | the regulator framework to the Power Management chip providing the |
@@ -256,15 +256,15 @@ opp_get_voltage - Retrieve the voltage represented by the opp pointer. | |||
256 | { | 256 | { |
257 | /* do things */ | 257 | /* do things */ |
258 | rcu_read_lock(); | 258 | rcu_read_lock(); |
259 | opp = opp_find_freq_ceil(dev, &freq); | 259 | opp = dev_pm_opp_find_freq_ceil(dev, &freq); |
260 | v = opp_get_voltage(opp); | 260 | v = dev_pm_opp_get_voltage(opp); |
261 | rcu_read_unlock(); | 261 | rcu_read_unlock(); |
262 | if (v) | 262 | if (v) |
263 | regulator_set_voltage(.., v); | 263 | regulator_set_voltage(.., v); |
264 | /* do other things */ | 264 | /* do other things */ |
265 | } | 265 | } |
266 | 266 | ||
267 | opp_get_freq - Retrieve the freq represented by the opp pointer. | 267 | dev_pm_opp_get_freq - Retrieve the freq represented by the opp pointer. |
268 | Example: Lets say the SoC framework uses a couple of helper functions | 268 | Example: Lets say the SoC framework uses a couple of helper functions |
269 | we could pass opp pointers instead of doing additional parameters to | 269 | we could pass opp pointers instead of doing additional parameters to |
270 | handle quiet a bit of data parameters. | 270 | handle quiet a bit of data parameters. |
@@ -273,8 +273,8 @@ opp_get_freq - Retrieve the freq represented by the opp pointer. | |||
273 | /* do things.. */ | 273 | /* do things.. */ |
274 | max_freq = ULONG_MAX; | 274 | max_freq = ULONG_MAX; |
275 | rcu_read_lock(); | 275 | rcu_read_lock(); |
276 | max_opp = opp_find_freq_floor(dev,&max_freq); | 276 | max_opp = dev_pm_opp_find_freq_floor(dev,&max_freq); |
277 | requested_opp = opp_find_freq_ceil(dev,&freq); | 277 | requested_opp = dev_pm_opp_find_freq_ceil(dev,&freq); |
278 | if (!IS_ERR(max_opp) && !IS_ERR(requested_opp)) | 278 | if (!IS_ERR(max_opp) && !IS_ERR(requested_opp)) |
279 | r = soc_test_validity(max_opp, requested_opp); | 279 | r = soc_test_validity(max_opp, requested_opp); |
280 | rcu_read_unlock(); | 280 | rcu_read_unlock(); |
@@ -282,25 +282,25 @@ opp_get_freq - Retrieve the freq represented by the opp pointer. | |||
282 | } | 282 | } |
283 | soc_test_validity(..) | 283 | soc_test_validity(..) |
284 | { | 284 | { |
285 | if(opp_get_voltage(max_opp) < opp_get_voltage(requested_opp)) | 285 | if(dev_pm_opp_get_voltage(max_opp) < dev_pm_opp_get_voltage(requested_opp)) |
286 | return -EINVAL; | 286 | return -EINVAL; |
287 | if(opp_get_freq(max_opp) < opp_get_freq(requested_opp)) | 287 | if(dev_pm_opp_get_freq(max_opp) < dev_pm_opp_get_freq(requested_opp)) |
288 | return -EINVAL; | 288 | return -EINVAL; |
289 | /* do things.. */ | 289 | /* do things.. */ |
290 | } | 290 | } |
291 | 291 | ||
292 | opp_get_opp_count - Retrieve the number of available opps for a device | 292 | dev_pm_opp_get_opp_count - Retrieve the number of available opps for a device |
293 | Example: Lets say a co-processor in the SoC needs to know the available | 293 | Example: Lets say a co-processor in the SoC needs to know the available |
294 | frequencies in a table, the main processor can notify as following: | 294 | frequencies in a table, the main processor can notify as following: |
295 | soc_notify_coproc_available_frequencies() | 295 | soc_notify_coproc_available_frequencies() |
296 | { | 296 | { |
297 | /* Do things */ | 297 | /* Do things */ |
298 | rcu_read_lock(); | 298 | rcu_read_lock(); |
299 | num_available = opp_get_opp_count(dev); | 299 | num_available = dev_pm_opp_get_opp_count(dev); |
300 | speeds = kzalloc(sizeof(u32) * num_available, GFP_KERNEL); | 300 | speeds = kzalloc(sizeof(u32) * num_available, GFP_KERNEL); |
301 | /* populate the table in increasing order */ | 301 | /* populate the table in increasing order */ |
302 | freq = 0; | 302 | freq = 0; |
303 | while (!IS_ERR(opp = opp_find_freq_ceil(dev, &freq))) { | 303 | while (!IS_ERR(opp = dev_pm_opp_find_freq_ceil(dev, &freq))) { |
304 | speeds[i] = freq; | 304 | speeds[i] = freq; |
305 | freq++; | 305 | freq++; |
306 | i++; | 306 | i++; |
@@ -313,7 +313,7 @@ opp_get_opp_count - Retrieve the number of available opps for a device | |||
313 | 313 | ||
314 | 6. Cpufreq Table Generation | 314 | 6. Cpufreq Table Generation |
315 | =========================== | 315 | =========================== |
316 | opp_init_cpufreq_table - cpufreq framework typically is initialized with | 316 | dev_pm_opp_init_cpufreq_table - cpufreq framework typically is initialized with |
317 | cpufreq_frequency_table_cpuinfo which is provided with the list of | 317 | cpufreq_frequency_table_cpuinfo which is provided with the list of |
318 | frequencies that are available for operation. This function provides | 318 | frequencies that are available for operation. This function provides |
319 | a ready to use conversion routine to translate the OPP layer's internal | 319 | a ready to use conversion routine to translate the OPP layer's internal |
@@ -326,7 +326,7 @@ opp_init_cpufreq_table - cpufreq framework typically is initialized with | |||
326 | soc_pm_init() | 326 | soc_pm_init() |
327 | { | 327 | { |
328 | /* Do things */ | 328 | /* Do things */ |
329 | r = opp_init_cpufreq_table(dev, &freq_table); | 329 | r = dev_pm_opp_init_cpufreq_table(dev, &freq_table); |
330 | if (!r) | 330 | if (!r) |
331 | cpufreq_frequency_table_cpuinfo(policy, freq_table); | 331 | cpufreq_frequency_table_cpuinfo(policy, freq_table); |
332 | /* Do other things */ | 332 | /* Do other things */ |
@@ -336,7 +336,7 @@ opp_init_cpufreq_table - cpufreq framework typically is initialized with | |||
336 | addition to CONFIG_PM as power management feature is required to | 336 | addition to CONFIG_PM as power management feature is required to |
337 | dynamically scale voltage and frequency in a system. | 337 | dynamically scale voltage and frequency in a system. |
338 | 338 | ||
339 | opp_free_cpufreq_table - Free up the table allocated by opp_init_cpufreq_table | 339 | dev_pm_opp_free_cpufreq_table - Free up the table allocated by dev_pm_opp_init_cpufreq_table |
340 | 340 | ||
341 | 7. Data Structures | 341 | 7. Data Structures |
342 | ================== | 342 | ================== |
@@ -358,16 +358,16 @@ accessed by various functions as described above. However, the structures | |||
358 | representing the actual OPPs and domains are internal to the OPP library itself | 358 | representing the actual OPPs and domains are internal to the OPP library itself |
359 | to allow for suitable abstraction reusable across systems. | 359 | to allow for suitable abstraction reusable across systems. |
360 | 360 | ||
361 | struct opp - The internal data structure of OPP library which is used to | 361 | struct dev_pm_opp - The internal data structure of OPP library which is used to |
362 | represent an OPP. In addition to the freq, voltage, availability | 362 | represent an OPP. In addition to the freq, voltage, availability |
363 | information, it also contains internal book keeping information required | 363 | information, it also contains internal book keeping information required |
364 | for the OPP library to operate on. Pointer to this structure is | 364 | for the OPP library to operate on. Pointer to this structure is |
365 | provided back to the users such as SoC framework to be used as a | 365 | provided back to the users such as SoC framework to be used as a |
366 | identifier for OPP in the interactions with OPP layer. | 366 | identifier for OPP in the interactions with OPP layer. |
367 | 367 | ||
368 | WARNING: The struct opp pointer should not be parsed or modified by the | 368 | WARNING: The struct dev_pm_opp pointer should not be parsed or modified by the |
369 | users. The defaults of for an instance is populated by opp_add, but the | 369 | users. The defaults of for an instance is populated by dev_pm_opp_add, but the |
370 | availability of the OPP can be modified by opp_enable/disable functions. | 370 | availability of the OPP can be modified by dev_pm_opp_enable/disable functions. |
371 | 371 | ||
372 | struct device - This is used to identify a domain to the OPP layer. The | 372 | struct device - This is used to identify a domain to the OPP layer. The |
373 | nature of the device and it's implementation is left to the user of | 373 | nature of the device and it's implementation is left to the user of |
@@ -377,19 +377,19 @@ Overall, in a simplistic view, the data structure operations is represented as | |||
377 | following: | 377 | following: |
378 | 378 | ||
379 | Initialization / modification: | 379 | Initialization / modification: |
380 | +-----+ /- opp_enable | 380 | +-----+ /- dev_pm_opp_enable |
381 | opp_add --> | opp | <------- | 381 | dev_pm_opp_add --> | opp | <------- |
382 | | +-----+ \- opp_disable | 382 | | +-----+ \- dev_pm_opp_disable |
383 | \-------> domain_info(device) | 383 | \-------> domain_info(device) |
384 | 384 | ||
385 | Search functions: | 385 | Search functions: |
386 | /-- opp_find_freq_ceil ---\ +-----+ | 386 | /-- dev_pm_opp_find_freq_ceil ---\ +-----+ |
387 | domain_info<---- opp_find_freq_exact -----> | opp | | 387 | domain_info<---- dev_pm_opp_find_freq_exact -----> | opp | |
388 | \-- opp_find_freq_floor ---/ +-----+ | 388 | \-- dev_pm_opp_find_freq_floor ---/ +-----+ |
389 | 389 | ||
390 | Retrieval functions: | 390 | Retrieval functions: |
391 | +-----+ /- opp_get_voltage | 391 | +-----+ /- dev_pm_opp_get_voltage |
392 | | opp | <--- | 392 | | opp | <--- |
393 | +-----+ \- opp_get_freq | 393 | +-----+ \- dev_pm_opp_get_freq |
394 | 394 | ||
395 | domain_info <- opp_get_opp_count | 395 | domain_info <- dev_pm_opp_get_opp_count |