Lines Matching refs:cpg

138 static struct clk * __init cpg_z_clk_register(struct rcar_gen2_cpg *cpg)  in cpg_z_clk_register()  argument
155 zclk->reg = cpg->reg + CPG_FRQCRC; in cpg_z_clk_register()
156 zclk->kick_reg = cpg->reg + CPG_FRQCRB; in cpg_z_clk_register()
166 static struct clk * __init cpg_rcan_clk_register(struct rcar_gen2_cpg *cpg, in cpg_rcan_clk_register() argument
187 gate->reg = cpg->reg + CPG_RCANCKCR; in cpg_rcan_clk_register()
190 gate->lock = &cpg->lock; in cpg_rcan_clk_register()
210 static struct clk * __init cpg_adsp_clk_register(struct rcar_gen2_cpg *cpg) in cpg_adsp_clk_register() argument
221 div->reg = cpg->reg + CPG_ADSPCKCR; in cpg_adsp_clk_register()
224 div->lock = &cpg->lock; in cpg_adsp_clk_register()
232 gate->reg = cpg->reg + CPG_ADSPCKCR; in cpg_adsp_clk_register()
235 gate->lock = &cpg->lock; in cpg_adsp_clk_register()
310 rcar_gen2_cpg_register_clock(struct device_node *np, struct rcar_gen2_cpg *cpg, in rcar_gen2_cpg_register_clock() argument
334 u32 value = readl(cpg->reg + CPG_PLL0CR); in rcar_gen2_cpg_register_clock()
364 return cpg_z_clk_register(cpg); in rcar_gen2_cpg_register_clock()
366 return cpg_rcan_clk_register(cpg, np); in rcar_gen2_cpg_register_clock()
368 return cpg_adsp_clk_register(cpg); in rcar_gen2_cpg_register_clock()
378 cpg->reg + CPG_SDCKCR, shift, in rcar_gen2_cpg_register_clock()
379 4, 0, table, &cpg->lock); in rcar_gen2_cpg_register_clock()
402 struct rcar_gen2_cpg *cpg; in rcar_gen2_cpg_clocks_init() local
419 cpg = kzalloc(sizeof(*cpg), GFP_KERNEL); in rcar_gen2_cpg_clocks_init()
421 if (cpg == NULL || clks == NULL) { in rcar_gen2_cpg_clocks_init()
428 spin_lock_init(&cpg->lock); in rcar_gen2_cpg_clocks_init()
430 cpg->data.clks = clks; in rcar_gen2_cpg_clocks_init()
431 cpg->data.clk_num = num_clks; in rcar_gen2_cpg_clocks_init()
433 cpg->reg = of_iomap(np, 0); in rcar_gen2_cpg_clocks_init()
434 if (WARN_ON(cpg->reg == NULL)) in rcar_gen2_cpg_clocks_init()
446 clk = rcar_gen2_cpg_register_clock(np, cpg, config, name); in rcar_gen2_cpg_clocks_init()
451 cpg->data.clks[i] = clk; in rcar_gen2_cpg_clocks_init()
454 of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data); in rcar_gen2_cpg_clocks_init()