Lines Matching full:cfg
32 #define pinternal(pll, cfg, member) \ argument
33 (cfg[pindex(pll, member)] & pmask(pll, member))
35 #define pinternal_val(pll, cfg, member) \ argument
36 (pinternal(pll, cfg, member) >> pshift(pll, member))
101 u32 *cfg; in _sprd_pll_recalc_rate() local
107 cfg = kcalloc(regs_num, sizeof(*cfg), GFP_KERNEL); in _sprd_pll_recalc_rate()
108 if (!cfg) in _sprd_pll_recalc_rate()
112 cfg[i] = sprd_pll_read(pll, i); in _sprd_pll_recalc_rate()
116 if (pinternal(pll, cfg, PLL_PREDIV)) in _sprd_pll_recalc_rate()
120 ((pll->fflag == 1 && pinternal(pll, cfg, PLL_POSTDIV)) || in _sprd_pll_recalc_rate()
121 (!pll->fflag && !pinternal(pll, cfg, PLL_POSTDIV)))) in _sprd_pll_recalc_rate()
124 if (!pinternal(pll, cfg, PLL_DIV_S)) { in _sprd_pll_recalc_rate()
125 rate = refin * pinternal_val(pll, cfg, PLL_N) * CLK_PLL_10M; in _sprd_pll_recalc_rate()
127 nint = pinternal_val(pll, cfg, PLL_NINT); in _sprd_pll_recalc_rate()
128 if (pinternal(pll, cfg, PLL_SDM_EN)) in _sprd_pll_recalc_rate()
129 kint = pinternal_val(pll, cfg, PLL_KINT); in _sprd_pll_recalc_rate()
140 kfree(cfg); in _sprd_pll_recalc_rate()
151 struct reg_cfg *cfg; in _sprd_pll_set_rate() local
158 cfg = kcalloc(regs_num, sizeof(*cfg), GFP_KERNEL); in _sprd_pll_set_rate()
159 if (!cfg) in _sprd_pll_set_rate()
173 cfg[index].msk = mask; in _sprd_pll_set_rate()
176 cfg[index].val |= mask; in _sprd_pll_set_rate()
183 cfg[index].val |= mask; in _sprd_pll_set_rate()
184 cfg[index].msk |= mask; in _sprd_pll_set_rate()
188 cfg[index].val |= mask; in _sprd_pll_set_rate()
189 cfg[index].msk |= mask; in _sprd_pll_set_rate()
195 cfg[index].val |= (nint << shift) & mask; in _sprd_pll_set_rate()
196 cfg[index].msk |= mask; in _sprd_pll_set_rate()
205 cfg[index].val |= (kint << shift) & mask; in _sprd_pll_set_rate()
206 cfg[index].msk |= mask; in _sprd_pll_set_rate()
213 cfg[index].val |= ibias_val << shift & mask; in _sprd_pll_set_rate()
214 cfg[index].msk |= mask; in _sprd_pll_set_rate()
217 if (cfg[i].msk) { in _sprd_pll_set_rate()
218 sprd_pll_write(pll, i, cfg[i].msk, cfg[i].val); in _sprd_pll_set_rate()
219 ret |= SPRD_PLL_WRITE_CHECK(pll, i, cfg[i].msk, in _sprd_pll_set_rate()
220 cfg[i].val); in _sprd_pll_set_rate()
227 kfree(cfg); in _sprd_pll_set_rate()