Lines Matching +full:reg +full:- +full:shift

1 // SPDX-License-Identifier: GPL-2.0-or-later
9 #include <linux/clk-provider.h>
16 static int clk_busy_wait(void __iomem *reg, u8 shift) in clk_busy_wait() argument
20 while (readl_relaxed(reg) & (1 << shift)) in clk_busy_wait()
22 return -ETIMEDOUT; in clk_busy_wait()
30 void __iomem *reg; member
31 u8 shift; member
46 return busy->div_ops->recalc_rate(&busy->div.hw, parent_rate); in clk_busy_divider_recalc_rate()
54 return busy->div_ops->round_rate(&busy->div.hw, rate, prate); in clk_busy_divider_round_rate()
63 ret = busy->div_ops->set_rate(&busy->div.hw, rate, parent_rate); in clk_busy_divider_set_rate()
65 ret = clk_busy_wait(busy->reg, busy->shift); in clk_busy_divider_set_rate()
77 void __iomem *reg, u8 shift, u8 width, in imx_clk_hw_busy_divider() argument
87 return ERR_PTR(-ENOMEM); in imx_clk_hw_busy_divider()
89 busy->reg = busy_reg; in imx_clk_hw_busy_divider()
90 busy->shift = busy_shift; in imx_clk_hw_busy_divider()
92 busy->div.reg = reg; in imx_clk_hw_busy_divider()
93 busy->div.shift = shift; in imx_clk_hw_busy_divider()
94 busy->div.width = width; in imx_clk_hw_busy_divider()
95 busy->div.lock = &imx_ccm_lock; in imx_clk_hw_busy_divider()
96 busy->div_ops = &clk_divider_ops; in imx_clk_hw_busy_divider()
104 busy->div.hw.init = &init; in imx_clk_hw_busy_divider()
106 hw = &busy->div.hw; in imx_clk_hw_busy_divider()
120 void __iomem *reg; member
121 u8 shift; member
135 return busy->mux_ops->get_parent(&busy->mux.hw); in clk_busy_mux_get_parent()
143 ret = busy->mux_ops->set_parent(&busy->mux.hw, index); in clk_busy_mux_set_parent()
145 ret = clk_busy_wait(busy->reg, busy->shift); in clk_busy_mux_set_parent()
156 struct clk_hw *imx_clk_hw_busy_mux(const char *name, void __iomem *reg, u8 shift, in imx_clk_hw_busy_mux() argument
167 return ERR_PTR(-ENOMEM); in imx_clk_hw_busy_mux()
169 busy->reg = busy_reg; in imx_clk_hw_busy_mux()
170 busy->shift = busy_shift; in imx_clk_hw_busy_mux()
172 busy->mux.reg = reg; in imx_clk_hw_busy_mux()
173 busy->mux.shift = shift; in imx_clk_hw_busy_mux()
174 busy->mux.mask = BIT(width) - 1; in imx_clk_hw_busy_mux()
175 busy->mux.lock = &imx_ccm_lock; in imx_clk_hw_busy_mux()
176 busy->mux_ops = &clk_mux_ops; in imx_clk_hw_busy_mux()
184 busy->mux.hw.init = &init; in imx_clk_hw_busy_mux()
186 hw = &busy->mux.hw; in imx_clk_hw_busy_mux()