Lines Matching refs:cpuclk
150 struct exynos_cpuclk *cpuclk, void __iomem *base) in exynos_cpuclk_pre_rate_change() argument
152 const struct exynos_cpuclk_cfg_data *cfg_data = cpuclk->cfg; in exynos_cpuclk_pre_rate_change()
153 unsigned long alt_prate = clk_hw_get_rate(cpuclk->alt_parent); in exynos_cpuclk_pre_rate_change()
165 spin_lock_irqsave(cpuclk->lock, flags); in exynos_cpuclk_pre_rate_change()
173 if (cpuclk->flags & CLK_CPU_HAS_DIV1) { in exynos_cpuclk_pre_rate_change()
194 if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) { in exynos_cpuclk_pre_rate_change()
215 if (cpuclk->flags & CLK_CPU_HAS_DIV1) { in exynos_cpuclk_pre_rate_change()
221 spin_unlock_irqrestore(cpuclk->lock, flags); in exynos_cpuclk_pre_rate_change()
227 struct exynos_cpuclk *cpuclk, void __iomem *base) in exynos_cpuclk_post_rate_change() argument
229 const struct exynos_cpuclk_cfg_data *cfg_data = cpuclk->cfg; in exynos_cpuclk_post_rate_change()
235 if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) { in exynos_cpuclk_post_rate_change()
243 spin_lock_irqsave(cpuclk->lock, flags); in exynos_cpuclk_post_rate_change()
250 if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) { in exynos_cpuclk_post_rate_change()
256 spin_unlock_irqrestore(cpuclk->lock, flags); in exynos_cpuclk_post_rate_change()
278 struct exynos_cpuclk *cpuclk, void __iomem *base) in exynos5433_cpuclk_pre_rate_change() argument
280 const struct exynos_cpuclk_cfg_data *cfg_data = cpuclk->cfg; in exynos5433_cpuclk_pre_rate_change()
281 unsigned long alt_prate = clk_hw_get_rate(cpuclk->alt_parent); in exynos5433_cpuclk_pre_rate_change()
293 spin_lock_irqsave(cpuclk->lock, flags); in exynos5433_cpuclk_pre_rate_change()
332 spin_unlock_irqrestore(cpuclk->lock, flags); in exynos5433_cpuclk_pre_rate_change()
338 struct exynos_cpuclk *cpuclk, void __iomem *base) in exynos5433_cpuclk_post_rate_change() argument
344 spin_lock_irqsave(cpuclk->lock, flags); in exynos5433_cpuclk_post_rate_change()
352 spin_unlock_irqrestore(cpuclk->lock, flags); in exynos5433_cpuclk_post_rate_change()
364 struct exynos_cpuclk *cpuclk; in exynos_cpuclk_notifier_cb() local
368 cpuclk = container_of(nb, struct exynos_cpuclk, clk_nb); in exynos_cpuclk_notifier_cb()
369 base = cpuclk->ctrl_base; in exynos_cpuclk_notifier_cb()
372 err = exynos_cpuclk_pre_rate_change(ndata, cpuclk, base); in exynos_cpuclk_notifier_cb()
374 err = exynos_cpuclk_post_rate_change(ndata, cpuclk, base); in exynos_cpuclk_notifier_cb()
387 struct exynos_cpuclk *cpuclk; in exynos5433_cpuclk_notifier_cb() local
391 cpuclk = container_of(nb, struct exynos_cpuclk, clk_nb); in exynos5433_cpuclk_notifier_cb()
392 base = cpuclk->ctrl_base; in exynos5433_cpuclk_notifier_cb()
395 err = exynos5433_cpuclk_pre_rate_change(ndata, cpuclk, base); in exynos5433_cpuclk_notifier_cb()
397 err = exynos5433_cpuclk_post_rate_change(ndata, cpuclk, base); in exynos5433_cpuclk_notifier_cb()
409 struct exynos_cpuclk *cpuclk; in exynos_register_cpu_clock() local
414 cpuclk = kzalloc(sizeof(*cpuclk), GFP_KERNEL); in exynos_register_cpu_clock()
415 if (!cpuclk) in exynos_register_cpu_clock()
424 cpuclk->hw.init = &init; in exynos_register_cpu_clock()
425 cpuclk->ctrl_base = ctx->reg_base + offset; in exynos_register_cpu_clock()
426 cpuclk->lock = &ctx->lock; in exynos_register_cpu_clock()
427 cpuclk->flags = flags; in exynos_register_cpu_clock()
429 cpuclk->clk_nb.notifier_call = exynos5433_cpuclk_notifier_cb; in exynos_register_cpu_clock()
431 cpuclk->clk_nb.notifier_call = exynos_cpuclk_notifier_cb; in exynos_register_cpu_clock()
433 cpuclk->alt_parent = __clk_get_hw(__clk_lookup(alt_parent)); in exynos_register_cpu_clock()
434 if (!cpuclk->alt_parent) { in exynos_register_cpu_clock()
449 ret = clk_notifier_register(parent_clk, &cpuclk->clk_nb); in exynos_register_cpu_clock()
456 cpuclk->cfg = kmemdup(cfg, sizeof(*cfg) * num_cfgs, GFP_KERNEL); in exynos_register_cpu_clock()
457 if (!cpuclk->cfg) { in exynos_register_cpu_clock()
462 ret = clk_hw_register(NULL, &cpuclk->hw); in exynos_register_cpu_clock()
468 samsung_clk_add_lookup(ctx, &cpuclk->hw, lookup_id); in exynos_register_cpu_clock()
472 kfree(cpuclk->cfg); in exynos_register_cpu_clock()
474 clk_notifier_unregister(parent_clk, &cpuclk->clk_nb); in exynos_register_cpu_clock()
476 kfree(cpuclk); in exynos_register_cpu_clock()