From 0c0f397f308b0e5a5ceceebefde9ba3ecba59029 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=99=88=E4=BA=AE?= Date: Tue, 25 Mar 2014 06:42:44 -0700 Subject: [PATCH] dvfs: add dvfs_get_regulator() function --- arch/arm/mach-rockchip/dvfs.c | 8 ++++++-- include/linux/rockchip/dvfs.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-rockchip/dvfs.c b/arch/arm/mach-rockchip/dvfs.c index f575f65113db..2ca962095ecb 100644 --- a/arch/arm/mach-rockchip/dvfs.c +++ b/arch/arm/mach-rockchip/dvfs.c @@ -282,18 +282,22 @@ static void dvfs_vd_get_regulator_mode_info(struct vd_node *vd) } } } +#endif -struct regulator *dvfs_get_regulator1(char *regulator_name) +struct regulator *dvfs_get_regulator(char *regulator_name) { struct vd_node *vd; + + mutex_lock(&rk_dvfs_mutex); list_for_each_entry(vd, &rk_dvfs_tree, node) { if (strcmp(regulator_name, vd->regulator_name) == 0) { + mutex_unlock(&rk_dvfs_mutex); return vd->regulator; } } + mutex_unlock(&rk_dvfs_mutex); return NULL; } -#endif static int dvfs_get_rate_range(struct dvfs_node *clk_dvfs_node) { diff --git a/include/linux/rockchip/dvfs.h b/include/linux/rockchip/dvfs.h index 9155786f572d..71a248f0be64 100644 --- a/include/linux/rockchip/dvfs.h +++ b/include/linux/rockchip/dvfs.h @@ -167,6 +167,7 @@ struct cpufreq_frequency_table *dvfs_get_freq_volt_table(struct dvfs_node *clk_d int rk_regist_vd(struct vd_node *vd); int rk_regist_pd(struct pd_node *pd); int rk_regist_clk(struct dvfs_node *clk_dvfs_node); +struct regulator *dvfs_get_regulator(char *regulator_name); int of_dvfs_init(void); #else @@ -189,6 +190,7 @@ static inline struct cpufreq_frequency_table *dvfs_get_freq_volt_table(struct dv static inline int rk_regist_vd(struct vd_node *vd){ return 0; }; static inline int rk_regist_pd(struct pd_node *pd){ return 0; }; static inline int rk_regist_clk(struct dvfs_node *clk_dvfs_node){ return 0; }; +struct regulator *dvfs_get_regulator(char *regulator_name){ return NULL; }; static inline int of_dvfs_init(void){ return 0; }; #endif -- 2.34.1