Lines Matching +full:clk +full:- +full:csr

1 // SPDX-License-Identifier: GPL-2.0+
11 #include <linux/clk-provider.h>
17 #include "clk.h"
62 u32 csr; in clk_pllv4_wait_lock() local
64 return readl_poll_timeout(pll->base + PLL_CSR_OFFSET, in clk_pllv4_wait_lock()
65 csr, csr & PLL_VLD, 0, LOCK_TIMEOUT_US); in clk_pllv4_wait_lock()
72 if (readl_relaxed(pll->base) & PLL_EN) in clk_pllv4_is_prepared()
85 mult = readl_relaxed(pll->base + pll->cfg_offset); in clk_pllv4_recalc_rate()
89 mfn = readl_relaxed(pll->base + pll->num_offset); in clk_pllv4_recalc_rate()
90 mfd = readl_relaxed(pll->base + pll->denom_offset); in clk_pllv4_recalc_rate()
109 if (pll->use_mult_range) { in clk_pllv4_round_rate()
137 temp64 = (u64)(rate - round_rate); in clk_pllv4_round_rate()
163 if (pll->use_mult_range) { in clk_pllv4_is_valid_mult()
187 return -EINVAL; in clk_pllv4_set_rate()
192 temp64 = (u64)(rate - mult * parent_rate); in clk_pllv4_set_rate()
197 val = readl_relaxed(pll->base + pll->cfg_offset); in clk_pllv4_set_rate()
200 writel_relaxed(val, pll->base + pll->cfg_offset); in clk_pllv4_set_rate()
202 writel_relaxed(mfn, pll->base + pll->num_offset); in clk_pllv4_set_rate()
203 writel_relaxed(mfd, pll->base + pll->denom_offset); in clk_pllv4_set_rate()
213 val = readl_relaxed(pll->base); in clk_pllv4_prepare()
215 writel_relaxed(val, pll->base); in clk_pllv4_prepare()
225 val = readl_relaxed(pll->base); in clk_pllv4_unprepare()
227 writel_relaxed(val, pll->base); in clk_pllv4_unprepare()
249 return ERR_PTR(-ENOMEM); in imx_clk_hw_pllv4()
251 pll->base = base; in imx_clk_hw_pllv4()
255 pll->cfg_offset = IMX8ULP_PLL_CFG_OFFSET; in imx_clk_hw_pllv4()
256 pll->num_offset = IMX8ULP_PLL_NUM_OFFSET; in imx_clk_hw_pllv4()
257 pll->denom_offset = IMX8ULP_PLL_DENOM_OFFSET; in imx_clk_hw_pllv4()
259 pll->use_mult_range = true; in imx_clk_hw_pllv4()
261 pll->cfg_offset = PLL_CFG_OFFSET; in imx_clk_hw_pllv4()
262 pll->num_offset = PLL_NUM_OFFSET; in imx_clk_hw_pllv4()
263 pll->denom_offset = PLL_DENOM_OFFSET; in imx_clk_hw_pllv4()
272 pll->hw.init = &init; in imx_clk_hw_pllv4()
274 hw = &pll->hw; in imx_clk_hw_pllv4()