• Home
  • Raw
  • Download

Lines Matching full:icst

3  * We wrap the custom interface from <asm/hardware/icst.h> into the generic
13 * ICST clock code from the ARM tree should probably be merged into this
25 #include "icst.h"
26 #include "clk-icst.h"
40 * enum icst_control_type - the type of ICST control register
52 * struct clk_icst - ICST VCO clock wrapper
56 * @params: parameters for this ICST instance
58 * @ctype: the type of control register for the ICST
73 * vco_get() - get ICST VCO settings from a certain ICST
74 * @icst: the ICST clock to get
77 static int vco_get(struct clk_icst *icst, struct icst_vco *vco) in vco_get() argument
82 ret = regmap_read(icst->map, icst->vcoreg_off, &val); in vco_get()
94 if (icst->ctype == ICST_INTEGRATOR_AP_CM) { in vco_get()
109 if (icst->ctype == ICST_INTEGRATOR_AP_SYS) { in vco_get()
124 if (icst->ctype == ICST_INTEGRATOR_AP_PCI) { in vco_get()
141 if (icst->ctype == ICST_INTEGRATOR_CP_CM_CORE) { in vco_get()
148 if (icst->ctype == ICST_INTEGRATOR_CP_CM_MEM) { in vco_get()
162 * vco_set() - commit changes to an ICST VCO
163 * @icst: the ICST clock to set
166 static int vco_set(struct clk_icst *icst, struct icst_vco vco) in vco_set() argument
173 switch (icst->ctype) { in vco_set()
178 pr_err("ICST error: tried to set bit 8 of VDW\n"); in vco_set()
180 pr_err("ICST error: tried to use VOD != 1\n"); in vco_set()
182 pr_err("ICST error: tried to use RDW != 22\n"); in vco_set()
188 pr_err("ICST error: tried to set bit 8 of VDW\n"); in vco_set()
190 pr_err("ICST error: tried to use VOD != 1\n"); in vco_set()
192 pr_err("ICST error: tried to use RDW != 22\n"); in vco_set()
198 pr_err("ICST error: tried to set bit 8 of VDW\n"); in vco_set()
200 pr_err("ICST error: tried to use RDW != 22\n"); in vco_set()
206 pr_err("ICST error: tried to set bit 8 of VDW\n"); in vco_set()
208 pr_err("ICST error: tried to use RDW != 22\n"); in vco_set()
217 pr_debug("ICST: new val = 0x%08x\n", val); in vco_set()
220 ret = regmap_write(icst->map, icst->lockreg_off, VERSATILE_LOCK_VAL); in vco_set()
223 ret = regmap_update_bits(icst->map, icst->vcoreg_off, mask, val); in vco_set()
227 ret = regmap_write(icst->map, icst->lockreg_off, 0); in vco_set()
236 struct clk_icst *icst = to_icst(hw); in icst_recalc_rate() local
241 icst->params->ref = parent_rate; in icst_recalc_rate()
242 ret = vco_get(icst, &vco); in icst_recalc_rate()
244 pr_err("ICST: could not get VCO setting\n"); in icst_recalc_rate()
247 icst->rate = icst_hz(icst->params, vco); in icst_recalc_rate()
248 return icst->rate; in icst_recalc_rate()
254 struct clk_icst *icst = to_icst(hw); in icst_round_rate() local
257 if (icst->ctype == ICST_INTEGRATOR_AP_CM || in icst_round_rate()
258 icst->ctype == ICST_INTEGRATOR_CP_CM_CORE) { in icst_round_rate()
267 if (icst->ctype == ICST_INTEGRATOR_CP_CM_MEM) { in icst_round_rate()
276 if (icst->ctype == ICST_INTEGRATOR_AP_SYS) { in icst_round_rate()
286 if (icst->ctype == ICST_INTEGRATOR_AP_PCI) { in icst_round_rate()
297 vco = icst_hz_to_vco(icst->params, rate); in icst_round_rate()
298 return icst_hz(icst->params, vco); in icst_round_rate()
304 struct clk_icst *icst = to_icst(hw); in icst_set_rate() local
307 if (icst->ctype == ICST_INTEGRATOR_AP_PCI) { in icst_set_rate()
317 pr_err("ICST: cannot set PCI frequency %lu\n", in icst_set_rate()
321 ret = regmap_write(icst->map, icst->lockreg_off, in icst_set_rate()
325 ret = regmap_update_bits(icst->map, icst->vcoreg_off, in icst_set_rate()
331 ret = regmap_write(icst->map, icst->lockreg_off, 0); in icst_set_rate()
338 icst->params->ref = parent_rate; in icst_set_rate()
339 vco = icst_hz_to_vco(icst->params, rate); in icst_set_rate()
340 icst->rate = icst_hz(icst->params, vco); in icst_set_rate()
341 return vco_set(icst, vco); in icst_set_rate()
358 struct clk_icst *icst; in icst_clk_setup() local
362 icst = kzalloc(sizeof(*icst), GFP_KERNEL); in icst_clk_setup()
363 if (!icst) in icst_clk_setup()
368 kfree(icst); in icst_clk_setup()
377 icst->map = map; in icst_clk_setup()
378 icst->hw.init = &init; in icst_clk_setup()
379 icst->params = pclone; in icst_clk_setup()
380 icst->vcoreg_off = desc->vco_offset; in icst_clk_setup()
381 icst->lockreg_off = desc->lock_offset; in icst_clk_setup()
382 icst->ctype = ctype; in icst_clk_setup()
384 clk = clk_register(dev, &icst->hw); in icst_clk_setup()
387 kfree(icst); in icst_clk_setup()
408 pr_err("could not initialize ICST regmap\n"); in icst_clk_register()
418 * In a device tree, an memory-mapped ICST clock appear as a child
508 pr_err("no parent node for syscon ICST clock\n"); in of_syscon_icst_setup()
513 pr_err("no regmap for syscon ICST clock parent\n"); in of_syscon_icst_setup()
518 pr_err("no VCO register offset for ICST clock\n"); in of_syscon_icst_setup()
522 pr_err("no lock register offset for ICST clock\n"); in of_syscon_icst_setup()
548 pr_err("unknown ICST clock %s\n", name); in of_syscon_icst_setup()
557 pr_err("error setting up syscon ICST clock %s\n", name); in of_syscon_icst_setup()
561 pr_debug("registered syscon ICST clock %s\n", name); in of_syscon_icst_setup()