Lines Matching +full:r8a73a4 +full:- +full:cpg +full:- +full:clocks
1 // SPDX-License-Identifier: GPL-2.0
3 * r8a73a4 Core CPG Clocks
8 #include <linux/clk-provider.h>
58 r8a73a4_cpg_register_clock(struct device_node *np, struct r8a73a4_cpg *cpg, in r8a73a4_cpg_register_clock() argument
88 /* PLL0/1 are configurable multiplier clocks. Register them as in r8a73a4_cpg_register_clock()
89 * fixed factor clocks for now as there's no generic multiplier in r8a73a4_cpg_register_clock()
121 return ERR_PTR(-EINVAL); in r8a73a4_cpg_register_clock()
146 return ERR_PTR(-EINVAL); in r8a73a4_cpg_register_clock()
159 mult = 0x20 - ((readl(base + CPG_FRQCRC) >> shift) & 0x1f); in r8a73a4_cpg_register_clock()
163 for (c = div4_clks; c->name; c++) { in r8a73a4_cpg_register_clock()
164 if (!strcmp(name, c->name)) in r8a73a4_cpg_register_clock()
167 if (!c->name) in r8a73a4_cpg_register_clock()
168 return ERR_PTR(-EINVAL); in r8a73a4_cpg_register_clock()
172 reg = c->reg; in r8a73a4_cpg_register_clock()
173 shift = c->shift; in r8a73a4_cpg_register_clock()
182 table, &cpg->lock); in r8a73a4_cpg_register_clock()
188 struct r8a73a4_cpg *cpg; in r8a73a4_cpg_clocks_init() local
194 num_clks = of_property_count_strings(np, "clock-output-names"); in r8a73a4_cpg_clocks_init()
196 pr_err("%s: failed to count clocks\n", __func__); in r8a73a4_cpg_clocks_init()
200 cpg = kzalloc(sizeof(*cpg), GFP_KERNEL); in r8a73a4_cpg_clocks_init()
202 if (cpg == NULL || clks == NULL) { in r8a73a4_cpg_clocks_init()
209 spin_lock_init(&cpg->lock); in r8a73a4_cpg_clocks_init()
211 cpg->data.clks = clks; in r8a73a4_cpg_clocks_init()
212 cpg->data.clk_num = num_clks; in r8a73a4_cpg_clocks_init()
222 of_property_read_string_index(np, "clock-output-names", i, in r8a73a4_cpg_clocks_init()
225 clk = r8a73a4_cpg_register_clock(np, cpg, base, name); in r8a73a4_cpg_clocks_init()
230 cpg->data.clks[i] = clk; in r8a73a4_cpg_clocks_init()
233 of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data); in r8a73a4_cpg_clocks_init()
235 CLK_OF_DECLARE(r8a73a4_cpg_clks, "renesas,r8a73a4-cpg-clocks",