• Home
  • Raw
  • Download

Lines Matching full:icst

4  * We wrap the custom interface from <asm/hardware/icst.h> into the generic
10 * ICST clock code from the ARM tree should probably be merged into this
22 #include "icst.h"
23 #include "clk-icst.h"
37 * struct clk_icst - ICST VCO clock wrapper
41 * @params: parameters for this ICST instance
43 * @ctype: the type of control register for the ICST
58 * vco_get() - get ICST VCO settings from a certain ICST
59 * @icst: the ICST clock to get
62 static int vco_get(struct clk_icst *icst, struct icst_vco *vco) in vco_get() argument
67 ret = regmap_read(icst->map, icst->vcoreg_off, &val); in vco_get()
79 if (icst->ctype == ICST_INTEGRATOR_AP_CM) { in vco_get()
94 if (icst->ctype == ICST_INTEGRATOR_AP_SYS) { in vco_get()
109 if (icst->ctype == ICST_INTEGRATOR_AP_PCI) { in vco_get()
126 if (icst->ctype == ICST_INTEGRATOR_CP_CM_CORE) { in vco_get()
133 if (icst->ctype == ICST_INTEGRATOR_CP_CM_MEM) { in vco_get()
147 * vco_set() - commit changes to an ICST VCO
148 * @icst: the ICST clock to set
151 static int vco_set(struct clk_icst *icst, struct icst_vco vco) in vco_set() argument
158 switch (icst->ctype) { in vco_set()
163 pr_err("ICST error: tried to set bit 8 of VDW\n"); in vco_set()
165 pr_err("ICST error: tried to use VOD != 1\n"); in vco_set()
167 pr_err("ICST error: tried to use RDW != 22\n"); in vco_set()
173 pr_err("ICST error: tried to set bit 8 of VDW\n"); in vco_set()
175 pr_err("ICST error: tried to use VOD != 1\n"); in vco_set()
177 pr_err("ICST error: tried to use RDW != 22\n"); in vco_set()
183 pr_err("ICST error: tried to set bit 8 of VDW\n"); in vco_set()
185 pr_err("ICST error: tried to use RDW != 22\n"); in vco_set()
191 pr_err("ICST error: tried to set bit 8 of VDW\n"); in vco_set()
193 pr_err("ICST error: tried to use RDW != 22\n"); in vco_set()
202 pr_debug("ICST: new val = 0x%08x\n", val); in vco_set()
205 ret = regmap_write(icst->map, icst->lockreg_off, VERSATILE_LOCK_VAL); in vco_set()
208 ret = regmap_update_bits(icst->map, icst->vcoreg_off, mask, val); in vco_set()
212 ret = regmap_write(icst->map, icst->lockreg_off, 0); in vco_set()
221 struct clk_icst *icst = to_icst(hw); in icst_recalc_rate() local
226 icst->params->ref = parent_rate; in icst_recalc_rate()
227 ret = vco_get(icst, &vco); in icst_recalc_rate()
229 pr_err("ICST: could not get VCO setting\n"); in icst_recalc_rate()
232 icst->rate = icst_hz(icst->params, vco); in icst_recalc_rate()
233 return icst->rate; in icst_recalc_rate()
239 struct clk_icst *icst = to_icst(hw); in icst_round_rate() local
242 if (icst->ctype == ICST_INTEGRATOR_AP_CM || in icst_round_rate()
243 icst->ctype == ICST_INTEGRATOR_CP_CM_CORE) { in icst_round_rate()
252 if (icst->ctype == ICST_INTEGRATOR_CP_CM_MEM) { in icst_round_rate()
261 if (icst->ctype == ICST_INTEGRATOR_AP_SYS) { in icst_round_rate()
271 if (icst->ctype == ICST_INTEGRATOR_AP_PCI) { in icst_round_rate()
282 vco = icst_hz_to_vco(icst->params, rate); in icst_round_rate()
283 return icst_hz(icst->params, vco); in icst_round_rate()
289 struct clk_icst *icst = to_icst(hw); in icst_set_rate() local
292 if (icst->ctype == ICST_INTEGRATOR_AP_PCI) { in icst_set_rate()
302 pr_err("ICST: cannot set PCI frequency %lu\n", in icst_set_rate()
306 ret = regmap_write(icst->map, icst->lockreg_off, in icst_set_rate()
310 ret = regmap_update_bits(icst->map, icst->vcoreg_off, in icst_set_rate()
316 ret = regmap_write(icst->map, icst->lockreg_off, 0); in icst_set_rate()
323 icst->params->ref = parent_rate; in icst_set_rate()
324 vco = icst_hz_to_vco(icst->params, rate); in icst_set_rate()
325 icst->rate = icst_hz(icst->params, vco); in icst_set_rate()
326 return vco_set(icst, vco); in icst_set_rate()
343 struct clk_icst *icst; in icst_clk_setup() local
347 icst = kzalloc(sizeof(*icst), GFP_KERNEL); in icst_clk_setup()
348 if (!icst) in icst_clk_setup()
353 kfree(icst); in icst_clk_setup()
362 icst->map = map; in icst_clk_setup()
363 icst->hw.init = &init; in icst_clk_setup()
364 icst->params = pclone; in icst_clk_setup()
365 icst->vcoreg_off = desc->vco_offset; in icst_clk_setup()
366 icst->lockreg_off = desc->lock_offset; in icst_clk_setup()
367 icst->ctype = ctype; in icst_clk_setup()
369 clk = clk_register(dev, &icst->hw); in icst_clk_setup()
372 kfree(icst); in icst_clk_setup()
394 pr_err("could not initialize ICST regmap\n"); in icst_clk_register()
404 * In a device tree, an memory-mapped ICST clock appear as a child
494 pr_err("no parent node for syscon ICST clock\n"); in of_syscon_icst_setup()
499 pr_err("no regmap for syscon ICST clock parent\n"); in of_syscon_icst_setup()
504 pr_err("no VCO register offset for ICST clock\n"); in of_syscon_icst_setup()
508 pr_err("no lock register offset for ICST clock\n"); in of_syscon_icst_setup()
534 pr_err("unknown ICST clock %s\n", name); in of_syscon_icst_setup()
543 pr_err("error setting up syscon ICST clock %s\n", name); in of_syscon_icst_setup()
547 pr_debug("registered syscon ICST clock %s\n", name); in of_syscon_icst_setup()