Lines Matching refs:clk

27 static struct clk cpu_clk_generic[4];
38 struct clk *clk_get_cpu(void) in clk_get_cpu()
43 struct clk *clk_get_fpi(void) in clk_get_fpi()
49 struct clk *clk_get_io(void) in clk_get_io()
54 struct clk *clk_get_ppe(void) in clk_get_ppe()
60 static inline int clk_good(struct clk *clk) in clk_good() argument
62 return clk && !IS_ERR(clk); in clk_good()
65 unsigned long clk_get_rate(struct clk *clk) in clk_get_rate() argument
67 if (unlikely(!clk_good(clk))) in clk_get_rate()
70 if (clk->rate != 0) in clk_get_rate()
71 return clk->rate; in clk_get_rate()
73 if (clk->get_rate != NULL) in clk_get_rate()
74 return clk->get_rate(); in clk_get_rate()
80 int clk_set_rate(struct clk *clk, unsigned long rate) in clk_set_rate() argument
82 if (unlikely(!clk_good(clk))) in clk_set_rate()
84 if (clk->rates && *clk->rates) { in clk_set_rate()
85 unsigned long *r = clk->rates; in clk_set_rate()
91 clk->cl.dev_id, clk->cl.con_id, rate); in clk_set_rate()
95 clk->rate = rate; in clk_set_rate()
100 long clk_round_rate(struct clk *clk, unsigned long rate) in clk_round_rate() argument
102 if (unlikely(!clk_good(clk))) in clk_round_rate()
104 if (clk->rates && *clk->rates) { in clk_round_rate()
105 unsigned long *r = clk->rates; in clk_round_rate()
110 return clk->rate; in clk_round_rate()
117 int clk_enable(struct clk *clk) in clk_enable() argument
119 if (unlikely(!clk_good(clk))) in clk_enable()
122 if (clk->enable) in clk_enable()
123 return clk->enable(clk); in clk_enable()
129 void clk_disable(struct clk *clk) in clk_disable() argument
131 if (unlikely(!clk_good(clk))) in clk_disable()
134 if (clk->disable) in clk_disable()
135 clk->disable(clk); in clk_disable()
139 int clk_activate(struct clk *clk) in clk_activate() argument
141 if (unlikely(!clk_good(clk))) in clk_activate()
144 if (clk->activate) in clk_activate()
145 return clk->activate(clk); in clk_activate()
151 void clk_deactivate(struct clk *clk) in clk_deactivate() argument
153 if (unlikely(!clk_good(clk))) in clk_deactivate()
156 if (clk->deactivate) in clk_deactivate()
157 clk->deactivate(clk); in clk_deactivate()
161 struct clk *clk_get_parent(struct clk *clk) in clk_get_parent() argument
185 struct clk *clk; in plat_time_init() local
189 clk = clk_get_cpu(); in plat_time_init()
190 mips_hpt_frequency = clk_get_rate(clk) / get_counter_resolution(); in plat_time_init()
192 pr_info("CPU Clock: %ldMHz\n", clk_get_rate(clk) / 1000000); in plat_time_init()
193 clk_put(clk); in plat_time_init()