Lines Matching refs:icst
4 * We wrap the custom interface from <asm/hardware/icst.h> into the generic
22 #include "icst.h"
23 #include "clk-icst.h"
59 * @icst: the ICST clock to get
62 static int vco_get(struct clk_icst *icst, struct icst_vco *vco)
67 ret = regmap_read(icst->map, icst->vcoreg_off, &val);
79 if (icst->ctype == ICST_INTEGRATOR_AP_CM) {
94 if (icst->ctype == ICST_INTEGRATOR_AP_SYS) {
109 if (icst->ctype == ICST_INTEGRATOR_AP_PCI) {
126 if (icst->ctype == ICST_INTEGRATOR_CP_CM_CORE) {
133 if (icst->ctype == ICST_INTEGRATOR_CP_CM_MEM) {
148 * @icst: the ICST clock to set
151 static int vco_set(struct clk_icst *icst, struct icst_vco vco)
158 switch (icst->ctype) {
205 ret = regmap_write(icst->map, icst->lockreg_off, VERSATILE_LOCK_VAL);
208 ret = regmap_update_bits(icst->map, icst->vcoreg_off, mask, val);
212 ret = regmap_write(icst->map, icst->lockreg_off, 0);
221 struct clk_icst *icst = to_icst(hw);
226 icst->params->ref = parent_rate;
227 ret = vco_get(icst, &vco);
232 icst->rate = icst_hz(icst->params, vco);
233 return icst->rate;
239 struct clk_icst *icst = to_icst(hw);
242 if (icst->ctype == ICST_INTEGRATOR_AP_CM ||
243 icst->ctype == ICST_INTEGRATOR_CP_CM_CORE) {
252 if (icst->ctype == ICST_INTEGRATOR_CP_CM_MEM) {
261 if (icst->ctype == ICST_INTEGRATOR_AP_SYS) {
271 if (icst->ctype == ICST_INTEGRATOR_AP_PCI) {
282 vco = icst_hz_to_vco(icst->params, rate);
283 return icst_hz(icst->params, vco);
289 struct clk_icst *icst = to_icst(hw);
292 if (icst->ctype == ICST_INTEGRATOR_AP_PCI) {
306 ret = regmap_write(icst->map, icst->lockreg_off,
310 ret = regmap_update_bits(icst->map, icst->vcoreg_off,
316 ret = regmap_write(icst->map, icst->lockreg_off, 0);
323 icst->params->ref = parent_rate;
324 vco = icst_hz_to_vco(icst->params, rate);
325 icst->rate = icst_hz(icst->params, vco);
326 return vco_set(icst, vco);
343 struct clk_icst *icst;
347 icst = kzalloc(sizeof(*icst), GFP_KERNEL);
348 if (!icst)
353 kfree(icst);
362 icst->map = map;
363 icst->hw.init = &init;
364 icst->params = pclone;
365 icst->vcoreg_off = desc->vco_offset;
366 icst->lockreg_off = desc->lock_offset;
367 icst->ctype = ctype;
369 clk = clk_register(dev, &icst->hw);
372 kfree(icst);