Lines Matching refs:clki

488 	struct ufs_clk_info *clki;  in ufshcd_print_clk_freqs()  local
494 list_for_each_entry(clki, head, list) { in ufshcd_print_clk_freqs()
495 if (!IS_ERR_OR_NULL(clki->clk) && clki->min_freq && in ufshcd_print_clk_freqs()
496 clki->max_freq) in ufshcd_print_clk_freqs()
498 clki->name, clki->curr_freq); in ufshcd_print_clk_freqs()
1063 struct ufs_clk_info *clki; in ufshcd_set_clk_freq() local
1069 list_for_each_entry(clki, head, list) { in ufshcd_set_clk_freq()
1070 if (!IS_ERR_OR_NULL(clki->clk)) { in ufshcd_set_clk_freq()
1071 if (scale_up && clki->max_freq) { in ufshcd_set_clk_freq()
1072 if (clki->curr_freq == clki->max_freq) in ufshcd_set_clk_freq()
1075 ret = clk_set_rate(clki->clk, clki->max_freq); in ufshcd_set_clk_freq()
1078 __func__, clki->name, in ufshcd_set_clk_freq()
1079 clki->max_freq, ret); in ufshcd_set_clk_freq()
1083 "scaled up", clki->name, in ufshcd_set_clk_freq()
1084 clki->curr_freq, in ufshcd_set_clk_freq()
1085 clki->max_freq); in ufshcd_set_clk_freq()
1087 clki->curr_freq = clki->max_freq; in ufshcd_set_clk_freq()
1089 } else if (!scale_up && clki->min_freq) { in ufshcd_set_clk_freq()
1090 if (clki->curr_freq == clki->min_freq) in ufshcd_set_clk_freq()
1093 ret = clk_set_rate(clki->clk, clki->min_freq); in ufshcd_set_clk_freq()
1096 __func__, clki->name, in ufshcd_set_clk_freq()
1097 clki->min_freq, ret); in ufshcd_set_clk_freq()
1101 "scaled down", clki->name, in ufshcd_set_clk_freq()
1102 clki->curr_freq, in ufshcd_set_clk_freq()
1103 clki->min_freq); in ufshcd_set_clk_freq()
1104 clki->curr_freq = clki->min_freq; in ufshcd_set_clk_freq()
1108 clki->name, clk_get_rate(clki->clk)); in ufshcd_set_clk_freq()
1121 struct ufs_clk_info *clki; in ufshcd_opp_config_clks() local
1126 list_for_each_entry(clki, head, list) { in ufshcd_opp_config_clks()
1127 if (!IS_ERR_OR_NULL(clki->clk)) { in ufshcd_opp_config_clks()
1134 ret = clk_set_rate(clki->clk, freq); in ufshcd_opp_config_clks()
1137 __func__, clki->name, freq, ret); in ufshcd_opp_config_clks()
1143 clki->name, hba->clk_scaling.target_freq, freq); in ufshcd_opp_config_clks()
1222 struct ufs_clk_info *clki; in ufshcd_is_devfreq_scaling_required() local
1231 list_for_each_entry(clki, head, list) { in ufshcd_is_devfreq_scaling_required()
1232 if (!IS_ERR_OR_NULL(clki->clk)) { in ufshcd_is_devfreq_scaling_required()
1233 if (scale_up && clki->max_freq) { in ufshcd_is_devfreq_scaling_required()
1234 if (clki->curr_freq == clki->max_freq) in ufshcd_is_devfreq_scaling_required()
1237 } else if (!scale_up && clki->min_freq) { in ufshcd_is_devfreq_scaling_required()
1238 if (clki->curr_freq == clki->min_freq) in ufshcd_is_devfreq_scaling_required()
1513 struct ufs_clk_info *clki; in ufshcd_devfreq_target() local
1530 clki = list_first_entry(&hba->clk_list_head, struct ufs_clk_info, in ufshcd_devfreq_target()
1532 *freq = (unsigned long) clk_round_rate(clki->clk, *freq); in ufshcd_devfreq_target()
1560 scale_up = *freq == clki->max_freq; in ufshcd_devfreq_target()
1563 *freq = clki->min_freq; in ufshcd_devfreq_target()
1618 struct ufs_clk_info *clki; in ufshcd_devfreq_get_dev_status() local
1620 clki = list_first_entry(clk_list, struct ufs_clk_info, list); in ufshcd_devfreq_get_dev_status()
1621 stat->current_frequency = clki->curr_freq; in ufshcd_devfreq_get_dev_status()
1647 struct ufs_clk_info *clki; in ufshcd_devfreq_init() local
1656 clki = list_first_entry(clk_list, struct ufs_clk_info, list); in ufshcd_devfreq_init()
1657 dev_pm_opp_add(hba->dev, clki->min_freq, 0); in ufshcd_devfreq_init()
1658 dev_pm_opp_add(hba->dev, clki->max_freq, 0); in ufshcd_devfreq_init()
1672 dev_pm_opp_remove(hba->dev, clki->min_freq); in ufshcd_devfreq_init()
1673 dev_pm_opp_remove(hba->dev, clki->max_freq); in ufshcd_devfreq_init()
1694 struct ufs_clk_info *clki; in ufshcd_devfreq_remove() local
1696 clki = list_first_entry(clk_list, struct ufs_clk_info, list); in ufshcd_devfreq_remove()
1697 dev_pm_opp_remove(hba->dev, clki->min_freq); in ufshcd_devfreq_remove()
1698 dev_pm_opp_remove(hba->dev, clki->max_freq); in ufshcd_devfreq_remove()
9155 struct ufs_clk_info *clki; in ufshcd_setup_clocks() local
9168 list_for_each_entry(clki, head, list) { in ufshcd_setup_clocks()
9169 if (!IS_ERR_OR_NULL(clki->clk)) { in ufshcd_setup_clocks()
9175 clki->keep_link_active) in ufshcd_setup_clocks()
9178 clk_state_changed = on ^ clki->enabled; in ufshcd_setup_clocks()
9179 if (on && !clki->enabled) { in ufshcd_setup_clocks()
9180 ret = clk_prepare_enable(clki->clk); in ufshcd_setup_clocks()
9183 __func__, clki->name, ret); in ufshcd_setup_clocks()
9186 } else if (!on && clki->enabled) { in ufshcd_setup_clocks()
9187 clk_disable_unprepare(clki->clk); in ufshcd_setup_clocks()
9189 clki->enabled = on; in ufshcd_setup_clocks()
9191 clki->name, on ? "en" : "dis"); in ufshcd_setup_clocks()
9203 list_for_each_entry(clki, head, list) { in ufshcd_setup_clocks()
9204 if (!IS_ERR_OR_NULL(clki->clk) && clki->enabled) in ufshcd_setup_clocks()
9205 clk_disable_unprepare(clki->clk); in ufshcd_setup_clocks()
9238 struct ufs_clk_info *clki; in ufshcd_init_clocks() local
9245 list_for_each_entry(clki, head, list) { in ufshcd_init_clocks()
9246 if (!clki->name) in ufshcd_init_clocks()
9249 clki->clk = devm_clk_get(dev, clki->name); in ufshcd_init_clocks()
9250 if (IS_ERR(clki->clk)) { in ufshcd_init_clocks()
9251 ret = PTR_ERR(clki->clk); in ufshcd_init_clocks()
9253 __func__, clki->name, ret); in ufshcd_init_clocks()
9262 if (!strcmp(clki->name, "ref_clk")) in ufshcd_init_clocks()
9263 ufshcd_parse_dev_ref_clk_freq(hba, clki->clk); in ufshcd_init_clocks()
9265 if (clki->max_freq) { in ufshcd_init_clocks()
9266 ret = clk_set_rate(clki->clk, clki->max_freq); in ufshcd_init_clocks()
9269 __func__, clki->name, in ufshcd_init_clocks()
9270 clki->max_freq, ret); in ufshcd_init_clocks()
9273 clki->curr_freq = clki->max_freq; in ufshcd_init_clocks()
9276 clki->name, clk_get_rate(clki->clk)); in ufshcd_init_clocks()