Lines Matching refs:of_clk
103 static __init void timer_of_clk_exit(struct of_timer_clk *of_clk) in timer_of_clk_exit() argument
105 of_clk->rate = 0; in timer_of_clk_exit()
106 clk_disable_unprepare(of_clk->clk); in timer_of_clk_exit()
107 clk_put(of_clk->clk); in timer_of_clk_exit()
120 struct of_timer_clk *of_clk) in timer_of_clk_init() argument
124 of_clk->clk = of_clk->name ? of_clk_get_by_name(np, of_clk->name) : in timer_of_clk_init()
125 of_clk_get(np, of_clk->index); in timer_of_clk_init()
126 if (IS_ERR(of_clk->clk)) { in timer_of_clk_init()
128 return PTR_ERR(of_clk->clk); in timer_of_clk_init()
131 ret = clk_prepare_enable(of_clk->clk); in timer_of_clk_init()
137 of_clk->rate = clk_get_rate(of_clk->clk); in timer_of_clk_init()
138 if (!of_clk->rate) { in timer_of_clk_init()
144 of_clk->period = DIV_ROUND_UP(of_clk->rate, HZ); in timer_of_clk_init()
149 clk_disable_unprepare(of_clk->clk); in timer_of_clk_init()
151 clk_put(of_clk->clk); in timer_of_clk_init()
188 ret = timer_of_clk_init(np, &to->of_clk); in timer_of_init()
213 timer_of_clk_exit(&to->of_clk); in timer_of_init()
233 timer_of_clk_exit(&to->of_clk); in timer_of_cleanup()