diff options
| -rw-r--r-- | Documentation/power/opp.txt | 4 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/pm.c | 2 | ||||
| -rw-r--r-- | drivers/base/power/opp.c | 41 | ||||
| -rw-r--r-- | drivers/cpufreq/cpufreq-cpu0.c | 4 | ||||
| -rw-r--r-- | drivers/cpufreq/exynos5440-cpufreq.c | 2 | ||||
| -rw-r--r-- | drivers/cpufreq/imx6q-cpufreq.c | 4 | ||||
| -rw-r--r-- | drivers/cpufreq/omap-cpufreq.c | 2 | ||||
| -rw-r--r-- | drivers/devfreq/devfreq.c | 9 | ||||
| -rw-r--r-- | drivers/devfreq/exynos/exynos4_bus.c | 6 | ||||
| -rw-r--r-- | drivers/devfreq/exynos/exynos5_bus.c | 6 | ||||
| -rw-r--r-- | include/linux/devfreq.h | 4 | ||||
| -rw-r--r-- | include/linux/opp.h | 29 |
12 files changed, 60 insertions, 53 deletions
diff --git a/Documentation/power/opp.txt b/Documentation/power/opp.txt index 185367b1848f..7f67e3d2c530 100644 --- a/Documentation/power/opp.txt +++ b/Documentation/power/opp.txt | |||
| @@ -358,14 +358,14 @@ 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 dev_pm_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 dev_pm_opp_enable/disable functions. | 370 | availability of the OPP can be modified by dev_pm_opp_enable/disable functions. |
| 371 | 371 | ||
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 937744c3679d..92901bd41490 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c | |||
| @@ -131,7 +131,7 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name, | |||
| 131 | { | 131 | { |
| 132 | struct voltagedomain *voltdm; | 132 | struct voltagedomain *voltdm; |
| 133 | struct clk *clk; | 133 | struct clk *clk; |
| 134 | struct opp *opp; | 134 | struct dev_pm_opp *opp; |
| 135 | unsigned long freq, bootup_volt; | 135 | unsigned long freq, bootup_volt; |
| 136 | struct device *dev; | 136 | struct device *dev; |
| 137 | 137 | ||
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index 00c6a449cdeb..693e14a24914 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c | |||
| @@ -42,7 +42,7 @@ | |||
| 42 | */ | 42 | */ |
| 43 | 43 | ||
| 44 | /** | 44 | /** |
| 45 | * struct opp - Generic OPP description structure | 45 | * struct dev_pm_opp - Generic OPP description structure |
| 46 | * @node: opp list node. The nodes are maintained throughout the lifetime | 46 | * @node: opp list node. The nodes are maintained throughout the lifetime |
| 47 | * of boot. It is expected only an optimal set of OPPs are | 47 | * of boot. It is expected only an optimal set of OPPs are |
| 48 | * added to the library by the SoC framework. | 48 | * added to the library by the SoC framework. |
| @@ -59,7 +59,7 @@ | |||
| 59 | * | 59 | * |
| 60 | * This structure stores the OPP information for a given device. | 60 | * This structure stores the OPP information for a given device. |
| 61 | */ | 61 | */ |
| 62 | struct opp { | 62 | struct dev_pm_opp { |
| 63 | struct list_head node; | 63 | struct list_head node; |
| 64 | 64 | ||
| 65 | bool available; | 65 | bool available; |
| @@ -150,9 +150,9 @@ static struct device_opp *find_device_opp(struct device *dev) | |||
| 150 | * prior to unlocking with rcu_read_unlock() to maintain the integrity of the | 150 | * prior to unlocking with rcu_read_unlock() to maintain the integrity of the |
| 151 | * pointer. | 151 | * pointer. |
| 152 | */ | 152 | */ |
| 153 | unsigned long dev_pm_opp_get_voltage(struct opp *opp) | 153 | unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp) |
| 154 | { | 154 | { |
| 155 | struct opp *tmp_opp; | 155 | struct dev_pm_opp *tmp_opp; |
| 156 | unsigned long v = 0; | 156 | unsigned long v = 0; |
| 157 | 157 | ||
| 158 | tmp_opp = rcu_dereference(opp); | 158 | tmp_opp = rcu_dereference(opp); |
| @@ -180,9 +180,9 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_get_voltage); | |||
| 180 | * prior to unlocking with rcu_read_unlock() to maintain the integrity of the | 180 | * prior to unlocking with rcu_read_unlock() to maintain the integrity of the |
| 181 | * pointer. | 181 | * pointer. |
| 182 | */ | 182 | */ |
| 183 | unsigned long dev_pm_opp_get_freq(struct opp *opp) | 183 | unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp) |
| 184 | { | 184 | { |
| 185 | struct opp *tmp_opp; | 185 | struct dev_pm_opp *tmp_opp; |
| 186 | unsigned long f = 0; | 186 | unsigned long f = 0; |
| 187 | 187 | ||
| 188 | tmp_opp = rcu_dereference(opp); | 188 | tmp_opp = rcu_dereference(opp); |
| @@ -209,7 +209,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_get_freq); | |||
| 209 | int dev_pm_opp_get_opp_count(struct device *dev) | 209 | int dev_pm_opp_get_opp_count(struct device *dev) |
| 210 | { | 210 | { |
| 211 | struct device_opp *dev_opp; | 211 | struct device_opp *dev_opp; |
| 212 | struct opp *temp_opp; | 212 | struct dev_pm_opp *temp_opp; |
| 213 | int count = 0; | 213 | int count = 0; |
| 214 | 214 | ||
| 215 | dev_opp = find_device_opp(dev); | 215 | dev_opp = find_device_opp(dev); |
| @@ -254,11 +254,12 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_get_opp_count); | |||
| 254 | * under the locked area. The pointer returned must be used prior to unlocking | 254 | * under the locked area. The pointer returned must be used prior to unlocking |
| 255 | * with rcu_read_unlock() to maintain the integrity of the pointer. | 255 | * with rcu_read_unlock() to maintain the integrity of the pointer. |
| 256 | */ | 256 | */ |
| 257 | struct opp *dev_pm_opp_find_freq_exact(struct device *dev, unsigned long freq, | 257 | struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev, |
| 258 | bool available) | 258 | unsigned long freq, |
| 259 | bool available) | ||
| 259 | { | 260 | { |
| 260 | struct device_opp *dev_opp; | 261 | struct device_opp *dev_opp; |
| 261 | struct opp *temp_opp, *opp = ERR_PTR(-ERANGE); | 262 | struct dev_pm_opp *temp_opp, *opp = ERR_PTR(-ERANGE); |
| 262 | 263 | ||
| 263 | dev_opp = find_device_opp(dev); | 264 | dev_opp = find_device_opp(dev); |
| 264 | if (IS_ERR(dev_opp)) { | 265 | if (IS_ERR(dev_opp)) { |
| @@ -300,10 +301,11 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_exact); | |||
| 300 | * under the locked area. The pointer returned must be used prior to unlocking | 301 | * under the locked area. The pointer returned must be used prior to unlocking |
| 301 | * with rcu_read_unlock() to maintain the integrity of the pointer. | 302 | * with rcu_read_unlock() to maintain the integrity of the pointer. |
| 302 | */ | 303 | */ |
| 303 | struct opp *dev_pm_opp_find_freq_ceil(struct device *dev, unsigned long *freq) | 304 | struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev, |
| 305 | unsigned long *freq) | ||
| 304 | { | 306 | { |
| 305 | struct device_opp *dev_opp; | 307 | struct device_opp *dev_opp; |
| 306 | struct opp *temp_opp, *opp = ERR_PTR(-ERANGE); | 308 | struct dev_pm_opp *temp_opp, *opp = ERR_PTR(-ERANGE); |
| 307 | 309 | ||
| 308 | if (!dev || !freq) { | 310 | if (!dev || !freq) { |
| 309 | dev_err(dev, "%s: Invalid argument freq=%p\n", __func__, freq); | 311 | dev_err(dev, "%s: Invalid argument freq=%p\n", __func__, freq); |
| @@ -347,10 +349,11 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_ceil); | |||
| 347 | * under the locked area. The pointer returned must be used prior to unlocking | 349 | * under the locked area. The pointer returned must be used prior to unlocking |
| 348 | * with rcu_read_unlock() to maintain the integrity of the pointer. | 350 | * with rcu_read_unlock() to maintain the integrity of the pointer. |
| 349 | */ | 351 | */ |
| 350 | struct opp *dev_pm_opp_find_freq_floor(struct device *dev, unsigned long *freq) | 352 | struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev, |
| 353 | unsigned long *freq) | ||
| 351 | { | 354 | { |
| 352 | struct device_opp *dev_opp; | 355 | struct device_opp *dev_opp; |
| 353 | struct opp *temp_opp, *opp = ERR_PTR(-ERANGE); | 356 | struct dev_pm_opp *temp_opp, *opp = ERR_PTR(-ERANGE); |
| 354 | 357 | ||
| 355 | if (!dev || !freq) { | 358 | if (!dev || !freq) { |
| 356 | dev_err(dev, "%s: Invalid argument freq=%p\n", __func__, freq); | 359 | dev_err(dev, "%s: Invalid argument freq=%p\n", __func__, freq); |
| @@ -396,11 +399,11 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_floor); | |||
| 396 | int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt) | 399 | int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt) |
| 397 | { | 400 | { |
| 398 | struct device_opp *dev_opp = NULL; | 401 | struct device_opp *dev_opp = NULL; |
| 399 | struct opp *opp, *new_opp; | 402 | struct dev_pm_opp *opp, *new_opp; |
| 400 | struct list_head *head; | 403 | struct list_head *head; |
| 401 | 404 | ||
| 402 | /* allocate new OPP node */ | 405 | /* allocate new OPP node */ |
| 403 | new_opp = kzalloc(sizeof(struct opp), GFP_KERNEL); | 406 | new_opp = kzalloc(sizeof(*new_opp), GFP_KERNEL); |
| 404 | if (!new_opp) { | 407 | if (!new_opp) { |
| 405 | dev_warn(dev, "%s: Unable to create new OPP node\n", __func__); | 408 | dev_warn(dev, "%s: Unable to create new OPP node\n", __func__); |
| 406 | return -ENOMEM; | 409 | return -ENOMEM; |
| @@ -485,11 +488,11 @@ static int opp_set_availability(struct device *dev, unsigned long freq, | |||
| 485 | bool availability_req) | 488 | bool availability_req) |
| 486 | { | 489 | { |
| 487 | struct device_opp *tmp_dev_opp, *dev_opp = ERR_PTR(-ENODEV); | 490 | struct device_opp *tmp_dev_opp, *dev_opp = ERR_PTR(-ENODEV); |
| 488 | struct opp *new_opp, *tmp_opp, *opp = ERR_PTR(-ENODEV); | 491 | struct dev_pm_opp *new_opp, *tmp_opp, *opp = ERR_PTR(-ENODEV); |
| 489 | int r = 0; | 492 | int r = 0; |
| 490 | 493 | ||
| 491 | /* keep the node allocated */ | 494 | /* keep the node allocated */ |
| 492 | new_opp = kmalloc(sizeof(struct opp), GFP_KERNEL); | 495 | new_opp = kmalloc(sizeof(*new_opp), GFP_KERNEL); |
| 493 | if (!new_opp) { | 496 | if (!new_opp) { |
| 494 | dev_warn(dev, "%s: Unable to create OPP\n", __func__); | 497 | dev_warn(dev, "%s: Unable to create OPP\n", __func__); |
| 495 | return -ENOMEM; | 498 | return -ENOMEM; |
| @@ -623,7 +626,7 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev, | |||
| 623 | struct cpufreq_frequency_table **table) | 626 | struct cpufreq_frequency_table **table) |
| 624 | { | 627 | { |
| 625 | struct device_opp *dev_opp; | 628 | struct device_opp *dev_opp; |
| 626 | struct opp *opp; | 629 | struct dev_pm_opp *opp; |
| 627 | struct cpufreq_frequency_table *freq_table; | 630 | struct cpufreq_frequency_table *freq_table; |
| 628 | int i = 0; | 631 | int i = 0; |
| 629 | 632 | ||
diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index af951a9cea78..d73107894fee 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c | |||
| @@ -44,7 +44,7 @@ static int cpu0_set_target(struct cpufreq_policy *policy, | |||
| 44 | unsigned int target_freq, unsigned int relation) | 44 | unsigned int target_freq, unsigned int relation) |
| 45 | { | 45 | { |
| 46 | struct cpufreq_freqs freqs; | 46 | struct cpufreq_freqs freqs; |
| 47 | struct opp *opp; | 47 | struct dev_pm_opp *opp; |
| 48 | unsigned long volt = 0, volt_old = 0, tol = 0; | 48 | unsigned long volt = 0, volt_old = 0, tol = 0; |
| 49 | long freq_Hz, freq_exact; | 49 | long freq_Hz, freq_exact; |
| 50 | unsigned int index; | 50 | unsigned int index; |
| @@ -230,7 +230,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) | |||
| 230 | transition_latency = CPUFREQ_ETERNAL; | 230 | transition_latency = CPUFREQ_ETERNAL; |
| 231 | 231 | ||
| 232 | if (!IS_ERR(cpu_reg)) { | 232 | if (!IS_ERR(cpu_reg)) { |
| 233 | struct opp *opp; | 233 | struct dev_pm_opp *opp; |
| 234 | unsigned long min_uV, max_uV; | 234 | unsigned long min_uV, max_uV; |
| 235 | int i; | 235 | int i; |
| 236 | 236 | ||
diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c index 444eca74d3c2..c8b3d3950f9e 100644 --- a/drivers/cpufreq/exynos5440-cpufreq.c +++ b/drivers/cpufreq/exynos5440-cpufreq.c | |||
| @@ -118,7 +118,7 @@ static int init_div_table(void) | |||
| 118 | struct cpufreq_frequency_table *freq_tbl = dvfs_info->freq_table; | 118 | struct cpufreq_frequency_table *freq_tbl = dvfs_info->freq_table; |
| 119 | unsigned int tmp, clk_div, ema_div, freq, volt_id; | 119 | unsigned int tmp, clk_div, ema_div, freq, volt_id; |
| 120 | int i = 0; | 120 | int i = 0; |
| 121 | struct opp *opp; | 121 | struct dev_pm_opp *opp; |
| 122 | 122 | ||
| 123 | rcu_read_lock(); | 123 | rcu_read_lock(); |
| 124 | for (i = 0; freq_tbl[i].frequency != CPUFREQ_TABLE_END; i++) { | 124 | for (i = 0; freq_tbl[i].frequency != CPUFREQ_TABLE_END; i++) { |
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index b360549e7715..84e993dfb305 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c | |||
| @@ -49,7 +49,7 @@ static int imx6q_set_target(struct cpufreq_policy *policy, | |||
| 49 | unsigned int target_freq, unsigned int relation) | 49 | unsigned int target_freq, unsigned int relation) |
| 50 | { | 50 | { |
| 51 | struct cpufreq_freqs freqs; | 51 | struct cpufreq_freqs freqs; |
| 52 | struct opp *opp; | 52 | struct dev_pm_opp *opp; |
| 53 | unsigned long freq_hz, volt, volt_old; | 53 | unsigned long freq_hz, volt, volt_old; |
| 54 | unsigned int index; | 54 | unsigned int index; |
| 55 | int ret; | 55 | int ret; |
| @@ -199,7 +199,7 @@ static struct cpufreq_driver imx6q_cpufreq_driver = { | |||
| 199 | static int imx6q_cpufreq_probe(struct platform_device *pdev) | 199 | static int imx6q_cpufreq_probe(struct platform_device *pdev) |
| 200 | { | 200 | { |
| 201 | struct device_node *np; | 201 | struct device_node *np; |
| 202 | struct opp *opp; | 202 | struct dev_pm_opp *opp; |
| 203 | unsigned long min_volt, max_volt; | 203 | unsigned long min_volt, max_volt; |
| 204 | int num, ret; | 204 | int num, ret; |
| 205 | 205 | ||
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c index c5e31d296607..f057d423020c 100644 --- a/drivers/cpufreq/omap-cpufreq.c +++ b/drivers/cpufreq/omap-cpufreq.c | |||
| @@ -65,7 +65,7 @@ static int omap_target(struct cpufreq_policy *policy, | |||
| 65 | unsigned int i; | 65 | unsigned int i; |
| 66 | int r, ret = 0; | 66 | int r, ret = 0; |
| 67 | struct cpufreq_freqs freqs; | 67 | struct cpufreq_freqs freqs; |
| 68 | struct opp *opp; | 68 | struct dev_pm_opp *opp; |
| 69 | unsigned long freq, volt = 0, volt_old = 0, tol = 0; | 69 | unsigned long freq, volt = 0, volt_old = 0, tol = 0; |
| 70 | 70 | ||
| 71 | if (!freq_table) { | 71 | if (!freq_table) { |
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index f798edcb910d..03530a0a8042 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c | |||
| @@ -902,7 +902,7 @@ 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 | ||
| @@ -1029,10 +1029,11 @@ 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 | */ |
| 1032 | struct opp *devfreq_recommended_opp(struct device *dev, unsigned long *freq, | 1032 | struct 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 */ |
diff --git a/drivers/devfreq/exynos/exynos4_bus.c b/drivers/devfreq/exynos/exynos4_bus.c index 33c0e05a5ff1..891becd46513 100644 --- a/drivers/devfreq/exynos/exynos4_bus.c +++ b/drivers/devfreq/exynos/exynos4_bus.c | |||
| @@ -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; |
| @@ -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; |
| @@ -1020,7 +1020,7 @@ unlock: | |||
| 1020 | static int exynos4_busfreq_probe(struct platform_device *pdev) | 1020 | static 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 | ||
diff --git a/drivers/devfreq/exynos/exynos5_bus.c b/drivers/devfreq/exynos/exynos5_bus.c index b0e45925505b..d06232aa0738 100644 --- a/drivers/devfreq/exynos/exynos5_bus.c +++ b/drivers/devfreq/exynos/exynos5_bus.c | |||
| @@ -132,7 +132,7 @@ static int exynos5_busfreq_int_target(struct device *dev, unsigned long *_freq, | |||
| 132 | struct platform_device *pdev = container_of(dev, struct platform_device, | 132 | struct platform_device *pdev = container_of(dev, struct platform_device, |
| 133 | dev); | 133 | dev); |
| 134 | struct busfreq_data_int *data = platform_get_drvdata(pdev); | 134 | struct busfreq_data_int *data = platform_get_drvdata(pdev); |
| 135 | struct opp *opp; | 135 | struct dev_pm_opp *opp; |
| 136 | unsigned long old_freq, freq; | 136 | unsigned long old_freq, freq; |
| 137 | unsigned long volt; | 137 | unsigned long volt; |
| 138 | 138 | ||
| @@ -262,7 +262,7 @@ static int exynos5_busfreq_int_pm_notifier_event(struct notifier_block *this, | |||
| 262 | { | 262 | { |
| 263 | struct busfreq_data_int *data = container_of(this, | 263 | struct busfreq_data_int *data = container_of(this, |
| 264 | struct busfreq_data_int, pm_notifier); | 264 | struct busfreq_data_int, pm_notifier); |
| 265 | struct opp *opp; | 265 | struct dev_pm_opp *opp; |
| 266 | unsigned long maxfreq = ULONG_MAX; | 266 | unsigned long maxfreq = ULONG_MAX; |
| 267 | unsigned long freq; | 267 | unsigned long freq; |
| 268 | unsigned long volt; | 268 | unsigned long volt; |
| @@ -316,7 +316,7 @@ unlock: | |||
| 316 | static int exynos5_busfreq_int_probe(struct platform_device *pdev) | 316 | static int exynos5_busfreq_int_probe(struct platform_device *pdev) |
| 317 | { | 317 | { |
| 318 | struct busfreq_data_int *data; | 318 | struct busfreq_data_int *data; |
| 319 | struct opp *opp; | 319 | struct dev_pm_opp *opp; |
| 320 | struct device *dev = &pdev->dev; | 320 | struct device *dev = &pdev->dev; |
| 321 | struct device_node *np; | 321 | struct device_node *np; |
| 322 | unsigned long initial_freq; | 322 | unsigned long initial_freq; |
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index 5f1ab92107e6..c8c995325ca8 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h | |||
| @@ -187,7 +187,7 @@ extern int devfreq_suspend_device(struct devfreq *devfreq); | |||
| 187 | extern int devfreq_resume_device(struct devfreq *devfreq); | 187 | extern int devfreq_resume_device(struct devfreq *devfreq); |
| 188 | 188 | ||
| 189 | /* Helper functions for devfreq user device driver with OPP. */ | 189 | /* Helper functions for devfreq user device driver with OPP. */ |
| 190 | extern struct opp *devfreq_recommended_opp(struct device *dev, | 190 | extern struct dev_pm_opp *devfreq_recommended_opp(struct device *dev, |
| 191 | unsigned long *freq, u32 flags); | 191 | unsigned long *freq, u32 flags); |
| 192 | extern int devfreq_register_opp_notifier(struct device *dev, | 192 | extern int devfreq_register_opp_notifier(struct device *dev, |
| 193 | struct devfreq *devfreq); | 193 | struct devfreq *devfreq); |
| @@ -238,7 +238,7 @@ static inline int devfreq_resume_device(struct devfreq *devfreq) | |||
| 238 | return 0; | 238 | return 0; |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | static inline struct opp *devfreq_recommended_opp(struct device *dev, | 241 | static inline struct dev_pm_opp *devfreq_recommended_opp(struct device *dev, |
| 242 | unsigned long *freq, u32 flags) | 242 | unsigned long *freq, u32 flags) |
| 243 | { | 243 | { |
| 244 | return ERR_PTR(-EINVAL); | 244 | return ERR_PTR(-EINVAL); |
diff --git a/include/linux/opp.h b/include/linux/opp.h index 2066ae5880c6..5151b0059585 100644 --- a/include/linux/opp.h +++ b/include/linux/opp.h | |||
| @@ -18,27 +18,30 @@ | |||
| 18 | #include <linux/cpufreq.h> | 18 | #include <linux/cpufreq.h> |
| 19 | #include <linux/notifier.h> | 19 | #include <linux/notifier.h> |
| 20 | 20 | ||
| 21 | struct opp; | 21 | struct dev_pm_opp; |
| 22 | struct device; | 22 | struct device; |
| 23 | 23 | ||
| 24 | enum opp_event { | 24 | enum dev_pm_opp_event { |
| 25 | OPP_EVENT_ADD, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE, | 25 | OPP_EVENT_ADD, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE, |
| 26 | }; | 26 | }; |
| 27 | 27 | ||
| 28 | #if defined(CONFIG_PM_OPP) | 28 | #if defined(CONFIG_PM_OPP) |
| 29 | 29 | ||
| 30 | unsigned long dev_pm_opp_get_voltage(struct opp *opp); | 30 | unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp); |
| 31 | 31 | ||
| 32 | unsigned long dev_pm_opp_get_freq(struct opp *opp); | 32 | unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp); |
| 33 | 33 | ||
| 34 | int dev_pm_opp_get_opp_count(struct device *dev); | 34 | int dev_pm_opp_get_opp_count(struct device *dev); |
| 35 | 35 | ||
| 36 | struct opp *dev_pm_opp_find_freq_exact(struct device *dev, unsigned long freq, | 36 | struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev, |
| 37 | bool available); | 37 | unsigned long freq, |
| 38 | bool available); | ||
| 38 | 39 | ||
| 39 | struct opp *dev_pm_opp_find_freq_floor(struct device *dev, unsigned long *freq); | 40 | struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev, |
| 41 | unsigned long *freq); | ||
| 40 | 42 | ||
| 41 | struct opp *dev_pm_opp_find_freq_ceil(struct device *dev, unsigned long *freq); | 43 | struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev, |
| 44 | unsigned long *freq); | ||
| 42 | 45 | ||
| 43 | int dev_pm_opp_add(struct device *dev, unsigned long freq, | 46 | int dev_pm_opp_add(struct device *dev, unsigned long freq, |
| 44 | unsigned long u_volt); | 47 | unsigned long u_volt); |
| @@ -49,12 +52,12 @@ int dev_pm_opp_disable(struct device *dev, unsigned long freq); | |||
| 49 | 52 | ||
| 50 | struct srcu_notifier_head *dev_pm_opp_get_notifier(struct device *dev); | 53 | struct srcu_notifier_head *dev_pm_opp_get_notifier(struct device *dev); |
| 51 | #else | 54 | #else |
| 52 | static inline unsigned long dev_pm_opp_get_voltage(struct opp *opp) | 55 | static inline unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp) |
| 53 | { | 56 | { |
| 54 | return 0; | 57 | return 0; |
| 55 | } | 58 | } |
| 56 | 59 | ||
| 57 | static inline unsigned long dev_pm_opp_get_freq(struct opp *opp) | 60 | static inline unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp) |
| 58 | { | 61 | { |
| 59 | return 0; | 62 | return 0; |
| 60 | } | 63 | } |
| @@ -64,19 +67,19 @@ static inline int dev_pm_opp_get_opp_count(struct device *dev) | |||
| 64 | return 0; | 67 | return 0; |
| 65 | } | 68 | } |
| 66 | 69 | ||
| 67 | static inline struct opp *dev_pm_opp_find_freq_exact(struct device *dev, | 70 | static inline struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev, |
| 68 | unsigned long freq, bool available) | 71 | unsigned long freq, bool available) |
| 69 | { | 72 | { |
| 70 | return ERR_PTR(-EINVAL); | 73 | return ERR_PTR(-EINVAL); |
| 71 | } | 74 | } |
| 72 | 75 | ||
| 73 | static inline struct opp *dev_pm_opp_find_freq_floor(struct device *dev, | 76 | static inline struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev, |
| 74 | unsigned long *freq) | 77 | unsigned long *freq) |
| 75 | { | 78 | { |
| 76 | return ERR_PTR(-EINVAL); | 79 | return ERR_PTR(-EINVAL); |
| 77 | } | 80 | } |
| 78 | 81 | ||
| 79 | static inline struct opp *dev_pm_opp_find_freq_ceil(struct device *dev, | 82 | static inline struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev, |
| 80 | unsigned long *freq) | 83 | unsigned long *freq) |
| 81 | { | 84 | { |
| 82 | return ERR_PTR(-EINVAL); | 85 | return ERR_PTR(-EINVAL); |
