Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/drivers/cpufreq/freq_table.c |
| 3 | * |
| 4 | * Copyright (C) 2002 - 2003 Dominik Brodowski |
Dominik Brodowski | 4f74369 | 2008-05-22 08:52:05 +0200 | [diff] [blame] | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | */ |
| 11 | |
Viresh Kumar | db70115 | 2012-10-23 01:29:03 +0200 | [diff] [blame] | 12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 13 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | #include <linux/cpufreq.h> |
Viresh Kumar | 5ff0a26 | 2013-08-06 22:53:03 +0530 | [diff] [blame] | 15 | #include <linux/module.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | /********************************************************************* |
| 18 | * FREQUENCY TABLE HELPERS * |
| 19 | *********************************************************************/ |
| 20 | |
Viresh Kumar | 44139ed | 2015-07-29 16:23:09 +0530 | [diff] [blame] | 21 | bool policy_has_boost_freq(struct cpufreq_policy *policy) |
| 22 | { |
| 23 | struct cpufreq_frequency_table *pos, *table = policy->freq_table; |
| 24 | |
| 25 | if (!table) |
| 26 | return false; |
| 27 | |
| 28 | cpufreq_for_each_valid_entry(pos, table) |
| 29 | if (pos->flags & CPUFREQ_BOOST_FREQ) |
| 30 | return true; |
| 31 | |
| 32 | return false; |
| 33 | } |
| 34 | EXPORT_SYMBOL_GPL(policy_has_boost_freq); |
| 35 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy, |
| 37 | struct cpufreq_frequency_table *table) |
| 38 | { |
Stratos Karafotis | 041526f | 2014-04-25 23:15:38 +0300 | [diff] [blame] | 39 | struct cpufreq_frequency_table *pos; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | unsigned int min_freq = ~0; |
| 41 | unsigned int max_freq = 0; |
Stratos Karafotis | 041526f | 2014-04-25 23:15:38 +0300 | [diff] [blame] | 42 | unsigned int freq; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | |
Stratos Karafotis | 041526f | 2014-04-25 23:15:38 +0300 | [diff] [blame] | 44 | cpufreq_for_each_valid_entry(pos, table) { |
| 45 | freq = pos->frequency; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | |
Lukasz Majewski | 6f19efc | 2013-12-20 15:24:49 +0100 | [diff] [blame] | 47 | if (!cpufreq_boost_enabled() |
Stratos Karafotis | 041526f | 2014-04-25 23:15:38 +0300 | [diff] [blame] | 48 | && (pos->flags & CPUFREQ_BOOST_FREQ)) |
Lukasz Majewski | 6f19efc | 2013-12-20 15:24:49 +0100 | [diff] [blame] | 49 | continue; |
| 50 | |
Stratos Karafotis | 041526f | 2014-04-25 23:15:38 +0300 | [diff] [blame] | 51 | pr_debug("table entry %u: %u kHz\n", (int)(pos - table), freq); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | if (freq < min_freq) |
| 53 | min_freq = freq; |
| 54 | if (freq > max_freq) |
| 55 | max_freq = freq; |
| 56 | } |
| 57 | |
| 58 | policy->min = policy->cpuinfo.min_freq = min_freq; |
| 59 | policy->max = policy->cpuinfo.max_freq = max_freq; |
| 60 | |
| 61 | if (policy->min == ~0) |
| 62 | return -EINVAL; |
| 63 | else |
| 64 | return 0; |
| 65 | } |
| 66 | EXPORT_SYMBOL_GPL(cpufreq_frequency_table_cpuinfo); |
| 67 | |
| 68 | |
| 69 | int cpufreq_frequency_table_verify(struct cpufreq_policy *policy, |
| 70 | struct cpufreq_frequency_table *table) |
| 71 | { |
Stratos Karafotis | 041526f | 2014-04-25 23:15:38 +0300 | [diff] [blame] | 72 | struct cpufreq_frequency_table *pos; |
| 73 | unsigned int freq, next_larger = ~0; |
Viresh Kumar | 77db50c | 2013-10-02 14:13:15 +0530 | [diff] [blame] | 74 | bool found = false; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | |
Dominik Brodowski | 2d06d8c | 2011-03-27 15:04:46 +0200 | [diff] [blame] | 76 | pr_debug("request for verification of policy (%u - %u kHz) for cpu %u\n", |
Gautham R Shenoy | e08f5f5 | 2006-10-26 16:20:58 +0530 | [diff] [blame] | 77 | policy->min, policy->max, policy->cpu); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | |
Viresh Kumar | be49e34 | 2013-10-02 14:13:19 +0530 | [diff] [blame] | 79 | cpufreq_verify_within_cpu_limits(policy); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | |
Stratos Karafotis | 041526f | 2014-04-25 23:15:38 +0300 | [diff] [blame] | 81 | cpufreq_for_each_valid_entry(pos, table) { |
| 82 | freq = pos->frequency; |
| 83 | |
Viresh Kumar | 77db50c | 2013-10-02 14:13:15 +0530 | [diff] [blame] | 84 | if ((freq >= policy->min) && (freq <= policy->max)) { |
| 85 | found = true; |
| 86 | break; |
| 87 | } |
| 88 | |
| 89 | if ((next_larger > freq) && (freq > policy->max)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | next_larger = freq; |
| 91 | } |
| 92 | |
Viresh Kumar | 77db50c | 2013-10-02 14:13:15 +0530 | [diff] [blame] | 93 | if (!found) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | policy->max = next_larger; |
Viresh Kumar | be49e34 | 2013-10-02 14:13:19 +0530 | [diff] [blame] | 95 | cpufreq_verify_within_cpu_limits(policy); |
Viresh Kumar | 77db50c | 2013-10-02 14:13:15 +0530 | [diff] [blame] | 96 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | |
Dominik Brodowski | 2d06d8c | 2011-03-27 15:04:46 +0200 | [diff] [blame] | 98 | pr_debug("verification lead to (%u - %u kHz) for cpu %u\n", |
Gautham R Shenoy | e08f5f5 | 2006-10-26 16:20:58 +0530 | [diff] [blame] | 99 | policy->min, policy->max, policy->cpu); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | |
| 101 | return 0; |
| 102 | } |
| 103 | EXPORT_SYMBOL_GPL(cpufreq_frequency_table_verify); |
| 104 | |
Viresh Kumar | 1843451 | 2013-10-03 20:27:55 +0530 | [diff] [blame] | 105 | /* |
Viresh Kumar | e0b3165 | 2014-03-10 14:53:33 +0530 | [diff] [blame] | 106 | * Generic routine to verify policy & frequency table, requires driver to set |
| 107 | * policy->freq_table prior to it. |
Viresh Kumar | 1843451 | 2013-10-03 20:27:55 +0530 | [diff] [blame] | 108 | */ |
| 109 | int cpufreq_generic_frequency_table_verify(struct cpufreq_policy *policy) |
| 110 | { |
| 111 | struct cpufreq_frequency_table *table = |
| 112 | cpufreq_frequency_get_table(policy->cpu); |
| 113 | if (!table) |
| 114 | return -ENODEV; |
| 115 | |
| 116 | return cpufreq_frequency_table_verify(policy, table); |
| 117 | } |
| 118 | EXPORT_SYMBOL_GPL(cpufreq_generic_frequency_table_verify); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 119 | |
| 120 | int cpufreq_frequency_table_target(struct cpufreq_policy *policy, |
| 121 | struct cpufreq_frequency_table *table, |
| 122 | unsigned int target_freq, |
| 123 | unsigned int relation, |
| 124 | unsigned int *index) |
| 125 | { |
Dave Jones | 484944a | 2006-05-30 18:09:31 -0400 | [diff] [blame] | 126 | struct cpufreq_frequency_table optimal = { |
Viresh Kumar | 5070158 | 2013-03-30 16:25:15 +0530 | [diff] [blame] | 127 | .driver_data = ~0, |
Dave Jones | 484944a | 2006-05-30 18:09:31 -0400 | [diff] [blame] | 128 | .frequency = 0, |
| 129 | }; |
| 130 | struct cpufreq_frequency_table suboptimal = { |
Viresh Kumar | 5070158 | 2013-03-30 16:25:15 +0530 | [diff] [blame] | 131 | .driver_data = ~0, |
Dave Jones | 484944a | 2006-05-30 18:09:31 -0400 | [diff] [blame] | 132 | .frequency = 0, |
| 133 | }; |
Stratos Karafotis | 041526f | 2014-04-25 23:15:38 +0300 | [diff] [blame] | 134 | struct cpufreq_frequency_table *pos; |
Stratos Karafotis | 5b0c0b1 | 2014-06-30 19:59:33 +0300 | [diff] [blame] | 135 | unsigned int freq, diff, i = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 136 | |
Dominik Brodowski | 2d06d8c | 2011-03-27 15:04:46 +0200 | [diff] [blame] | 137 | pr_debug("request for target %u kHz (relation: %u) for cpu %u\n", |
Gautham R Shenoy | e08f5f5 | 2006-10-26 16:20:58 +0530 | [diff] [blame] | 138 | target_freq, relation, policy->cpu); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 139 | |
| 140 | switch (relation) { |
| 141 | case CPUFREQ_RELATION_H: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 142 | suboptimal.frequency = ~0; |
| 143 | break; |
| 144 | case CPUFREQ_RELATION_L: |
Stratos Karafotis | 5b0c0b1 | 2014-06-30 19:59:33 +0300 | [diff] [blame] | 145 | case CPUFREQ_RELATION_C: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | optimal.frequency = ~0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 147 | break; |
| 148 | } |
| 149 | |
Stratos Karafotis | 041526f | 2014-04-25 23:15:38 +0300 | [diff] [blame] | 150 | cpufreq_for_each_valid_entry(pos, table) { |
| 151 | freq = pos->frequency; |
| 152 | |
| 153 | i = pos - table; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | if ((freq < policy->min) || (freq > policy->max)) |
| 155 | continue; |
Stratos Karafotis | 1e49885 | 2014-05-14 21:05:52 +0300 | [diff] [blame] | 156 | if (freq == target_freq) { |
| 157 | optimal.driver_data = i; |
| 158 | break; |
| 159 | } |
Dave Jones | 97acec5 | 2009-01-18 01:56:41 -0500 | [diff] [blame] | 160 | switch (relation) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 161 | case CPUFREQ_RELATION_H: |
Stratos Karafotis | 1e49885 | 2014-05-14 21:05:52 +0300 | [diff] [blame] | 162 | if (freq < target_freq) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 163 | if (freq >= optimal.frequency) { |
| 164 | optimal.frequency = freq; |
Viresh Kumar | 5070158 | 2013-03-30 16:25:15 +0530 | [diff] [blame] | 165 | optimal.driver_data = i; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | } |
| 167 | } else { |
| 168 | if (freq <= suboptimal.frequency) { |
| 169 | suboptimal.frequency = freq; |
Viresh Kumar | 5070158 | 2013-03-30 16:25:15 +0530 | [diff] [blame] | 170 | suboptimal.driver_data = i; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 171 | } |
| 172 | } |
| 173 | break; |
| 174 | case CPUFREQ_RELATION_L: |
Stratos Karafotis | 1e49885 | 2014-05-14 21:05:52 +0300 | [diff] [blame] | 175 | if (freq > target_freq) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 176 | if (freq <= optimal.frequency) { |
| 177 | optimal.frequency = freq; |
Viresh Kumar | 5070158 | 2013-03-30 16:25:15 +0530 | [diff] [blame] | 178 | optimal.driver_data = i; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 179 | } |
| 180 | } else { |
| 181 | if (freq >= suboptimal.frequency) { |
| 182 | suboptimal.frequency = freq; |
Viresh Kumar | 5070158 | 2013-03-30 16:25:15 +0530 | [diff] [blame] | 183 | suboptimal.driver_data = i; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 184 | } |
| 185 | } |
| 186 | break; |
Stratos Karafotis | 5b0c0b1 | 2014-06-30 19:59:33 +0300 | [diff] [blame] | 187 | case CPUFREQ_RELATION_C: |
| 188 | diff = abs(freq - target_freq); |
| 189 | if (diff < optimal.frequency || |
| 190 | (diff == optimal.frequency && |
| 191 | freq > table[optimal.driver_data].frequency)) { |
| 192 | optimal.frequency = diff; |
| 193 | optimal.driver_data = i; |
| 194 | } |
| 195 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 196 | } |
| 197 | } |
Viresh Kumar | 5070158 | 2013-03-30 16:25:15 +0530 | [diff] [blame] | 198 | if (optimal.driver_data > i) { |
| 199 | if (suboptimal.driver_data > i) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 200 | return -EINVAL; |
Viresh Kumar | 5070158 | 2013-03-30 16:25:15 +0530 | [diff] [blame] | 201 | *index = suboptimal.driver_data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 202 | } else |
Viresh Kumar | 5070158 | 2013-03-30 16:25:15 +0530 | [diff] [blame] | 203 | *index = optimal.driver_data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | |
Viresh Kumar | ae87f10 | 2014-03-28 19:11:45 +0530 | [diff] [blame] | 205 | pr_debug("target index is %u, freq is:%u kHz\n", *index, |
| 206 | table[*index].frequency); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 207 | |
| 208 | return 0; |
| 209 | } |
| 210 | EXPORT_SYMBOL_GPL(cpufreq_frequency_table_target); |
| 211 | |
Viresh Kumar | d391669 | 2013-12-03 11:20:46 +0530 | [diff] [blame] | 212 | int cpufreq_frequency_table_get_index(struct cpufreq_policy *policy, |
| 213 | unsigned int freq) |
| 214 | { |
Stratos Karafotis | 041526f | 2014-04-25 23:15:38 +0300 | [diff] [blame] | 215 | struct cpufreq_frequency_table *pos, *table; |
Viresh Kumar | d391669 | 2013-12-03 11:20:46 +0530 | [diff] [blame] | 216 | |
| 217 | table = cpufreq_frequency_get_table(policy->cpu); |
| 218 | if (unlikely(!table)) { |
| 219 | pr_debug("%s: Unable to find frequency table\n", __func__); |
| 220 | return -ENOENT; |
| 221 | } |
| 222 | |
Stratos Karafotis | 041526f | 2014-04-25 23:15:38 +0300 | [diff] [blame] | 223 | cpufreq_for_each_valid_entry(pos, table) |
| 224 | if (pos->frequency == freq) |
| 225 | return pos - table; |
Viresh Kumar | d391669 | 2013-12-03 11:20:46 +0530 | [diff] [blame] | 226 | |
| 227 | return -EINVAL; |
| 228 | } |
| 229 | EXPORT_SYMBOL_GPL(cpufreq_frequency_table_get_index); |
| 230 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | /** |
Fenghua Yu | e32d22f | 2007-11-21 14:52:15 -0800 | [diff] [blame] | 232 | * show_available_freqs - show available frequencies for the specified CPU |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 233 | */ |
Lukasz Majewski | 6f19efc | 2013-12-20 15:24:49 +0100 | [diff] [blame] | 234 | static ssize_t show_available_freqs(struct cpufreq_policy *policy, char *buf, |
| 235 | bool show_boost) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 237 | ssize_t count = 0; |
Stratos Karafotis | 041526f | 2014-04-25 23:15:38 +0300 | [diff] [blame] | 238 | struct cpufreq_frequency_table *pos, *table = policy->freq_table; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | |
Viresh Kumar | e0b3165 | 2014-03-10 14:53:33 +0530 | [diff] [blame] | 240 | if (!table) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 241 | return -ENODEV; |
| 242 | |
Stratos Karafotis | 041526f | 2014-04-25 23:15:38 +0300 | [diff] [blame] | 243 | cpufreq_for_each_valid_entry(pos, table) { |
Lukasz Majewski | 6f19efc | 2013-12-20 15:24:49 +0100 | [diff] [blame] | 244 | /* |
| 245 | * show_boost = true and driver_data = BOOST freq |
| 246 | * display BOOST freqs |
| 247 | * |
| 248 | * show_boost = false and driver_data = BOOST freq |
| 249 | * show_boost = true and driver_data != BOOST freq |
| 250 | * continue - do not display anything |
| 251 | * |
| 252 | * show_boost = false and driver_data != BOOST freq |
| 253 | * display NON BOOST freqs |
| 254 | */ |
Stratos Karafotis | 041526f | 2014-04-25 23:15:38 +0300 | [diff] [blame] | 255 | if (show_boost ^ (pos->flags & CPUFREQ_BOOST_FREQ)) |
Lukasz Majewski | 6f19efc | 2013-12-20 15:24:49 +0100 | [diff] [blame] | 256 | continue; |
| 257 | |
Stratos Karafotis | 041526f | 2014-04-25 23:15:38 +0300 | [diff] [blame] | 258 | count += sprintf(&buf[count], "%d ", pos->frequency); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 | } |
| 260 | count += sprintf(&buf[count], "\n"); |
| 261 | |
| 262 | return count; |
| 263 | |
| 264 | } |
| 265 | |
Lukasz Majewski | 6f19efc | 2013-12-20 15:24:49 +0100 | [diff] [blame] | 266 | #define cpufreq_attr_available_freq(_name) \ |
| 267 | struct freq_attr cpufreq_freq_attr_##_name##_freqs = \ |
| 268 | __ATTR_RO(_name##_frequencies) |
| 269 | |
| 270 | /** |
| 271 | * show_scaling_available_frequencies - show available normal frequencies for |
| 272 | * the specified CPU |
| 273 | */ |
| 274 | static ssize_t scaling_available_frequencies_show(struct cpufreq_policy *policy, |
| 275 | char *buf) |
| 276 | { |
| 277 | return show_available_freqs(policy, buf, false); |
| 278 | } |
| 279 | cpufreq_attr_available_freq(scaling_available); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 280 | EXPORT_SYMBOL_GPL(cpufreq_freq_attr_scaling_available_freqs); |
| 281 | |
Lukasz Majewski | 6f19efc | 2013-12-20 15:24:49 +0100 | [diff] [blame] | 282 | /** |
| 283 | * show_available_boost_freqs - show available boost frequencies for |
| 284 | * the specified CPU |
| 285 | */ |
| 286 | static ssize_t scaling_boost_frequencies_show(struct cpufreq_policy *policy, |
| 287 | char *buf) |
| 288 | { |
| 289 | return show_available_freqs(policy, buf, true); |
| 290 | } |
| 291 | cpufreq_attr_available_freq(scaling_boost); |
| 292 | EXPORT_SYMBOL_GPL(cpufreq_freq_attr_scaling_boost_freqs); |
| 293 | |
Viresh Kumar | 1843451 | 2013-10-03 20:27:55 +0530 | [diff] [blame] | 294 | struct freq_attr *cpufreq_generic_attr[] = { |
| 295 | &cpufreq_freq_attr_scaling_available_freqs, |
Lukasz Majewski | 6f19efc | 2013-12-20 15:24:49 +0100 | [diff] [blame] | 296 | #ifdef CONFIG_CPU_FREQ_BOOST_SW |
| 297 | &cpufreq_freq_attr_scaling_boost_freqs, |
| 298 | #endif |
Viresh Kumar | 1843451 | 2013-10-03 20:27:55 +0530 | [diff] [blame] | 299 | NULL, |
| 300 | }; |
| 301 | EXPORT_SYMBOL_GPL(cpufreq_generic_attr); |
| 302 | |
Viresh Kumar | 27047a6 | 2013-09-16 18:56:03 +0530 | [diff] [blame] | 303 | int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, |
| 304 | struct cpufreq_frequency_table *table) |
| 305 | { |
| 306 | int ret = cpufreq_frequency_table_cpuinfo(policy, table); |
| 307 | |
| 308 | if (!ret) |
Viresh Kumar | e0b3165 | 2014-03-10 14:53:33 +0530 | [diff] [blame] | 309 | policy->freq_table = table; |
Viresh Kumar | 27047a6 | 2013-09-16 18:56:03 +0530 | [diff] [blame] | 310 | |
| 311 | return ret; |
| 312 | } |
| 313 | EXPORT_SYMBOL_GPL(cpufreq_table_validate_and_show); |
| 314 | |
Dave Jones | 97acec5 | 2009-01-18 01:56:41 -0500 | [diff] [blame] | 315 | MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>"); |
| 316 | MODULE_DESCRIPTION("CPUfreq frequency table helpers"); |
| 317 | MODULE_LICENSE("GPL"); |