Lines Matching refs:clki

369 	struct ufs_clk_info *clki;  in ufshcd_print_clk_freqs()  local
375 list_for_each_entry(clki, head, list) { in ufshcd_print_clk_freqs()
376 if (!IS_ERR_OR_NULL(clki->clk) && clki->min_freq && in ufshcd_print_clk_freqs()
377 clki->max_freq) in ufshcd_print_clk_freqs()
379 clki->name, clki->curr_freq); in ufshcd_print_clk_freqs()
906 struct ufs_clk_info *clki; in ufshcd_scale_clks() local
918 list_for_each_entry(clki, head, list) { in ufshcd_scale_clks()
919 if (!IS_ERR_OR_NULL(clki->clk)) { in ufshcd_scale_clks()
920 if (scale_up && clki->max_freq) { in ufshcd_scale_clks()
921 if (clki->curr_freq == clki->max_freq) in ufshcd_scale_clks()
925 ret = clk_set_rate(clki->clk, clki->max_freq); in ufshcd_scale_clks()
928 __func__, clki->name, in ufshcd_scale_clks()
929 clki->max_freq, ret); in ufshcd_scale_clks()
933 "scaled up", clki->name, in ufshcd_scale_clks()
934 clki->curr_freq, in ufshcd_scale_clks()
935 clki->max_freq); in ufshcd_scale_clks()
937 clki->curr_freq = clki->max_freq; in ufshcd_scale_clks()
939 } else if (!scale_up && clki->min_freq) { in ufshcd_scale_clks()
940 if (clki->curr_freq == clki->min_freq) in ufshcd_scale_clks()
944 ret = clk_set_rate(clki->clk, clki->min_freq); in ufshcd_scale_clks()
947 __func__, clki->name, in ufshcd_scale_clks()
948 clki->min_freq, ret); in ufshcd_scale_clks()
952 "scaled down", clki->name, in ufshcd_scale_clks()
953 clki->curr_freq, in ufshcd_scale_clks()
954 clki->min_freq); in ufshcd_scale_clks()
955 clki->curr_freq = clki->min_freq; in ufshcd_scale_clks()
959 clki->name, clk_get_rate(clki->clk)); in ufshcd_scale_clks()
982 struct ufs_clk_info *clki; in ufshcd_is_devfreq_scaling_required() local
988 list_for_each_entry(clki, head, list) { in ufshcd_is_devfreq_scaling_required()
989 if (!IS_ERR_OR_NULL(clki->clk)) { in ufshcd_is_devfreq_scaling_required()
990 if (scale_up && clki->max_freq) { in ufshcd_is_devfreq_scaling_required()
991 if (clki->curr_freq == clki->max_freq) in ufshcd_is_devfreq_scaling_required()
994 } else if (!scale_up && clki->min_freq) { in ufshcd_is_devfreq_scaling_required()
995 if (clki->curr_freq == clki->min_freq) in ufshcd_is_devfreq_scaling_required()
1229 struct ufs_clk_info *clki; in ufshcd_devfreq_target() local
1249 clki = list_first_entry(&hba->clk_list_head, struct ufs_clk_info, list); in ufshcd_devfreq_target()
1250 scale_up = (*freq == clki->max_freq) ? true : false; in ufshcd_devfreq_target()
1321 struct ufs_clk_info *clki; in ufshcd_devfreq_init() local
1329 clki = list_first_entry(clk_list, struct ufs_clk_info, list); in ufshcd_devfreq_init()
1330 dev_pm_opp_add(hba->dev, clki->min_freq, 0); in ufshcd_devfreq_init()
1331 dev_pm_opp_add(hba->dev, clki->max_freq, 0); in ufshcd_devfreq_init()
1341 dev_pm_opp_remove(hba->dev, clki->min_freq); in ufshcd_devfreq_init()
1342 dev_pm_opp_remove(hba->dev, clki->max_freq); in ufshcd_devfreq_init()
1354 struct ufs_clk_info *clki; in ufshcd_devfreq_remove() local
1362 clki = list_first_entry(clk_list, struct ufs_clk_info, list); in ufshcd_devfreq_remove()
1363 dev_pm_opp_remove(hba->dev, clki->min_freq); in ufshcd_devfreq_remove()
1364 dev_pm_opp_remove(hba->dev, clki->max_freq); in ufshcd_devfreq_remove()
7274 struct ufs_clk_info *clki; in __ufshcd_setup_clocks() local
7294 list_for_each_entry(clki, head, list) { in __ufshcd_setup_clocks()
7295 if (!IS_ERR_OR_NULL(clki->clk)) { in __ufshcd_setup_clocks()
7296 if (skip_ref_clk && !strcmp(clki->name, "ref_clk")) in __ufshcd_setup_clocks()
7299 clk_state_changed = on ^ clki->enabled; in __ufshcd_setup_clocks()
7300 if (on && !clki->enabled) { in __ufshcd_setup_clocks()
7301 ret = clk_prepare_enable(clki->clk); in __ufshcd_setup_clocks()
7304 __func__, clki->name, ret); in __ufshcd_setup_clocks()
7307 } else if (!on && clki->enabled) { in __ufshcd_setup_clocks()
7308 clk_disable_unprepare(clki->clk); in __ufshcd_setup_clocks()
7310 clki->enabled = on; in __ufshcd_setup_clocks()
7312 clki->name, on ? "en" : "dis"); in __ufshcd_setup_clocks()
7329 list_for_each_entry(clki, head, list) { in __ufshcd_setup_clocks()
7330 if (!IS_ERR_OR_NULL(clki->clk) && clki->enabled) in __ufshcd_setup_clocks()
7331 clk_disable_unprepare(clki->clk); in __ufshcd_setup_clocks()
7356 struct ufs_clk_info *clki; in ufshcd_init_clocks() local
7363 list_for_each_entry(clki, head, list) { in ufshcd_init_clocks()
7364 if (!clki->name) in ufshcd_init_clocks()
7367 clki->clk = devm_clk_get(dev, clki->name); in ufshcd_init_clocks()
7368 if (IS_ERR(clki->clk)) { in ufshcd_init_clocks()
7369 ret = PTR_ERR(clki->clk); in ufshcd_init_clocks()
7371 __func__, clki->name, ret); in ufshcd_init_clocks()
7380 if (!strcmp(clki->name, "ref_clk")) in ufshcd_init_clocks()
7381 ufshcd_parse_dev_ref_clk_freq(hba, clki->clk); in ufshcd_init_clocks()
7383 if (clki->max_freq) { in ufshcd_init_clocks()
7384 ret = clk_set_rate(clki->clk, clki->max_freq); in ufshcd_init_clocks()
7387 __func__, clki->name, in ufshcd_init_clocks()
7388 clki->max_freq, ret); in ufshcd_init_clocks()
7391 clki->curr_freq = clki->max_freq; in ufshcd_init_clocks()
7394 clki->name, clk_get_rate(clki->clk)); in ufshcd_init_clocks()