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>
60 r8a73a4_cpg_register_clock(struct device_node *np, struct r8a73a4_cpg *cpg, in r8a73a4_cpg_register_clock() argument
90 /* PLL0/1 are configurable multiplier clocks. Register them as in r8a73a4_cpg_register_clock()
91 * fixed factor clocks for now as there's no generic multiplier in r8a73a4_cpg_register_clock()
123 return ERR_PTR(-EINVAL); in r8a73a4_cpg_register_clock()
148 return ERR_PTR(-EINVAL); in r8a73a4_cpg_register_clock()
161 mult = 0x20 - ((readl(base + CPG_FRQCRC) >> shift) & 0x1f); in r8a73a4_cpg_register_clock()
165 for (c = div4_clks; c->name; c++) { in r8a73a4_cpg_register_clock()
166 if (!strcmp(name, c->name)) in r8a73a4_cpg_register_clock()
169 if (!c->name) in r8a73a4_cpg_register_clock()
170 return ERR_PTR(-EINVAL); in r8a73a4_cpg_register_clock()
174 reg = c->reg; in r8a73a4_cpg_register_clock()
175 shift = c->shift; in r8a73a4_cpg_register_clock()
184 table, &cpg->lock); in r8a73a4_cpg_register_clock()
190 struct r8a73a4_cpg *cpg; in r8a73a4_cpg_clocks_init() local
196 num_clks = of_property_count_strings(np, "clock-output-names"); in r8a73a4_cpg_clocks_init()
198 pr_err("%s: failed to count clocks\n", __func__); in r8a73a4_cpg_clocks_init()
202 cpg = kzalloc(sizeof(*cpg), GFP_KERNEL); in r8a73a4_cpg_clocks_init()
204 if (cpg == NULL || clks == NULL) { in r8a73a4_cpg_clocks_init()
211 spin_lock_init(&cpg->lock); in r8a73a4_cpg_clocks_init()
213 cpg->data.clks = clks; in r8a73a4_cpg_clocks_init()
214 cpg->data.clk_num = num_clks; in r8a73a4_cpg_clocks_init()
224 of_property_read_string_index(np, "clock-output-names", i, in r8a73a4_cpg_clocks_init()
227 clk = r8a73a4_cpg_register_clock(np, cpg, base, name); in r8a73a4_cpg_clocks_init()
232 cpg->data.clks[i] = clk; in r8a73a4_cpg_clocks_init()
235 of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data); in r8a73a4_cpg_clocks_init()
237 CLK_OF_DECLARE(r8a73a4_cpg_clks, "renesas,r8a73a4-cpg-clocks",