Lines Matching refs:clk_info

440 			 struct icnss_clk_info *clk_info)  in icnss_get_clk_single()  argument
446 clk = devm_clk_get(dev, clk_info->cfg.name); in icnss_get_clk_single()
449 if (clk_info->cfg.required) in icnss_get_clk_single()
451 clk_info->cfg.name, ret); in icnss_get_clk_single()
454 clk_info->cfg.name, ret); in icnss_get_clk_single()
458 clk_info->clk = clk; in icnss_get_clk_single()
460 clk_info->cfg.name, clk_info->cfg.freq); in icnss_get_clk_single()
465 static int icnss_clk_on_single(struct icnss_clk_info *clk_info) in icnss_clk_on_single() argument
469 if (clk_info->enabled) { in icnss_clk_on_single()
471 clk_info->cfg.name); in icnss_clk_on_single()
475 icnss_pr_dbg("Clock %s is being enabled\n", clk_info->cfg.name); in icnss_clk_on_single()
477 if (clk_info->cfg.freq) { in icnss_clk_on_single()
478 ret = clk_set_rate(clk_info->clk, clk_info->cfg.freq); in icnss_clk_on_single()
481 clk_info->cfg.freq, clk_info->cfg.name, in icnss_clk_on_single()
487 ret = clk_prepare_enable(clk_info->clk); in icnss_clk_on_single()
490 clk_info->cfg.name, ret); in icnss_clk_on_single()
494 clk_info->enabled = true; in icnss_clk_on_single()
499 static int icnss_clk_off_single(struct icnss_clk_info *clk_info) in icnss_clk_off_single() argument
501 if (!clk_info->enabled) { in icnss_clk_off_single()
503 clk_info->cfg.name); in icnss_clk_off_single()
507 icnss_pr_dbg("Clock %s is being disabled\n", clk_info->cfg.name); in icnss_clk_off_single()
509 clk_disable_unprepare(clk_info->clk); in icnss_clk_off_single()
510 clk_info->enabled = false; in icnss_clk_off_single()
519 struct icnss_clk_info *clk_info; in icnss_get_clk() local
545 clk_info = devm_kzalloc(dev, sizeof(*clk_info), GFP_KERNEL); in icnss_get_clk()
546 if (!clk_info) { in icnss_get_clk()
551 memcpy(&clk_info->cfg, &clk_cfg[i], in icnss_get_clk()
552 sizeof(clk_info->cfg)); in icnss_get_clk()
553 ret = icnss_get_clk_single(priv, clk_info); in icnss_get_clk()
555 if (clk_info->cfg.required) in icnss_get_clk()
560 list_add_tail(&clk_info->list, clk_list); in icnss_get_clk()
567 clk_info = list_first_entry(clk_list, struct icnss_clk_info, in icnss_get_clk()
569 list_del(&clk_info->list); in icnss_get_clk()
579 struct icnss_clk_info *clk_info; in icnss_put_clk() local
588 clk_info = list_first_entry(clk_list, struct icnss_clk_info, in icnss_put_clk()
590 list_del(&clk_info->list); in icnss_put_clk()
596 struct icnss_clk_info *clk_info; in icnss_clk_on() local
599 list_for_each_entry(clk_info, clk_list, list) { in icnss_clk_on()
600 if (IS_ERR_OR_NULL(clk_info->clk)) in icnss_clk_on()
602 ret = icnss_clk_on_single(clk_info); in icnss_clk_on()
610 list_for_each_entry_continue_reverse(clk_info, clk_list, list) { in icnss_clk_on()
611 if (IS_ERR_OR_NULL(clk_info->clk)) in icnss_clk_on()
614 icnss_clk_off_single(clk_info); in icnss_clk_on()
622 struct icnss_clk_info *clk_info; in icnss_clk_off() local
624 list_for_each_entry_reverse(clk_info, clk_list, list) { in icnss_clk_off()
625 if (IS_ERR_OR_NULL(clk_info->clk)) in icnss_clk_off()
628 icnss_clk_off_single(clk_info); in icnss_clk_off()