Lines Matching +full:c +full:- +full:define +full:- +full:name

1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2014 Ulrich Hecht
8 #include <linux/clk-provider.h>
23 #define CPG_CKSCR 0xc0
24 #define CPG_FRQCRA 0x00
25 #define CPG_FRQCRB 0x04
26 #define CPG_FRQCRC 0xe0
27 #define CPG_PLL0CR 0xd8
28 #define CPG_PLL1CR 0x28
29 #define CPG_PLL2CR 0x2c
30 #define CPG_PLL2HCR 0xe4
31 #define CPG_PLL2SCR 0xf4
34 const char *name; member
59 void __iomem *base, const char *name) in r8a73a4_cpg_register_clock() argument
68 if (!strcmp(name, "main")) { in r8a73a4_cpg_register_clock()
87 } else if (!strcmp(name, "pll0")) { in r8a73a4_cpg_register_clock()
99 } else if (!strcmp(name, "pll1")) { in r8a73a4_cpg_register_clock()
107 } else if (!strncmp(name, "pll2", 4)) { in r8a73a4_cpg_register_clock()
110 switch (name[4]) { in r8a73a4_cpg_register_clock()
121 return ERR_PTR(-EINVAL); in r8a73a4_cpg_register_clock()
145 name); in r8a73a4_cpg_register_clock()
146 return ERR_PTR(-EINVAL); in r8a73a4_cpg_register_clock()
150 } else if (!strcmp(name, "z") || !strcmp(name, "z2")) { in r8a73a4_cpg_register_clock()
154 if (name[1] == '2') { in r8a73a4_cpg_register_clock()
159 mult = 0x20 - ((readl(base + CPG_FRQCRC) >> shift) & 0x1f); in r8a73a4_cpg_register_clock()
161 struct div4_clk *c; in r8a73a4_cpg_register_clock() local
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()
177 return clk_register_fixed_factor(NULL, name, parent_name, 0, in r8a73a4_cpg_register_clock()
180 return clk_register_divider_table(NULL, name, parent_name, 0, in r8a73a4_cpg_register_clock()
182 table, &cpg->lock); in r8a73a4_cpg_register_clock()
194 num_clks = of_property_count_strings(np, "clock-output-names"); 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()
219 const char *name; in r8a73a4_cpg_clocks_init() local
222 of_property_read_string_index(np, "clock-output-names", i, in r8a73a4_cpg_clocks_init()
223 &name); in r8a73a4_cpg_clocks_init()
225 clk = r8a73a4_cpg_register_clock(np, cpg, base, name); in r8a73a4_cpg_clocks_init()
228 __func__, np, name, PTR_ERR(clk)); 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",