summaryrefslogtreecommitdiffstats
path: root/include/linux/devfreq.h
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2015-11-10 20:31:07 +0900
committerMyungJoo Ham <myungjoo.ham@samsung.com>2016-05-03 11:20:06 +0900
commit8f510aeb223b26c4ffbece9fa92e4befea470f57 (patch)
treebf4fb4bad488510fab1baf43cbb42df08e0e2b7e /include/linux/devfreq.h
parent72c160bda1dbe75d532502374a6cb6be28990093 (diff)
downloadlinux-stable-8f510aeb223b26c4ffbece9fa92e4befea470f57.tar.gz
linux-stable-8f510aeb223b26c4ffbece9fa92e4befea470f57.tar.bz2
linux-stable-8f510aeb223b26c4ffbece9fa92e4befea470f57.zip
PM / devfreq: Add devfreq_get_devfreq_by_phandle()
This patch adds the new devfreq_get_devfreq_by_phandle() OF helper function which can find the instance of devfreq device by using phandle ("devfreq"). Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> [m.reichl and linux.amoon: Tested it on exynos4412-odroidu3 board] Tested-by: Markus Reichl <m.reichl@fivetechno.de> Tested-by: Anand Moon <linux.amoon@gmail.com> Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Diffstat (limited to 'include/linux/devfreq.h')
-rw-r--r--include/linux/devfreq.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
index 6fa02a20eb63..aa0b8424ebc3 100644
--- a/include/linux/devfreq.h
+++ b/include/linux/devfreq.h
@@ -208,6 +208,9 @@ extern int devm_devfreq_register_opp_notifier(struct device *dev,
extern void devm_devfreq_unregister_opp_notifier(struct device *dev,
struct devfreq *devfreq);
+extern struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev,
+ int index);
+
/**
* devfreq_update_stats() - update the last_status pointer in struct devfreq
* @df: the devfreq instance whose status needs updating
@@ -307,6 +310,12 @@ static inline void devm_devfreq_unregister_opp_notifier(struct device *dev,
{
}
+static inline struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev,
+ int index)
+{
+ return ERR_PTR(-ENODEV);
+}
+
static inline int devfreq_update_stats(struct devfreq *df)
{
return -EINVAL;