Lines Matching refs:of_clk
85 static __init void timer_of_clk_exit(struct of_timer_clk *of_clk) in timer_of_clk_exit() argument
87 of_clk->rate = 0; in timer_of_clk_exit()
88 clk_disable_unprepare(of_clk->clk); in timer_of_clk_exit()
89 clk_put(of_clk->clk); in timer_of_clk_exit()
102 struct of_timer_clk *of_clk) in timer_of_clk_init() argument
106 of_clk->clk = of_clk->name ? of_clk_get_by_name(np, of_clk->name) : in timer_of_clk_init()
107 of_clk_get(np, of_clk->index); in timer_of_clk_init()
108 if (IS_ERR(of_clk->clk)) { in timer_of_clk_init()
109 ret = PTR_ERR(of_clk->clk); in timer_of_clk_init()
115 ret = clk_prepare_enable(of_clk->clk); in timer_of_clk_init()
121 of_clk->rate = clk_get_rate(of_clk->clk); in timer_of_clk_init()
122 if (!of_clk->rate) { in timer_of_clk_init()
128 of_clk->period = DIV_ROUND_UP(of_clk->rate, HZ); in timer_of_clk_init()
133 clk_disable_unprepare(of_clk->clk); in timer_of_clk_init()
135 clk_put(of_clk->clk); in timer_of_clk_init()
172 ret = timer_of_clk_init(np, &to->of_clk); in timer_of_init()
197 timer_of_clk_exit(&to->of_clk); in timer_of_init()
217 timer_of_clk_exit(&to->of_clk); in timer_of_cleanup()