Lines Matching refs:cpuclk
152 struct exynos_cpuclk *cpuclk, void __iomem *base) in exynos_cpuclk_pre_rate_change() argument
154 const struct exynos_cpuclk_cfg_data *cfg_data = cpuclk->cfg; in exynos_cpuclk_pre_rate_change()
155 unsigned long alt_prate = clk_hw_get_rate(cpuclk->alt_parent); in exynos_cpuclk_pre_rate_change()
167 spin_lock_irqsave(cpuclk->lock, flags); in exynos_cpuclk_pre_rate_change()
175 if (cpuclk->flags & CLK_CPU_HAS_DIV1) { in exynos_cpuclk_pre_rate_change()
196 if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) { in exynos_cpuclk_pre_rate_change()
217 if (cpuclk->flags & CLK_CPU_HAS_DIV1) { in exynos_cpuclk_pre_rate_change()
223 spin_unlock_irqrestore(cpuclk->lock, flags); in exynos_cpuclk_pre_rate_change()
229 struct exynos_cpuclk *cpuclk, void __iomem *base) in exynos_cpuclk_post_rate_change() argument
231 const struct exynos_cpuclk_cfg_data *cfg_data = cpuclk->cfg; in exynos_cpuclk_post_rate_change()
237 if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) { in exynos_cpuclk_post_rate_change()
245 spin_lock_irqsave(cpuclk->lock, flags); in exynos_cpuclk_post_rate_change()
252 if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) { in exynos_cpuclk_post_rate_change()
258 spin_unlock_irqrestore(cpuclk->lock, flags); in exynos_cpuclk_post_rate_change()
280 struct exynos_cpuclk *cpuclk, void __iomem *base) in exynos5433_cpuclk_pre_rate_change() argument
282 const struct exynos_cpuclk_cfg_data *cfg_data = cpuclk->cfg; in exynos5433_cpuclk_pre_rate_change()
283 unsigned long alt_prate = clk_hw_get_rate(cpuclk->alt_parent); in exynos5433_cpuclk_pre_rate_change()
295 spin_lock_irqsave(cpuclk->lock, flags); in exynos5433_cpuclk_pre_rate_change()
334 spin_unlock_irqrestore(cpuclk->lock, flags); in exynos5433_cpuclk_pre_rate_change()
340 struct exynos_cpuclk *cpuclk, void __iomem *base) in exynos5433_cpuclk_post_rate_change() argument
346 spin_lock_irqsave(cpuclk->lock, flags); in exynos5433_cpuclk_post_rate_change()
354 spin_unlock_irqrestore(cpuclk->lock, flags); in exynos5433_cpuclk_post_rate_change()
366 struct exynos_cpuclk *cpuclk; in exynos_cpuclk_notifier_cb() local
370 cpuclk = container_of(nb, struct exynos_cpuclk, clk_nb); in exynos_cpuclk_notifier_cb()
371 base = cpuclk->ctrl_base; in exynos_cpuclk_notifier_cb()
374 err = exynos_cpuclk_pre_rate_change(ndata, cpuclk, base); in exynos_cpuclk_notifier_cb()
376 err = exynos_cpuclk_post_rate_change(ndata, cpuclk, base); in exynos_cpuclk_notifier_cb()
389 struct exynos_cpuclk *cpuclk; in exynos5433_cpuclk_notifier_cb() local
393 cpuclk = container_of(nb, struct exynos_cpuclk, clk_nb); in exynos5433_cpuclk_notifier_cb()
394 base = cpuclk->ctrl_base; in exynos5433_cpuclk_notifier_cb()
397 err = exynos5433_cpuclk_pre_rate_change(ndata, cpuclk, base); in exynos5433_cpuclk_notifier_cb()
399 err = exynos5433_cpuclk_post_rate_change(ndata, cpuclk, base); in exynos5433_cpuclk_notifier_cb()
411 struct exynos_cpuclk *cpuclk; in exynos_register_cpu_clock() local
416 cpuclk = kzalloc(sizeof(*cpuclk), GFP_KERNEL); in exynos_register_cpu_clock()
417 if (!cpuclk) in exynos_register_cpu_clock()
426 cpuclk->hw.init = &init; in exynos_register_cpu_clock()
427 cpuclk->ctrl_base = ctx->reg_base + offset; in exynos_register_cpu_clock()
428 cpuclk->lock = &ctx->lock; in exynos_register_cpu_clock()
429 cpuclk->flags = flags; in exynos_register_cpu_clock()
431 cpuclk->clk_nb.notifier_call = exynos5433_cpuclk_notifier_cb; in exynos_register_cpu_clock()
433 cpuclk->clk_nb.notifier_call = exynos_cpuclk_notifier_cb; in exynos_register_cpu_clock()
435 cpuclk->alt_parent = __clk_get_hw(__clk_lookup(alt_parent)); in exynos_register_cpu_clock()
436 if (!cpuclk->alt_parent) { in exynos_register_cpu_clock()
451 ret = clk_notifier_register(parent_clk, &cpuclk->clk_nb); in exynos_register_cpu_clock()
458 cpuclk->cfg = kmemdup(cfg, sizeof(*cfg) * num_cfgs, GFP_KERNEL); in exynos_register_cpu_clock()
459 if (!cpuclk->cfg) { in exynos_register_cpu_clock()
464 ret = clk_hw_register(NULL, &cpuclk->hw); in exynos_register_cpu_clock()
470 samsung_clk_add_lookup(ctx, &cpuclk->hw, lookup_id); in exynos_register_cpu_clock()
474 kfree(cpuclk->cfg); in exynos_register_cpu_clock()
476 clk_notifier_unregister(parent_clk, &cpuclk->clk_nb); in exynos_register_cpu_clock()
478 kfree(cpuclk); in exynos_register_cpu_clock()