Lines Matching +full:clk +full:- +full:div

1 // SPDX-License-Identifier: GPL-2.0-or-later
6 #include <linux/clk-provider.h>
9 #include "clk.h"
12 * struct clk_div - mxs integer divider clock
38 struct clk_div *div = to_clk_div(hw); in clk_div_recalc_rate() local
40 return div->ops->recalc_rate(&div->divider.hw, parent_rate); in clk_div_recalc_rate()
46 struct clk_div *div = to_clk_div(hw); in clk_div_round_rate() local
48 return div->ops->round_rate(&div->divider.hw, rate, prate); in clk_div_round_rate()
54 struct clk_div *div = to_clk_div(hw); in clk_div_set_rate() local
57 ret = div->ops->set_rate(&div->divider.hw, rate, parent_rate); in clk_div_set_rate()
59 ret = mxs_clk_wait(div->reg, div->busy); in clk_div_set_rate()
70 struct clk *mxs_clk_div(const char *name, const char *parent_name, in mxs_clk_div()
73 struct clk_div *div; in mxs_clk_div() local
74 struct clk *clk; in mxs_clk_div() local
77 div = kzalloc(sizeof(*div), GFP_KERNEL); in mxs_clk_div()
78 if (!div) in mxs_clk_div()
79 return ERR_PTR(-ENOMEM); in mxs_clk_div()
87 div->reg = reg; in mxs_clk_div()
88 div->busy = busy; in mxs_clk_div()
90 div->divider.reg = reg; in mxs_clk_div()
91 div->divider.shift = shift; in mxs_clk_div()
92 div->divider.width = width; in mxs_clk_div()
93 div->divider.flags = CLK_DIVIDER_ONE_BASED; in mxs_clk_div()
94 div->divider.lock = &mxs_lock; in mxs_clk_div()
95 div->divider.hw.init = &init; in mxs_clk_div()
96 div->ops = &clk_divider_ops; in mxs_clk_div()
98 clk = clk_register(NULL, &div->divider.hw); in mxs_clk_div()
99 if (IS_ERR(clk)) in mxs_clk_div()
100 kfree(div); in mxs_clk_div()
102 return clk; in mxs_clk_div()