Lines Matching +full:sun4i +full:- +full:a10 +full:- +full:tcon

1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Maxime Ripard <maxime.ripard@free-electrons.com>
8 #include <linux/clk-provider.h>
40 spin_lock_irqsave(&tclk->lock, flags); in tcon_ch1_disable()
41 reg = readl(tclk->reg); in tcon_ch1_disable()
43 writel(reg, tclk->reg); in tcon_ch1_disable()
44 spin_unlock_irqrestore(&tclk->lock, flags); in tcon_ch1_disable()
53 spin_lock_irqsave(&tclk->lock, flags); in tcon_ch1_enable()
54 reg = readl(tclk->reg); in tcon_ch1_enable()
56 writel(reg, tclk->reg); in tcon_ch1_enable()
57 spin_unlock_irqrestore(&tclk->lock, flags); in tcon_ch1_enable()
67 reg = readl(tclk->reg); in tcon_ch1_is_enabled()
76 reg = readl(tclk->reg) >> TCON_CH1_SCLK2_MUX_SHIFT; in tcon_ch1_get_parent()
88 spin_lock_irqsave(&tclk->lock, flags); in tcon_ch1_set_parent()
89 reg = readl(tclk->reg); in tcon_ch1_set_parent()
92 writel(reg, tclk->reg); in tcon_ch1_set_parent()
93 spin_unlock_irqrestore(&tclk->lock, flags); in tcon_ch1_set_parent()
119 (rate - tmp_rate) < (rate - best_rate)) { in tcon_ch1_calc_divider()
138 long best_rate = -EINVAL; in tcon_ch1_determine_rate()
152 tmp_rate = tcon_ch1_calc_divider(req->rate, parent_rate, in tcon_ch1_determine_rate()
156 (req->rate - tmp_rate) < (req->rate - best_rate)) { in tcon_ch1_determine_rate()
158 req->best_parent_rate = parent_rate; in tcon_ch1_determine_rate()
159 req->best_parent_hw = parent; in tcon_ch1_determine_rate()
166 req->rate = best_rate; in tcon_ch1_determine_rate()
176 reg = readl(tclk->reg); in tcon_ch1_recalc_rate()
197 spin_lock_irqsave(&tclk->lock, flags); in tcon_ch1_set_rate()
198 reg = readl(tclk->reg); in tcon_ch1_set_rate()
200 reg |= (div_m - 1) & TCON_CH1_SCLK2_DIV_MASK; in tcon_ch1_set_rate()
205 writel(reg, tclk->reg); in tcon_ch1_set_rate()
206 spin_unlock_irqrestore(&tclk->lock, flags); in tcon_ch1_set_rate()
227 const char *clk_name = node->name; in tcon_ch1_setup()
235 of_property_read_string(node, "clock-output-names", &clk_name); in tcon_ch1_setup()
259 tclk->reg = reg; in tcon_ch1_setup()
260 tclk->hw.init = &init; in tcon_ch1_setup()
261 spin_lock_init(&tclk->lock); in tcon_ch1_setup()
263 clk = clk_register(NULL, &tclk->hw); in tcon_ch1_setup()
287 CLK_OF_DECLARE(tcon_ch1, "allwinner,sun4i-a10-tcon-ch1-clk",