Lines Matching refs:clk_info
578 struct cnss_clk_info *clk_info) in cnss_get_clk_single() argument
584 clk = devm_clk_get(dev, clk_info->cfg.name); in cnss_get_clk_single()
587 if (clk_info->cfg.required) in cnss_get_clk_single()
589 clk_info->cfg.name, ret); in cnss_get_clk_single()
592 clk_info->cfg.name, ret); in cnss_get_clk_single()
596 clk_info->clk = clk; in cnss_get_clk_single()
598 clk_info->cfg.name, clk_info->cfg.freq); in cnss_get_clk_single()
604 struct cnss_clk_info *clk_info) in cnss_put_clk_single() argument
608 cnss_pr_dbg("Put clock: %s\n", clk_info->cfg.name); in cnss_put_clk_single()
609 devm_clk_put(dev, clk_info->clk); in cnss_put_clk_single()
612 static int cnss_clk_on_single(struct cnss_clk_info *clk_info) in cnss_clk_on_single() argument
616 if (clk_info->enabled) { in cnss_clk_on_single()
618 clk_info->cfg.name); in cnss_clk_on_single()
622 cnss_pr_dbg("Clock %s is being enabled\n", clk_info->cfg.name); in cnss_clk_on_single()
624 if (clk_info->cfg.freq) { in cnss_clk_on_single()
625 ret = clk_set_rate(clk_info->clk, clk_info->cfg.freq); in cnss_clk_on_single()
628 clk_info->cfg.freq, clk_info->cfg.name, in cnss_clk_on_single()
634 ret = clk_prepare_enable(clk_info->clk); in cnss_clk_on_single()
637 clk_info->cfg.name, ret); in cnss_clk_on_single()
641 clk_info->enabled = true; in cnss_clk_on_single()
646 static int cnss_clk_off_single(struct cnss_clk_info *clk_info) in cnss_clk_off_single() argument
648 if (!clk_info->enabled) { in cnss_clk_off_single()
650 clk_info->cfg.name); in cnss_clk_off_single()
654 cnss_pr_dbg("Clock %s is being disabled\n", clk_info->cfg.name); in cnss_clk_off_single()
656 clk_disable_unprepare(clk_info->clk); in cnss_clk_off_single()
657 clk_info->enabled = false; in cnss_clk_off_single()
666 struct cnss_clk_info *clk_info; in cnss_get_clk() local
681 clk_info = devm_kzalloc(dev, sizeof(*clk_info), GFP_KERNEL); in cnss_get_clk()
682 if (!clk_info) { in cnss_get_clk()
687 memcpy(&clk_info->cfg, &cnss_clk_list[i], in cnss_get_clk()
688 sizeof(clk_info->cfg)); in cnss_get_clk()
689 ret = cnss_get_clk_single(plat_priv, clk_info); in cnss_get_clk()
691 if (clk_info->cfg.required) { in cnss_get_clk()
692 devm_kfree(dev, clk_info); in cnss_get_clk()
695 devm_kfree(dev, clk_info); in cnss_get_clk()
699 list_add_tail(&clk_info->list, clk_list); in cnss_get_clk()
706 clk_info = list_first_entry(clk_list, struct cnss_clk_info, in cnss_get_clk()
708 list_del(&clk_info->list); in cnss_get_clk()
709 if (IS_ERR_OR_NULL(clk_info->clk)) in cnss_get_clk()
711 cnss_put_clk_single(plat_priv, clk_info); in cnss_get_clk()
712 devm_kfree(dev, clk_info); in cnss_get_clk()
722 struct cnss_clk_info *clk_info; in cnss_put_clk() local
731 clk_info = list_first_entry(clk_list, struct cnss_clk_info, in cnss_put_clk()
733 list_del(&clk_info->list); in cnss_put_clk()
734 if (IS_ERR_OR_NULL(clk_info->clk)) in cnss_put_clk()
736 cnss_put_clk_single(plat_priv, clk_info); in cnss_put_clk()
737 devm_kfree(dev, clk_info); in cnss_put_clk()
744 struct cnss_clk_info *clk_info; in cnss_clk_on() local
747 list_for_each_entry(clk_info, clk_list, list) { in cnss_clk_on()
748 if (IS_ERR_OR_NULL(clk_info->clk)) in cnss_clk_on()
750 ret = cnss_clk_on_single(clk_info); in cnss_clk_on()
758 list_for_each_entry_continue_reverse(clk_info, clk_list, list) { in cnss_clk_on()
759 if (IS_ERR_OR_NULL(clk_info->clk)) in cnss_clk_on()
762 cnss_clk_off_single(clk_info); in cnss_clk_on()
771 struct cnss_clk_info *clk_info; in cnss_clk_off() local
773 list_for_each_entry_reverse(clk_info, clk_list, list) { in cnss_clk_off()
774 if (IS_ERR_OR_NULL(clk_info->clk)) in cnss_clk_off()
777 cnss_clk_off_single(clk_info); in cnss_clk_off()