Lines Matching +full:clk +full:- +full:div
1 // SPDX-License-Identifier: GPL-2.0-only
6 #include <linux/clk.h>
7 #include <linux/clk-provider.h>
13 #include "clk.h"
24 p->clk_data.clks = kcalloc(num_clks, sizeof(struct clk *), GFP_KERNEL); in pistachio_clk_alloc_provider()
25 if (!p->clk_data.clks) in pistachio_clk_alloc_provider()
27 p->clk_data.clk_num = num_clks; in pistachio_clk_alloc_provider()
28 p->node = node; in pistachio_clk_alloc_provider()
29 p->base = of_iomap(node, 0); in pistachio_clk_alloc_provider()
30 if (!p->base) { in pistachio_clk_alloc_provider()
38 kfree(p->clk_data.clks); in pistachio_clk_alloc_provider()
48 for (i = 0; i < p->clk_data.clk_num; i++) { in pistachio_clk_register_provider()
49 if (IS_ERR(p->clk_data.clks[i])) in pistachio_clk_register_provider()
51 PTR_ERR(p->clk_data.clks[i])); in pistachio_clk_register_provider()
54 of_clk_add_provider(p->node, of_clk_src_onecell_get, &p->clk_data); in pistachio_clk_register_provider()
61 struct clk *clk; in pistachio_clk_register_gate() local
65 clk = clk_register_gate(NULL, gate[i].name, gate[i].parent, in pistachio_clk_register_gate()
67 p->base + gate[i].reg, gate[i].shift, in pistachio_clk_register_gate()
69 p->clk_data.clks[gate[i].id] = clk; in pistachio_clk_register_gate()
77 struct clk *clk; in pistachio_clk_register_mux() local
81 clk = clk_register_mux(NULL, mux[i].name, mux[i].parents, in pistachio_clk_register_mux()
84 p->base + mux[i].reg, mux[i].shift, in pistachio_clk_register_mux()
87 p->clk_data.clks[mux[i].id] = clk; in pistachio_clk_register_mux()
92 struct pistachio_div *div, in pistachio_clk_register_div() argument
95 struct clk *clk; in pistachio_clk_register_div() local
99 clk = clk_register_divider(NULL, div[i].name, div[i].parent, in pistachio_clk_register_div()
100 0, p->base + div[i].reg, 0, in pistachio_clk_register_div()
101 div[i].width, div[i].div_flags, in pistachio_clk_register_div()
103 p->clk_data.clks[div[i].id] = clk; in pistachio_clk_register_div()
111 struct clk *clk; in pistachio_clk_register_fixed_factor() local
115 clk = clk_register_fixed_factor(NULL, ff[i].name, ff[i].parent, in pistachio_clk_register_fixed_factor()
116 0, 1, ff[i].div); in pistachio_clk_register_fixed_factor()
117 p->clk_data.clks[ff[i].id] = clk; in pistachio_clk_register_fixed_factor()
128 struct clk *clk = p->clk_data.clks[clk_ids[i]]; in pistachio_clk_force_enable() local
130 if (IS_ERR(clk)) in pistachio_clk_force_enable()
133 err = clk_prepare_enable(clk); in pistachio_clk_force_enable()
136 __clk_get_name(clk), err); in pistachio_clk_force_enable()