Lines Matching refs:cpuclk

145 			struct exynos_cpuclk *cpuclk, void __iomem *base)  in exynos_cpuclk_pre_rate_change()  argument
147 const struct exynos_cpuclk_cfg_data *cfg_data = cpuclk->cfg; in exynos_cpuclk_pre_rate_change()
148 unsigned long alt_prate = clk_get_rate(cpuclk->alt_parent); in exynos_cpuclk_pre_rate_change()
160 spin_lock_irqsave(cpuclk->lock, flags); in exynos_cpuclk_pre_rate_change()
168 if (cpuclk->flags & CLK_CPU_HAS_DIV1) { in exynos_cpuclk_pre_rate_change()
189 if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) { in exynos_cpuclk_pre_rate_change()
210 if (cpuclk->flags & CLK_CPU_HAS_DIV1) { in exynos_cpuclk_pre_rate_change()
216 spin_unlock_irqrestore(cpuclk->lock, flags); in exynos_cpuclk_pre_rate_change()
222 struct exynos_cpuclk *cpuclk, void __iomem *base) in exynos_cpuclk_post_rate_change() argument
224 const struct exynos_cpuclk_cfg_data *cfg_data = cpuclk->cfg; in exynos_cpuclk_post_rate_change()
230 if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) { in exynos_cpuclk_post_rate_change()
238 spin_lock_irqsave(cpuclk->lock, flags); in exynos_cpuclk_post_rate_change()
245 if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) { in exynos_cpuclk_post_rate_change()
251 spin_unlock_irqrestore(cpuclk->lock, flags); in exynos_cpuclk_post_rate_change()
263 struct exynos_cpuclk *cpuclk; in exynos_cpuclk_notifier_cb() local
267 cpuclk = container_of(nb, struct exynos_cpuclk, clk_nb); in exynos_cpuclk_notifier_cb()
268 base = cpuclk->ctrl_base; in exynos_cpuclk_notifier_cb()
271 err = exynos_cpuclk_pre_rate_change(ndata, cpuclk, base); in exynos_cpuclk_notifier_cb()
273 err = exynos_cpuclk_post_rate_change(ndata, cpuclk, base); in exynos_cpuclk_notifier_cb()
285 struct exynos_cpuclk *cpuclk; in exynos_register_cpu_clock() local
290 cpuclk = kzalloc(sizeof(*cpuclk), GFP_KERNEL); in exynos_register_cpu_clock()
291 if (!cpuclk) in exynos_register_cpu_clock()
300 cpuclk->hw.init = &init; in exynos_register_cpu_clock()
301 cpuclk->ctrl_base = ctx->reg_base + offset; in exynos_register_cpu_clock()
302 cpuclk->lock = &ctx->lock; in exynos_register_cpu_clock()
303 cpuclk->flags = flags; in exynos_register_cpu_clock()
304 cpuclk->clk_nb.notifier_call = exynos_cpuclk_notifier_cb; in exynos_register_cpu_clock()
306 cpuclk->alt_parent = __clk_lookup(alt_parent); in exynos_register_cpu_clock()
307 if (!cpuclk->alt_parent) { in exynos_register_cpu_clock()
322 ret = clk_notifier_register(clk, &cpuclk->clk_nb); in exynos_register_cpu_clock()
329 cpuclk->cfg = kmemdup(cfg, sizeof(*cfg) * num_cfgs, GFP_KERNEL); in exynos_register_cpu_clock()
330 if (!cpuclk->cfg) { in exynos_register_cpu_clock()
337 clk = clk_register(NULL, &cpuclk->hw); in exynos_register_cpu_clock()
348 kfree(cpuclk->cfg); in exynos_register_cpu_clock()
350 clk_notifier_unregister(__clk_lookup(parent), &cpuclk->clk_nb); in exynos_register_cpu_clock()
352 kfree(cpuclk); in exynos_register_cpu_clock()