Lines Matching refs:cpuclk

45 				       struct exynos_cpuclk *cpuclk);
164 static void exynos_set_safe_div(struct exynos_cpuclk *cpuclk, unsigned long div, in exynos_set_safe_div() argument
167 const struct exynos_cpuclk_regs * const regs = cpuclk->chip->regs; in exynos_set_safe_div()
168 void __iomem *base = cpuclk->base; in exynos_set_safe_div()
197 struct exynos_cpuclk *cpuclk) in exynos_cpuclk_pre_rate_change() argument
199 const struct exynos_cpuclk_cfg_data *cfg_data = cpuclk->cfg; in exynos_cpuclk_pre_rate_change()
200 const struct exynos_cpuclk_regs * const regs = cpuclk->chip->regs; in exynos_cpuclk_pre_rate_change()
201 void __iomem *base = cpuclk->base; in exynos_cpuclk_pre_rate_change()
202 unsigned long alt_prate = clk_hw_get_rate(cpuclk->alt_parent); in exynos_cpuclk_pre_rate_change()
213 spin_lock_irqsave(cpuclk->lock, flags); in exynos_cpuclk_pre_rate_change()
221 if (cpuclk->flags & CLK_CPU_HAS_DIV1) { in exynos_cpuclk_pre_rate_change()
243 if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) { in exynos_cpuclk_pre_rate_change()
251 exynos_set_safe_div(cpuclk, alt_div, alt_div_mask); in exynos_cpuclk_pre_rate_change()
264 if (cpuclk->flags & CLK_CPU_HAS_DIV1) { in exynos_cpuclk_pre_rate_change()
270 spin_unlock_irqrestore(cpuclk->lock, flags); in exynos_cpuclk_pre_rate_change()
276 struct exynos_cpuclk *cpuclk) in exynos_cpuclk_post_rate_change() argument
278 const struct exynos_cpuclk_cfg_data *cfg_data = cpuclk->cfg; in exynos_cpuclk_post_rate_change()
279 const struct exynos_cpuclk_regs * const regs = cpuclk->chip->regs; in exynos_cpuclk_post_rate_change()
280 void __iomem *base = cpuclk->base; in exynos_cpuclk_post_rate_change()
286 if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) { in exynos_cpuclk_post_rate_change()
294 spin_lock_irqsave(cpuclk->lock, flags); in exynos_cpuclk_post_rate_change()
301 if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) { in exynos_cpuclk_post_rate_change()
306 exynos_set_safe_div(cpuclk, div, div_mask); in exynos_cpuclk_post_rate_change()
307 spin_unlock_irqrestore(cpuclk->lock, flags); in exynos_cpuclk_post_rate_change()
324 struct exynos_cpuclk *cpuclk) in exynos5433_cpuclk_pre_rate_change() argument
326 const struct exynos_cpuclk_cfg_data *cfg_data = cpuclk->cfg; in exynos5433_cpuclk_pre_rate_change()
327 const struct exynos_cpuclk_regs * const regs = cpuclk->chip->regs; in exynos5433_cpuclk_pre_rate_change()
328 void __iomem *base = cpuclk->base; in exynos5433_cpuclk_pre_rate_change()
329 unsigned long alt_prate = clk_hw_get_rate(cpuclk->alt_parent); in exynos5433_cpuclk_pre_rate_change()
340 spin_lock_irqsave(cpuclk->lock, flags); in exynos5433_cpuclk_pre_rate_change()
364 exynos_set_safe_div(cpuclk, alt_div, alt_div_mask); in exynos5433_cpuclk_pre_rate_change()
380 spin_unlock_irqrestore(cpuclk->lock, flags); in exynos5433_cpuclk_pre_rate_change()
386 struct exynos_cpuclk *cpuclk) in exynos5433_cpuclk_post_rate_change() argument
388 const struct exynos_cpuclk_regs * const regs = cpuclk->chip->regs; in exynos5433_cpuclk_post_rate_change()
389 void __iomem *base = cpuclk->base; in exynos5433_cpuclk_post_rate_change()
394 spin_lock_irqsave(cpuclk->lock, flags); in exynos5433_cpuclk_post_rate_change()
401 exynos_set_safe_div(cpuclk, div, div_mask); in exynos5433_cpuclk_post_rate_change()
402 spin_unlock_irqrestore(cpuclk->lock, flags); in exynos5433_cpuclk_post_rate_change()
477 struct exynos_cpuclk *cpuclk) in exynos850_cpuclk_pre_rate_change() argument
480 const struct exynos_cpuclk_regs * const regs = cpuclk->chip->regs; in exynos850_cpuclk_pre_rate_change()
481 const struct exynos_cpuclk_cfg_data *cfg_data = cpuclk->cfg; in exynos850_cpuclk_pre_rate_change()
482 const struct clk_hw *alt_parent = cpuclk->alt_parent; in exynos850_cpuclk_pre_rate_change()
483 void __iomem *base = cpuclk->base; in exynos850_cpuclk_pre_rate_change()
517 spin_lock_irqsave(cpuclk->lock, flags); in exynos850_cpuclk_pre_rate_change()
535 spin_unlock_irqrestore(cpuclk->lock, flags); in exynos850_cpuclk_pre_rate_change()
542 struct exynos_cpuclk *cpuclk) in exynos850_cpuclk_post_rate_change() argument
544 const struct exynos_cpuclk_regs * const regs = cpuclk->chip->regs; in exynos850_cpuclk_post_rate_change()
545 const struct clk_hw *alt_parent = cpuclk->alt_parent; in exynos850_cpuclk_post_rate_change()
546 void __iomem *base = cpuclk->base; in exynos850_cpuclk_post_rate_change()
554 spin_lock_irqsave(cpuclk->lock, flags); in exynos850_cpuclk_post_rate_change()
561 spin_unlock_irqrestore(cpuclk->lock, flags); in exynos850_cpuclk_post_rate_change()
605 struct exynos_cpuclk *cpuclk; in exynos_cpuclk_notifier_cb() local
608 cpuclk = container_of(nb, struct exynos_cpuclk, clk_nb); in exynos_cpuclk_notifier_cb()
611 err = cpuclk->chip->pre_rate_cb(ndata, cpuclk); in exynos_cpuclk_notifier_cb()
613 err = cpuclk->chip->post_rate_cb(ndata, cpuclk); in exynos_cpuclk_notifier_cb()
647 struct exynos_cpuclk *cpuclk; in exynos_register_cpu_clock() local
661 cpuclk = kzalloc(sizeof(*cpuclk), GFP_KERNEL); in exynos_register_cpu_clock()
662 if (!cpuclk) in exynos_register_cpu_clock()
673 cpuclk->alt_parent = alt_parent; in exynos_register_cpu_clock()
674 cpuclk->hw.init = &init; in exynos_register_cpu_clock()
675 cpuclk->base = ctx->reg_base + clk_data->offset; in exynos_register_cpu_clock()
676 cpuclk->lock = &ctx->lock; in exynos_register_cpu_clock()
677 cpuclk->flags = clk_data->flags; in exynos_register_cpu_clock()
678 cpuclk->clk_nb.notifier_call = exynos_cpuclk_notifier_cb; in exynos_register_cpu_clock()
679 cpuclk->chip = &exynos_clkcpu_chips[clk_data->reg_layout]; in exynos_register_cpu_clock()
681 ret = clk_notifier_register(parent->clk, &cpuclk->clk_nb); in exynos_register_cpu_clock()
692 cpuclk->cfg = kmemdup_array(clk_data->cfg, num_cfgs, sizeof(*cpuclk->cfg), in exynos_register_cpu_clock()
694 if (!cpuclk->cfg) { in exynos_register_cpu_clock()
699 ret = clk_hw_register(NULL, &cpuclk->hw); in exynos_register_cpu_clock()
706 samsung_clk_add_lookup(ctx, &cpuclk->hw, clk_data->id); in exynos_register_cpu_clock()
710 kfree(cpuclk->cfg); in exynos_register_cpu_clock()
712 clk_notifier_unregister(parent->clk, &cpuclk->clk_nb); in exynos_register_cpu_clock()
714 kfree(cpuclk); in exynos_register_cpu_clock()