Lines Matching full:vco

3  * Driver for the ICST307 VCO clock found in the ARM Reference designs.
37 * struct clk_icst - ICST VCO clock wrapper
40 * @vcoreg_off: VCO register address
41 * @lockreg_off: VCO lock register address
59 * vco_get() - get ICST VCO settings from a certain ICST
61 * @vco: the VCO struct to return the value in
63 static int vco_get(struct clk_icst *icst, struct icst_vco *vco) in vco_get() argument
81 vco->v = val & INTEGRATOR_AP_CM_BITS; in vco_get()
82 vco->r = 22; in vco_get()
83 vco->s = 1; in vco_get()
96 vco->v = val & INTEGRATOR_AP_SYS_BITS; in vco_get()
97 vco->r = 46; in vco_get()
98 vco->s = 3; in vco_get()
113 vco->v = divxy ? 17 : 14; in vco_get()
114 vco->r = divxy ? 22 : 14; in vco_get()
115 vco->s = 1; in vco_get()
128 vco->v = val & 0xFF; in vco_get()
129 vco->r = 22; in vco_get()
130 vco->s = (val >> 8) & 7; in vco_get()
135 vco->v = (val >> 12) & 0xFF; in vco_get()
136 vco->r = 22; in vco_get()
137 vco->s = (val >> 20) & 7; in vco_get()
141 vco->v = val & 0x1ff; in vco_get()
142 vco->r = (val >> 9) & 0x7f; in vco_get()
143 vco->s = (val >> 16) & 03; in vco_get()
148 * vco_set() - commit changes to an ICST VCO
150 * @vco: the VCO struct to set the changes from
152 static int vco_set(struct clk_icst *icst, struct icst_vco vco) in vco_set() argument
158 /* Mask the bits used by the VCO */ in vco_set()
162 val = vco.v & 0xFF; in vco_set()
163 if (vco.v & 0x100) in vco_set()
165 if (vco.s != 1) in vco_set()
167 if (vco.r != 22) in vco_set()
172 val = vco.v & 0xFF; in vco_set()
173 if (vco.v & 0x100) in vco_set()
175 if (vco.s != 3) in vco_set()
177 if (vco.r != 46) in vco_set()
182 val = (vco.v & 0xFF) | vco.s << 8; in vco_set()
183 if (vco.v & 0x100) in vco_set()
185 if (vco.r != 22) in vco_set()
190 val = ((vco.v & 0xFF) << 12) | (vco.s << 20); in vco_set()
191 if (vco.v & 0x100) in vco_set()
193 if (vco.r != 22) in vco_set()
199 val = vco.v | (vco.r << 9) | (vco.s << 16); in vco_set()
205 /* This magic unlocks the VCO so it can be controlled */ in vco_set()
212 /* This locks the VCO again */ in vco_set()
223 struct icst_vco vco; in icst_recalc_rate() local
228 ret = vco_get(icst, &vco); in icst_recalc_rate()
230 pr_err("ICST: could not get VCO setting\n"); in icst_recalc_rate()
233 icst->rate = icst_hz(icst->params, vco); in icst_recalc_rate()
241 struct icst_vco vco; in icst_round_rate() local
283 vco = icst_hz_to_vco(icst->params, rate); in icst_round_rate()
284 return icst_hz(icst->params, vco); in icst_round_rate()
291 struct icst_vco vco; in icst_set_rate() local
316 /* This locks the VCO again */ in icst_set_rate()
325 vco = icst_hz_to_vco(icst->params, rate); in icst_set_rate()
326 icst->rate = icst_hz(icst->params, vco); in icst_set_rate()
327 return vco_set(icst, vco); in icst_set_rate()
505 of_property_read_u32(np, "vco-offset", &icst_desc.vco_offset)) { in of_syscon_icst_setup()
506 pr_err("no VCO register offset for ICST clock\n"); in of_syscon_icst_setup()