Lines Matching refs:clki
434 struct ufs_clk_info *clki; in ufshcd_print_clk_freqs() local
440 list_for_each_entry(clki, head, list) { in ufshcd_print_clk_freqs()
441 if (!IS_ERR_OR_NULL(clki->clk) && clki->min_freq && in ufshcd_print_clk_freqs()
442 clki->max_freq) in ufshcd_print_clk_freqs()
444 clki->name, clki->curr_freq); in ufshcd_print_clk_freqs()
983 struct ufs_clk_info *clki; in ufshcd_set_clk_freq() local
989 list_for_each_entry(clki, head, list) { in ufshcd_set_clk_freq()
990 if (!IS_ERR_OR_NULL(clki->clk)) { in ufshcd_set_clk_freq()
991 if (scale_up && clki->max_freq) { in ufshcd_set_clk_freq()
992 if (clki->curr_freq == clki->max_freq) in ufshcd_set_clk_freq()
995 ret = clk_set_rate(clki->clk, clki->max_freq); in ufshcd_set_clk_freq()
998 __func__, clki->name, in ufshcd_set_clk_freq()
999 clki->max_freq, ret); in ufshcd_set_clk_freq()
1003 "scaled up", clki->name, in ufshcd_set_clk_freq()
1004 clki->curr_freq, in ufshcd_set_clk_freq()
1005 clki->max_freq); in ufshcd_set_clk_freq()
1007 clki->curr_freq = clki->max_freq; in ufshcd_set_clk_freq()
1009 } else if (!scale_up && clki->min_freq) { in ufshcd_set_clk_freq()
1010 if (clki->curr_freq == clki->min_freq) in ufshcd_set_clk_freq()
1013 ret = clk_set_rate(clki->clk, clki->min_freq); in ufshcd_set_clk_freq()
1016 __func__, clki->name, in ufshcd_set_clk_freq()
1017 clki->min_freq, ret); in ufshcd_set_clk_freq()
1021 "scaled down", clki->name, in ufshcd_set_clk_freq()
1022 clki->curr_freq, in ufshcd_set_clk_freq()
1023 clki->min_freq); in ufshcd_set_clk_freq()
1024 clki->curr_freq = clki->min_freq; in ufshcd_set_clk_freq()
1028 clki->name, clk_get_rate(clki->clk)); in ufshcd_set_clk_freq()
1077 struct ufs_clk_info *clki; in ufshcd_is_devfreq_scaling_required() local
1083 list_for_each_entry(clki, head, list) { in ufshcd_is_devfreq_scaling_required()
1084 if (!IS_ERR_OR_NULL(clki->clk)) { in ufshcd_is_devfreq_scaling_required()
1085 if (scale_up && clki->max_freq) { in ufshcd_is_devfreq_scaling_required()
1086 if (clki->curr_freq == clki->max_freq) in ufshcd_is_devfreq_scaling_required()
1089 } else if (!scale_up && clki->min_freq) { in ufshcd_is_devfreq_scaling_required()
1090 if (clki->curr_freq == clki->min_freq) in ufshcd_is_devfreq_scaling_required()
1339 struct ufs_clk_info *clki; in ufshcd_devfreq_target() local
1347 clki = list_first_entry(&hba->clk_list_head, struct ufs_clk_info, list); in ufshcd_devfreq_target()
1349 *freq = (unsigned long) clk_round_rate(clki->clk, *freq); in ufshcd_devfreq_target()
1365 scale_up = (*freq == clki->max_freq) ? true : false; in ufshcd_devfreq_target()
1367 *freq = clki->min_freq; in ufshcd_devfreq_target()
1420 struct ufs_clk_info *clki; in ufshcd_devfreq_get_dev_status() local
1434 clki = list_first_entry(clk_list, struct ufs_clk_info, list); in ufshcd_devfreq_get_dev_status()
1440 stat->current_frequency = clki->curr_freq; in ufshcd_devfreq_get_dev_status()
1468 struct ufs_clk_info *clki; in ufshcd_devfreq_init() local
1476 clki = list_first_entry(clk_list, struct ufs_clk_info, list); in ufshcd_devfreq_init()
1477 dev_pm_opp_add(hba->dev, clki->min_freq, 0); in ufshcd_devfreq_init()
1478 dev_pm_opp_add(hba->dev, clki->max_freq, 0); in ufshcd_devfreq_init()
1490 dev_pm_opp_remove(hba->dev, clki->min_freq); in ufshcd_devfreq_init()
1491 dev_pm_opp_remove(hba->dev, clki->max_freq); in ufshcd_devfreq_init()
1503 struct ufs_clk_info *clki; in ufshcd_devfreq_remove() local
1511 clki = list_first_entry(clk_list, struct ufs_clk_info, list); in ufshcd_devfreq_remove()
1512 dev_pm_opp_remove(hba->dev, clki->min_freq); in ufshcd_devfreq_remove()
1513 dev_pm_opp_remove(hba->dev, clki->max_freq); in ufshcd_devfreq_remove()
8472 struct ufs_clk_info *clki; in ufshcd_setup_clocks() local
8485 list_for_each_entry(clki, head, list) { in ufshcd_setup_clocks()
8486 if (!IS_ERR_OR_NULL(clki->clk)) { in ufshcd_setup_clocks()
8492 clki->keep_link_active) in ufshcd_setup_clocks()
8495 clk_state_changed = on ^ clki->enabled; in ufshcd_setup_clocks()
8496 if (on && !clki->enabled) { in ufshcd_setup_clocks()
8497 ret = clk_prepare_enable(clki->clk); in ufshcd_setup_clocks()
8500 __func__, clki->name, ret); in ufshcd_setup_clocks()
8503 } else if (!on && clki->enabled) { in ufshcd_setup_clocks()
8504 clk_disable_unprepare(clki->clk); in ufshcd_setup_clocks()
8506 clki->enabled = on; in ufshcd_setup_clocks()
8508 clki->name, on ? "en" : "dis"); in ufshcd_setup_clocks()
8518 list_for_each_entry(clki, head, list) { in ufshcd_setup_clocks()
8519 if (!IS_ERR_OR_NULL(clki->clk) && clki->enabled) in ufshcd_setup_clocks()
8520 clk_disable_unprepare(clki->clk); in ufshcd_setup_clocks()
8540 struct ufs_clk_info *clki; in ufshcd_init_clocks() local
8547 list_for_each_entry(clki, head, list) { in ufshcd_init_clocks()
8548 if (!clki->name) in ufshcd_init_clocks()
8551 clki->clk = devm_clk_get(dev, clki->name); in ufshcd_init_clocks()
8552 if (IS_ERR(clki->clk)) { in ufshcd_init_clocks()
8553 ret = PTR_ERR(clki->clk); in ufshcd_init_clocks()
8555 __func__, clki->name, ret); in ufshcd_init_clocks()
8564 if (!strcmp(clki->name, "ref_clk")) in ufshcd_init_clocks()
8565 ufshcd_parse_dev_ref_clk_freq(hba, clki->clk); in ufshcd_init_clocks()
8567 if (clki->max_freq) { in ufshcd_init_clocks()
8568 ret = clk_set_rate(clki->clk, clki->max_freq); in ufshcd_init_clocks()
8571 __func__, clki->name, in ufshcd_init_clocks()
8572 clki->max_freq, ret); in ufshcd_init_clocks()
8575 clki->curr_freq = clki->max_freq; in ufshcd_init_clocks()
8578 clki->name, clk_get_rate(clki->clk)); in ufshcd_init_clocks()