Lines Matching refs:clki
430 struct ufs_clk_info *clki; in ufshcd_print_clk_freqs() local
436 list_for_each_entry(clki, head, list) { in ufshcd_print_clk_freqs()
437 if (!IS_ERR_OR_NULL(clki->clk) && clki->min_freq && in ufshcd_print_clk_freqs()
438 clki->max_freq) in ufshcd_print_clk_freqs()
440 clki->name, clki->curr_freq); in ufshcd_print_clk_freqs()
985 struct ufs_clk_info *clki; in ufshcd_set_clk_freq() local
991 list_for_each_entry(clki, head, list) { in ufshcd_set_clk_freq()
992 if (!IS_ERR_OR_NULL(clki->clk)) { in ufshcd_set_clk_freq()
993 if (scale_up && clki->max_freq) { in ufshcd_set_clk_freq()
994 if (clki->curr_freq == clki->max_freq) in ufshcd_set_clk_freq()
997 ret = clk_set_rate(clki->clk, clki->max_freq); in ufshcd_set_clk_freq()
1000 __func__, clki->name, in ufshcd_set_clk_freq()
1001 clki->max_freq, ret); in ufshcd_set_clk_freq()
1005 "scaled up", clki->name, in ufshcd_set_clk_freq()
1006 clki->curr_freq, in ufshcd_set_clk_freq()
1007 clki->max_freq); in ufshcd_set_clk_freq()
1009 clki->curr_freq = clki->max_freq; in ufshcd_set_clk_freq()
1011 } else if (!scale_up && clki->min_freq) { in ufshcd_set_clk_freq()
1012 if (clki->curr_freq == clki->min_freq) in ufshcd_set_clk_freq()
1015 ret = clk_set_rate(clki->clk, clki->min_freq); in ufshcd_set_clk_freq()
1018 __func__, clki->name, in ufshcd_set_clk_freq()
1019 clki->min_freq, ret); in ufshcd_set_clk_freq()
1023 "scaled down", clki->name, in ufshcd_set_clk_freq()
1024 clki->curr_freq, in ufshcd_set_clk_freq()
1025 clki->min_freq); in ufshcd_set_clk_freq()
1026 clki->curr_freq = clki->min_freq; in ufshcd_set_clk_freq()
1030 clki->name, clk_get_rate(clki->clk)); in ufshcd_set_clk_freq()
1079 struct ufs_clk_info *clki; in ufshcd_is_devfreq_scaling_required() local
1085 list_for_each_entry(clki, head, list) { in ufshcd_is_devfreq_scaling_required()
1086 if (!IS_ERR_OR_NULL(clki->clk)) { in ufshcd_is_devfreq_scaling_required()
1087 if (scale_up && clki->max_freq) { in ufshcd_is_devfreq_scaling_required()
1088 if (clki->curr_freq == clki->max_freq) in ufshcd_is_devfreq_scaling_required()
1091 } else if (!scale_up && clki->min_freq) { in ufshcd_is_devfreq_scaling_required()
1092 if (clki->curr_freq == clki->min_freq) in ufshcd_is_devfreq_scaling_required()
1354 struct ufs_clk_info *clki; in ufshcd_devfreq_target() local
1360 clki = list_first_entry(&hba->clk_list_head, struct ufs_clk_info, list); in ufshcd_devfreq_target()
1362 *freq = (unsigned long) clk_round_rate(clki->clk, *freq); in ufshcd_devfreq_target()
1378 scale_up = *freq == clki->max_freq; in ufshcd_devfreq_target()
1380 *freq = clki->min_freq; in ufshcd_devfreq_target()
1411 struct ufs_clk_info *clki; in ufshcd_devfreq_get_dev_status() local
1424 clki = list_first_entry(clk_list, struct ufs_clk_info, list); in ufshcd_devfreq_get_dev_status()
1430 stat->current_frequency = clki->curr_freq; in ufshcd_devfreq_get_dev_status()
1455 struct ufs_clk_info *clki; in ufshcd_devfreq_init() local
1463 clki = list_first_entry(clk_list, struct ufs_clk_info, list); in ufshcd_devfreq_init()
1464 dev_pm_opp_add(hba->dev, clki->min_freq, 0); in ufshcd_devfreq_init()
1465 dev_pm_opp_add(hba->dev, clki->max_freq, 0); in ufshcd_devfreq_init()
1477 dev_pm_opp_remove(hba->dev, clki->min_freq); in ufshcd_devfreq_init()
1478 dev_pm_opp_remove(hba->dev, clki->max_freq); in ufshcd_devfreq_init()
1490 struct ufs_clk_info *clki; in ufshcd_devfreq_remove() local
1498 clki = list_first_entry(clk_list, struct ufs_clk_info, list); in ufshcd_devfreq_remove()
1499 dev_pm_opp_remove(hba->dev, clki->min_freq); in ufshcd_devfreq_remove()
1500 dev_pm_opp_remove(hba->dev, clki->max_freq); in ufshcd_devfreq_remove()
8543 struct ufs_clk_info *clki; in ufshcd_setup_clocks() local
8556 list_for_each_entry(clki, head, list) { in ufshcd_setup_clocks()
8557 if (!IS_ERR_OR_NULL(clki->clk)) { in ufshcd_setup_clocks()
8563 clki->keep_link_active) in ufshcd_setup_clocks()
8566 clk_state_changed = on ^ clki->enabled; in ufshcd_setup_clocks()
8567 if (on && !clki->enabled) { in ufshcd_setup_clocks()
8568 ret = clk_prepare_enable(clki->clk); in ufshcd_setup_clocks()
8571 __func__, clki->name, ret); in ufshcd_setup_clocks()
8574 } else if (!on && clki->enabled) { in ufshcd_setup_clocks()
8575 clk_disable_unprepare(clki->clk); in ufshcd_setup_clocks()
8577 clki->enabled = on; in ufshcd_setup_clocks()
8579 clki->name, on ? "en" : "dis"); in ufshcd_setup_clocks()
8589 list_for_each_entry(clki, head, list) { in ufshcd_setup_clocks()
8590 if (!IS_ERR_OR_NULL(clki->clk) && clki->enabled) in ufshcd_setup_clocks()
8591 clk_disable_unprepare(clki->clk); in ufshcd_setup_clocks()
8624 struct ufs_clk_info *clki; in ufshcd_init_clocks() local
8631 list_for_each_entry(clki, head, list) { in ufshcd_init_clocks()
8632 if (!clki->name) in ufshcd_init_clocks()
8635 clki->clk = devm_clk_get(dev, clki->name); in ufshcd_init_clocks()
8636 if (IS_ERR(clki->clk)) { in ufshcd_init_clocks()
8637 ret = PTR_ERR(clki->clk); in ufshcd_init_clocks()
8639 __func__, clki->name, ret); in ufshcd_init_clocks()
8648 if (!strcmp(clki->name, "ref_clk")) in ufshcd_init_clocks()
8649 ufshcd_parse_dev_ref_clk_freq(hba, clki->clk); in ufshcd_init_clocks()
8651 if (clki->max_freq) { in ufshcd_init_clocks()
8652 ret = clk_set_rate(clki->clk, clki->max_freq); in ufshcd_init_clocks()
8655 __func__, clki->name, in ufshcd_init_clocks()
8656 clki->max_freq, ret); in ufshcd_init_clocks()
8659 clki->curr_freq = clki->max_freq; in ufshcd_init_clocks()
8662 clki->name, clk_get_rate(clki->clk)); in ufshcd_init_clocks()