From: 陈亮 Date: Tue, 25 Mar 2014 13:42:44 +0000 (-0700) Subject: dvfs: add dvfs_get_regulator() function X-Git-Tag: firefly_0821_release~5840 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0c0f397f308b0e5a5ceceebefde9ba3ecba59029;p=firefly-linux-kernel-4.4.55.git dvfs: add dvfs_get_regulator() function --- 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