Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PM / OPP: Expose _of_get_opp_desc_node as dev_pm_opp API

Rename _of_get_opp_desc_node to dev_pm_opp_of_get_opp_desc_node and add it
to include/linux/pm_opp.h to allow other drivers, such as platform OPP
and cpufreq drivers, to make use of it.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Dave Gerlach and committed by
Rafael J. Wysocki
0764c604 6ac42397

+11 -4
+5 -4
drivers/base/power/opp/of.c
··· 243 243 EXPORT_SYMBOL_GPL(dev_pm_opp_of_remove_table); 244 244 245 245 /* Returns opp descriptor node for a device, caller must do of_node_put() */ 246 - static struct device_node *_of_get_opp_desc_node(struct device *dev) 246 + struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev) 247 247 { 248 248 /* 249 249 * There should be only ONE phandle present in "operating-points-v2" ··· 252 252 253 253 return of_parse_phandle(dev->of_node, "operating-points-v2", 0); 254 254 } 255 + EXPORT_SYMBOL_GPL(dev_pm_opp_of_get_opp_desc_node); 255 256 256 257 /** 257 258 * _opp_add_static_v2() - Allocate static OPPs (As per 'v2' DT bindings) ··· 479 478 * OPPs have two version of bindings now. The older one is deprecated, 480 479 * try for the new binding first. 481 480 */ 482 - opp_np = _of_get_opp_desc_node(dev); 481 + opp_np = dev_pm_opp_of_get_opp_desc_node(dev); 483 482 if (!opp_np) { 484 483 /* 485 484 * Try old-deprecated bindings for backward compatibility with ··· 571 570 int cpu, ret = 0; 572 571 573 572 /* Get OPP descriptor node */ 574 - np = _of_get_opp_desc_node(cpu_dev); 573 + np = dev_pm_opp_of_get_opp_desc_node(cpu_dev); 575 574 if (!np) { 576 575 dev_dbg(cpu_dev, "%s: Couldn't find opp node.\n", __func__); 577 576 return -ENOENT; ··· 596 595 } 597 596 598 597 /* Get OPP descriptor node */ 599 - tmp_np = _of_get_opp_desc_node(tcpu_dev); 598 + tmp_np = dev_pm_opp_of_get_opp_desc_node(tcpu_dev); 600 599 if (!tmp_np) { 601 600 dev_err(tcpu_dev, "%s: Couldn't find opp node.\n", 602 601 __func__);
+6
include/linux/pm_opp.h
··· 288 288 int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask); 289 289 void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask); 290 290 int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask); 291 + struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev); 291 292 #else 292 293 static inline int dev_pm_opp_of_add_table(struct device *dev) 293 294 { ··· 311 310 static inline int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask) 312 311 { 313 312 return -ENOTSUPP; 313 + } 314 + 315 + static inline struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev) 316 + { 317 + return NULL; 314 318 } 315 319 #endif 316 320