Lines Matching refs:pfd
43 static int clk_pfdv2_wait(struct clk_pfdv2 *pfd) in clk_pfdv2_wait() argument
47 return readl_poll_timeout(pfd->reg, val, val & (1 << pfd->vld_bit), in clk_pfdv2_wait()
53 struct clk_pfdv2 *pfd = to_clk_pfdv2(hw); in clk_pfdv2_enable() local
58 val = readl_relaxed(pfd->reg); in clk_pfdv2_enable()
59 val &= ~(1 << pfd->gate_bit); in clk_pfdv2_enable()
60 writel_relaxed(val, pfd->reg); in clk_pfdv2_enable()
63 return clk_pfdv2_wait(pfd); in clk_pfdv2_enable()
68 struct clk_pfdv2 *pfd = to_clk_pfdv2(hw); in clk_pfdv2_disable() local
73 val = readl_relaxed(pfd->reg); in clk_pfdv2_disable()
74 val |= (1 << pfd->gate_bit); in clk_pfdv2_disable()
75 writel_relaxed(val, pfd->reg); in clk_pfdv2_disable()
82 struct clk_pfdv2 *pfd = to_clk_pfdv2(hw); in clk_pfdv2_recalc_rate() local
86 frac = (readl_relaxed(pfd->reg) >> pfd->frac_off) in clk_pfdv2_recalc_rate()
144 struct clk_pfdv2 *pfd = to_clk_pfdv2(hw); in clk_pfdv2_is_enabled() local
146 if (readl_relaxed(pfd->reg) & (1 << pfd->gate_bit)) in clk_pfdv2_is_enabled()
155 struct clk_pfdv2 *pfd = to_clk_pfdv2(hw); in clk_pfdv2_set_rate() local
185 val = readl_relaxed(pfd->reg); in clk_pfdv2_set_rate()
186 val &= ~(CLK_PFDV2_FRAC_MASK << pfd->frac_off); in clk_pfdv2_set_rate()
187 val |= frac << pfd->frac_off; in clk_pfdv2_set_rate()
188 writel_relaxed(val, pfd->reg); in clk_pfdv2_set_rate()
207 struct clk_pfdv2 *pfd; in imx_clk_hw_pfdv2() local
213 pfd = kzalloc(sizeof(*pfd), GFP_KERNEL); in imx_clk_hw_pfdv2()
214 if (!pfd) in imx_clk_hw_pfdv2()
217 pfd->reg = reg; in imx_clk_hw_pfdv2()
218 pfd->gate_bit = (idx + 1) * 8 - 1; in imx_clk_hw_pfdv2()
219 pfd->vld_bit = pfd->gate_bit - 1; in imx_clk_hw_pfdv2()
220 pfd->frac_off = idx * 8; in imx_clk_hw_pfdv2()
231 pfd->hw.init = &init; in imx_clk_hw_pfdv2()
233 hw = &pfd->hw; in imx_clk_hw_pfdv2()
236 kfree(pfd); in imx_clk_hw_pfdv2()