aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/devfreq
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-27 20:29:34 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-27 20:29:34 -0400
commit93658cb8597ab76655220be43d3d7f74c66e9e4e (patch)
treee6da56aac9cda2c80315cc73ee31ef4c47af8472 /drivers/devfreq
parent6e0ca95aa3c83c47d13f9f400bfaaa853d0b224b (diff)
parentad7722dab7292dbc1c4586d701ac226b68122d39 (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 'drivers/devfreq')
-rw-r--r--drivers/devfreq/devfreq.c25
-rw-r--r--drivers/devfreq/exynos/exynos4_bus.c29
-rw-r--r--drivers/devfreq/exynos/exynos5_bus.c26
3 files changed, 41 insertions, 39 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index c99c00d35d34..2e23b12c350b 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -18,7 +18,7 @@
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/stat.h> 20#include <linux/stat.h>
21#include <linux/opp.h> 21#include <linux/pm_opp.h>
22#include <linux/devfreq.h> 22#include <linux/devfreq.h>
23#include <linux/workqueue.h> 23#include <linux/workqueue.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
@@ -902,13 +902,13 @@ static ssize_t available_frequencies_show(struct device *d,
902{ 902{
903 struct devfreq *df = to_devfreq(d); 903 struct devfreq *df = to_devfreq(d);
904 struct device *dev = df->dev.parent; 904 struct device *dev = df->dev.parent;
905 struct opp *opp; 905 struct dev_pm_opp *opp;
906 ssize_t count = 0; 906 ssize_t count = 0;
907 unsigned long freq = 0; 907 unsigned long freq = 0;
908 908
909 rcu_read_lock(); 909 rcu_read_lock();
910 do { 910 do {
911 opp = opp_find_freq_ceil(dev, &freq); 911 opp = dev_pm_opp_find_freq_ceil(dev, &freq);
912 if (IS_ERR(opp)) 912 if (IS_ERR(opp))
913 break; 913 break;
914 914
@@ -1029,25 +1029,26 @@ module_exit(devfreq_exit);
1029 * under the locked area. The pointer returned must be used prior to unlocking 1029 * under the locked area. The pointer returned must be used prior to unlocking
1030 * with rcu_read_unlock() to maintain the integrity of the pointer. 1030 * with rcu_read_unlock() to maintain the integrity of the pointer.
1031 */ 1031 */
1032struct opp *devfreq_recommended_opp(struct device *dev, unsigned long *freq, 1032struct dev_pm_opp *devfreq_recommended_opp(struct device *dev,
1033 u32 flags) 1033 unsigned long *freq,
1034 u32 flags)
1034{ 1035{
1035 struct opp *opp; 1036 struct dev_pm_opp *opp;
1036 1037
1037 if (flags & DEVFREQ_FLAG_LEAST_UPPER_BOUND) { 1038 if (flags & DEVFREQ_FLAG_LEAST_UPPER_BOUND) {
1038 /* The freq is an upper bound. opp should be lower */ 1039 /* The freq is an upper bound. opp should be lower */
1039 opp = opp_find_freq_floor(dev, freq); 1040 opp = dev_pm_opp_find_freq_floor(dev, freq);
1040 1041
1041 /* If not available, use the closest opp */ 1042 /* If not available, use the closest opp */
1042 if (opp == ERR_PTR(-ERANGE)) 1043 if (opp == ERR_PTR(-ERANGE))
1043 opp = opp_find_freq_ceil(dev, freq); 1044 opp = dev_pm_opp_find_freq_ceil(dev, freq);
1044 } else { 1045 } else {
1045 /* The freq is an lower bound. opp should be higher */ 1046 /* The freq is an lower bound. opp should be higher */
1046 opp = opp_find_freq_ceil(dev, freq); 1047 opp = dev_pm_opp_find_freq_ceil(dev, freq);
1047 1048
1048 /* If not available, use the closest opp */ 1049 /* If not available, use the closest opp */
1049 if (opp == ERR_PTR(-ERANGE)) 1050 if (opp == ERR_PTR(-ERANGE))
1050 opp = opp_find_freq_floor(dev, freq); 1051 opp = dev_pm_opp_find_freq_floor(dev, freq);
1051 } 1052 }
1052 1053
1053 return opp; 1054 return opp;
@@ -1066,7 +1067,7 @@ int devfreq_register_opp_notifier(struct device *dev, struct devfreq *devfreq)
1066 int ret = 0; 1067 int ret = 0;
1067 1068
1068 rcu_read_lock(); 1069 rcu_read_lock();
1069 nh = opp_get_notifier(dev); 1070 nh = dev_pm_opp_get_notifier(dev);
1070 if (IS_ERR(nh)) 1071 if (IS_ERR(nh))
1071 ret = PTR_ERR(nh); 1072 ret = PTR_ERR(nh);
1072 rcu_read_unlock(); 1073 rcu_read_unlock();
@@ -1092,7 +1093,7 @@ int devfreq_unregister_opp_notifier(struct device *dev, struct devfreq *devfreq)
1092 int ret = 0; 1093 int ret = 0;
1093 1094
1094 rcu_read_lock(); 1095 rcu_read_lock();
1095 nh = opp_get_notifier(dev); 1096 nh = dev_pm_opp_get_notifier(dev);
1096 if (IS_ERR(nh)) 1097 if (IS_ERR(nh))
1097 ret = PTR_ERR(nh); 1098 ret = PTR_ERR(nh);
1098 rcu_read_unlock(); 1099 rcu_read_unlock();
diff --git a/drivers/devfreq/exynos/exynos4_bus.c b/drivers/devfreq/exynos/exynos4_bus.c
index c5f86d8caca3..cede6f71cd63 100644
--- a/drivers/devfreq/exynos/exynos4_bus.c
+++ b/drivers/devfreq/exynos/exynos4_bus.c
@@ -19,7 +19,7 @@
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/mutex.h> 20#include <linux/mutex.h>
21#include <linux/suspend.h> 21#include <linux/suspend.h>
22#include <linux/opp.h> 22#include <linux/pm_opp.h>
23#include <linux/devfreq.h> 23#include <linux/devfreq.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/regulator/consumer.h> 25#include <linux/regulator/consumer.h>
@@ -639,7 +639,7 @@ static int exynos4_bus_target(struct device *dev, unsigned long *_freq,
639 struct platform_device *pdev = container_of(dev, struct platform_device, 639 struct platform_device *pdev = container_of(dev, struct platform_device,
640 dev); 640 dev);
641 struct busfreq_data *data = platform_get_drvdata(pdev); 641 struct busfreq_data *data = platform_get_drvdata(pdev);
642 struct opp *opp; 642 struct dev_pm_opp *opp;
643 unsigned long freq; 643 unsigned long freq;
644 unsigned long old_freq = data->curr_oppinfo.rate; 644 unsigned long old_freq = data->curr_oppinfo.rate;
645 struct busfreq_opp_info new_oppinfo; 645 struct busfreq_opp_info new_oppinfo;
@@ -650,8 +650,8 @@ static int exynos4_bus_target(struct device *dev, unsigned long *_freq,
650 rcu_read_unlock(); 650 rcu_read_unlock();
651 return PTR_ERR(opp); 651 return PTR_ERR(opp);
652 } 652 }
653 new_oppinfo.rate = opp_get_freq(opp); 653 new_oppinfo.rate = dev_pm_opp_get_freq(opp);
654 new_oppinfo.volt = opp_get_voltage(opp); 654 new_oppinfo.volt = dev_pm_opp_get_voltage(opp);
655 rcu_read_unlock(); 655 rcu_read_unlock();
656 freq = new_oppinfo.rate; 656 freq = new_oppinfo.rate;
657 657
@@ -873,7 +873,7 @@ static int exynos4210_init_tables(struct busfreq_data *data)
873 exynos4210_busclk_table[i].volt = exynos4210_asv_volt[mgrp][i]; 873 exynos4210_busclk_table[i].volt = exynos4210_asv_volt[mgrp][i];
874 874
875 for (i = LV_0; i < EX4210_LV_NUM; i++) { 875 for (i = LV_0; i < EX4210_LV_NUM; i++) {
876 err = opp_add(data->dev, exynos4210_busclk_table[i].clk, 876 err = dev_pm_opp_add(data->dev, exynos4210_busclk_table[i].clk,
877 exynos4210_busclk_table[i].volt); 877 exynos4210_busclk_table[i].volt);
878 if (err) { 878 if (err) {
879 dev_err(data->dev, "Cannot add opp entries.\n"); 879 dev_err(data->dev, "Cannot add opp entries.\n");
@@ -940,7 +940,7 @@ static int exynos4x12_init_tables(struct busfreq_data *data)
940 } 940 }
941 941
942 for (i = 0; i < EX4x12_LV_NUM; i++) { 942 for (i = 0; i < EX4x12_LV_NUM; i++) {
943 ret = opp_add(data->dev, exynos4x12_mifclk_table[i].clk, 943 ret = dev_pm_opp_add(data->dev, exynos4x12_mifclk_table[i].clk,
944 exynos4x12_mifclk_table[i].volt); 944 exynos4x12_mifclk_table[i].volt);
945 if (ret) { 945 if (ret) {
946 dev_err(data->dev, "Fail to add opp entries.\n"); 946 dev_err(data->dev, "Fail to add opp entries.\n");
@@ -956,7 +956,7 @@ static int exynos4_busfreq_pm_notifier_event(struct notifier_block *this,
956{ 956{
957 struct busfreq_data *data = container_of(this, struct busfreq_data, 957 struct busfreq_data *data = container_of(this, struct busfreq_data,
958 pm_notifier); 958 pm_notifier);
959 struct opp *opp; 959 struct dev_pm_opp *opp;
960 struct busfreq_opp_info new_oppinfo; 960 struct busfreq_opp_info new_oppinfo;
961 unsigned long maxfreq = ULONG_MAX; 961 unsigned long maxfreq = ULONG_MAX;
962 int err = 0; 962 int err = 0;
@@ -969,7 +969,7 @@ static int exynos4_busfreq_pm_notifier_event(struct notifier_block *this,
969 data->disabled = true; 969 data->disabled = true;
970 970
971 rcu_read_lock(); 971 rcu_read_lock();
972 opp = opp_find_freq_floor(data->dev, &maxfreq); 972 opp = dev_pm_opp_find_freq_floor(data->dev, &maxfreq);
973 if (IS_ERR(opp)) { 973 if (IS_ERR(opp)) {
974 rcu_read_unlock(); 974 rcu_read_unlock();
975 dev_err(data->dev, "%s: unable to find a min freq\n", 975 dev_err(data->dev, "%s: unable to find a min freq\n",
@@ -977,8 +977,8 @@ static int exynos4_busfreq_pm_notifier_event(struct notifier_block *this,
977 mutex_unlock(&data->lock); 977 mutex_unlock(&data->lock);
978 return PTR_ERR(opp); 978 return PTR_ERR(opp);
979 } 979 }
980 new_oppinfo.rate = opp_get_freq(opp); 980 new_oppinfo.rate = dev_pm_opp_get_freq(opp);
981 new_oppinfo.volt = opp_get_voltage(opp); 981 new_oppinfo.volt = dev_pm_opp_get_voltage(opp);
982 rcu_read_unlock(); 982 rcu_read_unlock();
983 983
984 err = exynos4_bus_setvolt(data, &new_oppinfo, 984 err = exynos4_bus_setvolt(data, &new_oppinfo,
@@ -1020,7 +1020,7 @@ unlock:
1020static int exynos4_busfreq_probe(struct platform_device *pdev) 1020static int exynos4_busfreq_probe(struct platform_device *pdev)
1021{ 1021{
1022 struct busfreq_data *data; 1022 struct busfreq_data *data;
1023 struct opp *opp; 1023 struct dev_pm_opp *opp;
1024 struct device *dev = &pdev->dev; 1024 struct device *dev = &pdev->dev;
1025 int err = 0; 1025 int err = 0;
1026 1026
@@ -1065,15 +1065,16 @@ static int exynos4_busfreq_probe(struct platform_device *pdev)
1065 } 1065 }
1066 1066
1067 rcu_read_lock(); 1067 rcu_read_lock();
1068 opp = opp_find_freq_floor(dev, &exynos4_devfreq_profile.initial_freq); 1068 opp = dev_pm_opp_find_freq_floor(dev,
1069 &exynos4_devfreq_profile.initial_freq);
1069 if (IS_ERR(opp)) { 1070 if (IS_ERR(opp)) {
1070 rcu_read_unlock(); 1071 rcu_read_unlock();
1071 dev_err(dev, "Invalid initial frequency %lu kHz.\n", 1072 dev_err(dev, "Invalid initial frequency %lu kHz.\n",
1072 exynos4_devfreq_profile.initial_freq); 1073 exynos4_devfreq_profile.initial_freq);
1073 return PTR_ERR(opp); 1074 return PTR_ERR(opp);
1074 } 1075 }
1075 data->curr_oppinfo.rate = opp_get_freq(opp); 1076 data->curr_oppinfo.rate = dev_pm_opp_get_freq(opp);
1076 data->curr_oppinfo.volt = opp_get_voltage(opp); 1077 data->curr_oppinfo.volt = dev_pm_opp_get_voltage(opp);
1077 rcu_read_unlock(); 1078 rcu_read_unlock();
1078 1079
1079 platform_set_drvdata(pdev, data); 1080 platform_set_drvdata(pdev, data);
diff --git a/drivers/devfreq/exynos/exynos5_bus.c b/drivers/devfreq/exynos/exynos5_bus.c
index 93c29f4085bd..0e0bfc17cd5b 100644
--- a/drivers/devfreq/exynos/exynos5_bus.c
+++ b/drivers/devfreq/exynos/exynos5_bus.c
@@ -15,7 +15,7 @@
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/devfreq.h> 16#include <linux/devfreq.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/opp.h> 18#include <linux/pm_opp.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/suspend.h> 20#include <linux/suspend.h>
21#include <linux/clk.h> 21#include <linux/clk.h>
@@ -131,7 +131,7 @@ static int exynos5_busfreq_int_target(struct device *dev, unsigned long *_freq,
131 struct platform_device *pdev = container_of(dev, struct platform_device, 131 struct platform_device *pdev = container_of(dev, struct platform_device,
132 dev); 132 dev);
133 struct busfreq_data_int *data = platform_get_drvdata(pdev); 133 struct busfreq_data_int *data = platform_get_drvdata(pdev);
134 struct opp *opp; 134 struct dev_pm_opp *opp;
135 unsigned long old_freq, freq; 135 unsigned long old_freq, freq;
136 unsigned long volt; 136 unsigned long volt;
137 137
@@ -143,8 +143,8 @@ static int exynos5_busfreq_int_target(struct device *dev, unsigned long *_freq,
143 return PTR_ERR(opp); 143 return PTR_ERR(opp);
144 } 144 }
145 145
146 freq = opp_get_freq(opp); 146 freq = dev_pm_opp_get_freq(opp);
147 volt = opp_get_voltage(opp); 147 volt = dev_pm_opp_get_voltage(opp);
148 rcu_read_unlock(); 148 rcu_read_unlock();
149 149
150 old_freq = data->curr_freq; 150 old_freq = data->curr_freq;
@@ -245,7 +245,7 @@ static int exynos5250_init_int_tables(struct busfreq_data_int *data)
245 int i, err = 0; 245 int i, err = 0;
246 246
247 for (i = LV_0; i < _LV_END; i++) { 247 for (i = LV_0; i < _LV_END; i++) {
248 err = opp_add(data->dev, exynos5_int_opp_table[i].clk, 248 err = dev_pm_opp_add(data->dev, exynos5_int_opp_table[i].clk,
249 exynos5_int_opp_table[i].volt); 249 exynos5_int_opp_table[i].volt);
250 if (err) { 250 if (err) {
251 dev_err(data->dev, "Cannot add opp entries.\n"); 251 dev_err(data->dev, "Cannot add opp entries.\n");
@@ -261,7 +261,7 @@ static int exynos5_busfreq_int_pm_notifier_event(struct notifier_block *this,
261{ 261{
262 struct busfreq_data_int *data = container_of(this, 262 struct busfreq_data_int *data = container_of(this,
263 struct busfreq_data_int, pm_notifier); 263 struct busfreq_data_int, pm_notifier);
264 struct opp *opp; 264 struct dev_pm_opp *opp;
265 unsigned long maxfreq = ULONG_MAX; 265 unsigned long maxfreq = ULONG_MAX;
266 unsigned long freq; 266 unsigned long freq;
267 unsigned long volt; 267 unsigned long volt;
@@ -275,14 +275,14 @@ static int exynos5_busfreq_int_pm_notifier_event(struct notifier_block *this,
275 data->disabled = true; 275 data->disabled = true;
276 276
277 rcu_read_lock(); 277 rcu_read_lock();
278 opp = opp_find_freq_floor(data->dev, &maxfreq); 278 opp = dev_pm_opp_find_freq_floor(data->dev, &maxfreq);
279 if (IS_ERR(opp)) { 279 if (IS_ERR(opp)) {
280 rcu_read_unlock(); 280 rcu_read_unlock();
281 err = PTR_ERR(opp); 281 err = PTR_ERR(opp);
282 goto unlock; 282 goto unlock;
283 } 283 }
284 freq = opp_get_freq(opp); 284 freq = dev_pm_opp_get_freq(opp);
285 volt = opp_get_voltage(opp); 285 volt = dev_pm_opp_get_voltage(opp);
286 rcu_read_unlock(); 286 rcu_read_unlock();
287 287
288 err = exynos5_int_setvolt(data, volt); 288 err = exynos5_int_setvolt(data, volt);
@@ -315,7 +315,7 @@ unlock:
315static int exynos5_busfreq_int_probe(struct platform_device *pdev) 315static int exynos5_busfreq_int_probe(struct platform_device *pdev)
316{ 316{
317 struct busfreq_data_int *data; 317 struct busfreq_data_int *data;
318 struct opp *opp; 318 struct dev_pm_opp *opp;
319 struct device *dev = &pdev->dev; 319 struct device *dev = &pdev->dev;
320 struct device_node *np; 320 struct device_node *np;
321 unsigned long initial_freq; 321 unsigned long initial_freq;
@@ -367,7 +367,7 @@ static int exynos5_busfreq_int_probe(struct platform_device *pdev)
367 } 367 }
368 368
369 rcu_read_lock(); 369 rcu_read_lock();
370 opp = opp_find_freq_floor(dev, 370 opp = dev_pm_opp_find_freq_floor(dev,
371 &exynos5_devfreq_int_profile.initial_freq); 371 &exynos5_devfreq_int_profile.initial_freq);
372 if (IS_ERR(opp)) { 372 if (IS_ERR(opp)) {
373 rcu_read_unlock(); 373 rcu_read_unlock();
@@ -376,8 +376,8 @@ static int exynos5_busfreq_int_probe(struct platform_device *pdev)
376 err = PTR_ERR(opp); 376 err = PTR_ERR(opp);
377 goto err_opp_add; 377 goto err_opp_add;
378 } 378 }
379 initial_freq = opp_get_freq(opp); 379 initial_freq = dev_pm_opp_get_freq(opp);
380 initial_volt = opp_get_voltage(opp); 380 initial_volt = dev_pm_opp_get_voltage(opp);
381 rcu_read_unlock(); 381 rcu_read_unlock();
382 data->curr_freq = initial_freq; 382 data->curr_freq = initial_freq;
383 383