diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/ABI/testing/sysfs-devices-system-cpu | 4 | ||||
-rw-r--r-- | Documentation/cpu-freq/core.txt | 29 | ||||
-rw-r--r-- | Documentation/cpu-freq/cpu-drivers.txt | 19 | ||||
-rw-r--r-- | Documentation/cpu-freq/index.txt | 4 | ||||
-rw-r--r-- | Documentation/power/opp.txt | 40 |
5 files changed, 57 insertions, 39 deletions
diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu index d5a0d33c571f..acb9bfc89b48 100644 --- a/Documentation/ABI/testing/sysfs-devices-system-cpu +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu | |||
@@ -128,7 +128,7 @@ Description: Discover cpuidle policy and mechanism | |||
128 | 128 | ||
129 | What: /sys/devices/system/cpu/cpu#/cpufreq/* | 129 | What: /sys/devices/system/cpu/cpu#/cpufreq/* |
130 | Date: pre-git history | 130 | Date: pre-git history |
131 | Contact: cpufreq@vger.kernel.org | 131 | Contact: linux-pm@vger.kernel.org |
132 | Description: Discover and change clock speed of CPUs | 132 | Description: Discover and change clock speed of CPUs |
133 | 133 | ||
134 | Clock scaling allows you to change the clock speed of the | 134 | Clock scaling allows you to change the clock speed of the |
@@ -146,7 +146,7 @@ Description: Discover and change clock speed of CPUs | |||
146 | 146 | ||
147 | What: /sys/devices/system/cpu/cpu#/cpufreq/freqdomain_cpus | 147 | What: /sys/devices/system/cpu/cpu#/cpufreq/freqdomain_cpus |
148 | Date: June 2013 | 148 | Date: June 2013 |
149 | Contact: cpufreq@vger.kernel.org | 149 | Contact: linux-pm@vger.kernel.org |
150 | Description: Discover CPUs in the same CPU frequency coordination domain | 150 | Description: Discover CPUs in the same CPU frequency coordination domain |
151 | 151 | ||
152 | freqdomain_cpus is the list of CPUs (online+offline) that share | 152 | freqdomain_cpus is the list of CPUs (online+offline) that share |
diff --git a/Documentation/cpu-freq/core.txt b/Documentation/cpu-freq/core.txt index 0060d76b445f..70933eadc308 100644 --- a/Documentation/cpu-freq/core.txt +++ b/Documentation/cpu-freq/core.txt | |||
@@ -20,6 +20,7 @@ Contents: | |||
20 | --------- | 20 | --------- |
21 | 1. CPUFreq core and interfaces | 21 | 1. CPUFreq core and interfaces |
22 | 2. CPUFreq notifiers | 22 | 2. CPUFreq notifiers |
23 | 3. CPUFreq Table Generation with Operating Performance Point (OPP) | ||
23 | 24 | ||
24 | 1. General Information | 25 | 1. General Information |
25 | ======================= | 26 | ======================= |
@@ -92,3 +93,31 @@ values: | |||
92 | cpu - number of the affected CPU | 93 | cpu - number of the affected CPU |
93 | old - old frequency | 94 | old - old frequency |
94 | new - new frequency | 95 | new - new frequency |
96 | |||
97 | 3. CPUFreq Table Generation with Operating Performance Point (OPP) | ||
98 | ================================================================== | ||
99 | For details about OPP, see Documentation/power/opp.txt | ||
100 | |||
101 | dev_pm_opp_init_cpufreq_table - cpufreq framework typically is initialized with | ||
102 | cpufreq_frequency_table_cpuinfo which is provided with the list of | ||
103 | frequencies that are available for operation. This function provides | ||
104 | a ready to use conversion routine to translate the OPP layer's internal | ||
105 | information about the available frequencies into a format readily | ||
106 | providable to cpufreq. | ||
107 | |||
108 | WARNING: Do not use this function in interrupt context. | ||
109 | |||
110 | Example: | ||
111 | soc_pm_init() | ||
112 | { | ||
113 | /* Do things */ | ||
114 | r = dev_pm_opp_init_cpufreq_table(dev, &freq_table); | ||
115 | if (!r) | ||
116 | cpufreq_frequency_table_cpuinfo(policy, freq_table); | ||
117 | /* Do other things */ | ||
118 | } | ||
119 | |||
120 | NOTE: This function is available only if CONFIG_CPU_FREQ is enabled in | ||
121 | addition to CONFIG_PM_OPP. | ||
122 | |||
123 | dev_pm_opp_free_cpufreq_table - Free up the table allocated by dev_pm_opp_init_cpufreq_table | ||
diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt index 48da5fdcb9f1..b045fe54986a 100644 --- a/Documentation/cpu-freq/cpu-drivers.txt +++ b/Documentation/cpu-freq/cpu-drivers.txt | |||
@@ -228,3 +228,22 @@ is the corresponding frequency table helper for the ->target | |||
228 | stage. Just pass the values to this function, and the unsigned int | 228 | stage. Just pass the values to this function, and the unsigned int |
229 | index returns the number of the frequency table entry which contains | 229 | index returns the number of the frequency table entry which contains |
230 | the frequency the CPU shall be set to. | 230 | the frequency the CPU shall be set to. |
231 | |||
232 | The following macros can be used as iterators over cpufreq_frequency_table: | ||
233 | |||
234 | cpufreq_for_each_entry(pos, table) - iterates over all entries of frequency | ||
235 | table. | ||
236 | |||
237 | cpufreq-for_each_valid_entry(pos, table) - iterates over all entries, | ||
238 | excluding CPUFREQ_ENTRY_INVALID frequencies. | ||
239 | Use arguments "pos" - a cpufreq_frequency_table * as a loop cursor and | ||
240 | "table" - the cpufreq_frequency_table * you want to iterate over. | ||
241 | |||
242 | For example: | ||
243 | |||
244 | struct cpufreq_frequency_table *pos, *driver_freq_table; | ||
245 | |||
246 | cpufreq_for_each_entry(pos, driver_freq_table) { | ||
247 | /* Do something with pos */ | ||
248 | pos->frequency = ... | ||
249 | } | ||
diff --git a/Documentation/cpu-freq/index.txt b/Documentation/cpu-freq/index.txt index 3d0b915035b9..dc024ab4054f 100644 --- a/Documentation/cpu-freq/index.txt +++ b/Documentation/cpu-freq/index.txt | |||
@@ -35,8 +35,8 @@ Mailing List | |||
35 | ------------ | 35 | ------------ |
36 | There is a CPU frequency changing CVS commit and general list where | 36 | There is a CPU frequency changing CVS commit and general list where |
37 | you can report bugs, problems or submit patches. To post a message, | 37 | you can report bugs, problems or submit patches. To post a message, |
38 | send an email to cpufreq@vger.kernel.org, to subscribe go to | 38 | send an email to linux-pm@vger.kernel.org, to subscribe go to |
39 | http://vger.kernel.org/vger-lists.html#cpufreq and follow the | 39 | http://vger.kernel.org/vger-lists.html#linux-pm and follow the |
40 | instructions there. | 40 | instructions there. |
41 | 41 | ||
42 | Links | 42 | Links |
diff --git a/Documentation/power/opp.txt b/Documentation/power/opp.txt index b8a907dc0169..a9adad828cdc 100644 --- a/Documentation/power/opp.txt +++ b/Documentation/power/opp.txt | |||
@@ -10,8 +10,7 @@ Contents | |||
10 | 3. OPP Search Functions | 10 | 3. OPP Search Functions |
11 | 4. OPP Availability Control Functions | 11 | 4. OPP Availability Control Functions |
12 | 5. OPP Data Retrieval Functions | 12 | 5. OPP Data Retrieval Functions |
13 | 6. Cpufreq Table Generation | 13 | 6. Data Structures |
14 | 7. Data Structures | ||
15 | 14 | ||
16 | 1. Introduction | 15 | 1. Introduction |
17 | =============== | 16 | =============== |
@@ -72,7 +71,6 @@ operations until that OPP could be re-enabled if possible. | |||
72 | OPP library facilitates this concept in it's implementation. The following | 71 | OPP library facilitates this concept in it's implementation. The following |
73 | operational functions operate only on available opps: | 72 | operational functions operate only on available opps: |
74 | opp_find_freq_{ceil, floor}, dev_pm_opp_get_voltage, dev_pm_opp_get_freq, dev_pm_opp_get_opp_count | 73 | opp_find_freq_{ceil, floor}, dev_pm_opp_get_voltage, dev_pm_opp_get_freq, dev_pm_opp_get_opp_count |
75 | and dev_pm_opp_init_cpufreq_table | ||
76 | 74 | ||
77 | dev_pm_opp_find_freq_exact is meant to be used to find the opp pointer which can then | 75 | dev_pm_opp_find_freq_exact is meant to be used to find the opp pointer which can then |
78 | be used for dev_pm_opp_enable/disable functions to make an opp available as required. | 76 | be used for dev_pm_opp_enable/disable functions to make an opp available as required. |
@@ -96,10 +94,9 @@ using RCU read locks. The opp_find_freq_{exact,ceil,floor}, | |||
96 | opp_get_{voltage, freq, opp_count} fall into this category. | 94 | opp_get_{voltage, freq, opp_count} fall into this category. |
97 | 95 | ||
98 | opp_{add,enable,disable} are updaters which use mutex and implement it's own | 96 | opp_{add,enable,disable} are updaters which use mutex and implement it's own |
99 | RCU locking mechanisms. dev_pm_opp_init_cpufreq_table acts as an updater and uses | 97 | RCU locking mechanisms. These functions should *NOT* be called under RCU locks |
100 | mutex to implment RCU updater strategy. These functions should *NOT* be called | 98 | and other contexts that prevent blocking functions in RCU or mutex operations |
101 | under RCU locks and other contexts that prevent blocking functions in RCU or | 99 | from working. |
102 | mutex operations from working. | ||
103 | 100 | ||
104 | 2. Initial OPP List Registration | 101 | 2. Initial OPP List Registration |
105 | ================================ | 102 | ================================ |
@@ -311,34 +308,7 @@ dev_pm_opp_get_opp_count - Retrieve the number of available opps for a device | |||
311 | /* Do other things */ | 308 | /* Do other things */ |
312 | } | 309 | } |
313 | 310 | ||
314 | 6. Cpufreq Table Generation | 311 | 6. Data Structures |
315 | =========================== | ||
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 | ||
318 | frequencies that are available for operation. This function provides | ||
319 | a ready to use conversion routine to translate the OPP layer's internal | ||
320 | information about the available frequencies into a format readily | ||
321 | providable to cpufreq. | ||
322 | |||
323 | WARNING: Do not use this function in interrupt context. | ||
324 | |||
325 | Example: | ||
326 | soc_pm_init() | ||
327 | { | ||
328 | /* Do things */ | ||
329 | r = dev_pm_opp_init_cpufreq_table(dev, &freq_table); | ||
330 | if (!r) | ||
331 | cpufreq_frequency_table_cpuinfo(policy, freq_table); | ||
332 | /* Do other things */ | ||
333 | } | ||
334 | |||
335 | NOTE: This function is available only if CONFIG_CPU_FREQ is enabled in | ||
336 | addition to CONFIG_PM as power management feature is required to | ||
337 | dynamically scale voltage and frequency in a system. | ||
338 | |||
339 | dev_pm_opp_free_cpufreq_table - Free up the table allocated by dev_pm_opp_init_cpufreq_table | ||
340 | |||
341 | 7. Data Structures | ||
342 | ================== | 312 | ================== |
343 | Typically an SoC contains multiple voltage domains which are variable. Each | 313 | Typically an SoC contains multiple voltage domains which are variable. Each |
344 | domain is represented by a device pointer. The relationship to OPP can be | 314 | domain is represented by a device pointer. The relationship to OPP can be |