Lines Matching +full:reg +full:- +full:names

6  * Tero Kristo <t-kristo@ti.com>
19 #include <linux/clk-provider.h>
48 static void clk_memmap_writel(u32 val, const struct clk_omap_reg *reg) in clk_memmap_writel() argument
50 struct clk_iomap *io = clk_memmaps[reg->index]; in clk_memmap_writel()
52 if (reg->ptr) in clk_memmap_writel()
53 writel_relaxed(val, reg->ptr); in clk_memmap_writel()
54 else if (io->regmap) in clk_memmap_writel()
55 regmap_write(io->regmap, reg->offset, val); in clk_memmap_writel()
57 writel_relaxed(val, io->mem + reg->offset); in clk_memmap_writel()
70 static void clk_memmap_rmw(u32 val, u32 mask, const struct clk_omap_reg *reg) in clk_memmap_rmw() argument
72 struct clk_iomap *io = clk_memmaps[reg->index]; in clk_memmap_rmw()
74 if (reg->ptr) { in clk_memmap_rmw()
75 _clk_rmw(val, mask, reg->ptr); in clk_memmap_rmw()
76 } else if (io->regmap) { in clk_memmap_rmw()
77 regmap_update_bits(io->regmap, reg->offset, mask, val); in clk_memmap_rmw()
79 _clk_rmw(val, mask, io->mem + reg->offset); in clk_memmap_rmw()
83 static u32 clk_memmap_readl(const struct clk_omap_reg *reg) in clk_memmap_readl() argument
86 struct clk_iomap *io = clk_memmaps[reg->index]; in clk_memmap_readl()
88 if (reg->ptr) in clk_memmap_readl()
89 val = readl_relaxed(reg->ptr); in clk_memmap_readl()
90 else if (io->regmap) in clk_memmap_readl()
91 regmap_read(io->regmap, reg->offset, &val); in clk_memmap_readl()
93 val = readl_relaxed(io->mem + reg->offset); in clk_memmap_readl()
99 * ti_clk_setup_ll_ops - setup low level clock operations
104 * specific code. Returns 0 on success, -EBUSY if ll_ops have been
111 return -EBUSY; in ti_clk_setup_ll_ops()
115 ops->clk_readl = clk_memmap_readl; in ti_clk_setup_ll_ops()
116 ops->clk_writel = clk_memmap_writel; in ti_clk_setup_ll_ops()
117 ops->clk_rmw = clk_memmap_rmw; in ti_clk_setup_ll_ops()
123 * ti_dt_clocks_register - register DT alias clocks during boot
126 * Register alias or non-standard DT clock entries during boot. By
128 * additional con-id / dev-id -> clock mapping is required, use this
147 compat_mode = ti_clk_get_features()->flags & TI_CLK_CLKCTRL_COMPAT; in ti_dt_clocks_register()
149 for (c = oclks; c->node_name != NULL; c++) { in ti_dt_clocks_register()
150 strcpy(buf, c->node_name); in ti_dt_clocks_register()
159 c->node_name); in ti_dt_clocks_register()
186 c->node_name, i, tags[i]); in ti_dt_clocks_register()
194 c->lk.clk = clk; in ti_dt_clocks_register()
195 clkdev_add(&c->lk); in ti_dt_clocks_register()
214 c->node_name, PTR_ERR(clk)); in ti_dt_clocks_register()
229 * ti_clk_retry_init - retries a failed clock init at later phase
245 return -ENOMEM; in ti_clk_retry_init()
247 retry->node = node; in ti_clk_retry_init()
248 retry->func = func; in ti_clk_retry_init()
249 retry->user = user; in ti_clk_retry_init()
250 list_add(&retry->link, &retry_list); in ti_clk_retry_init()
256 * ti_clk_get_reg_addr - get register address for a clock register
259 * @reg: pointer to target register struct
262 * the data via the provided output pointer @reg. Returns 0 on success,
266 struct clk_omap_reg *reg) in ti_clk_get_reg_addr() argument
272 if (clocks_node_ptr[i] == node->parent) in ti_clk_get_reg_addr()
277 pr_err("clk-provider not found for %pOFn!\n", node); in ti_clk_get_reg_addr()
278 return -ENOENT; in ti_clk_get_reg_addr()
281 reg->index = i; in ti_clk_get_reg_addr()
283 if (of_property_read_u32_index(node, "reg", index, &val)) { in ti_clk_get_reg_addr()
284 pr_err("%pOFn must have reg[%d]!\n", node, index); in ti_clk_get_reg_addr()
285 return -EINVAL; in ti_clk_get_reg_addr()
288 reg->offset = val; in ti_clk_get_reg_addr()
289 reg->ptr = NULL; in ti_clk_get_reg_addr()
294 void ti_clk_latch(struct clk_omap_reg *reg, s8 shift) in ti_clk_latch() argument
303 ti_clk_ll_ops->clk_rmw(latch, latch, reg); in ti_clk_latch()
304 ti_clk_ll_ops->clk_rmw(0, latch, reg); in ti_clk_latch()
305 ti_clk_ll_ops->clk_readl(reg); /* OCP barrier */ in ti_clk_latch()
309 * omap2_clk_provider_init - init master clock provider
332 return -EINVAL; in omap2_clk_provider_init()
340 return -ENOMEM; in omap2_clk_provider_init()
342 io->regmap = syscon; in omap2_clk_provider_init()
343 io->mem = mem; in omap2_clk_provider_init()
351 * omap2_clk_legacy_provider_init - initialize a legacy clock provider
366 io->mem = mem; in omap2_clk_legacy_provider_init()
372 * ti_dt_clk_init_retry_clks - init clocks from the retry list
387 pr_debug("retry-init: %pOFn\n", retry->node); in ti_dt_clk_init_retry_clks()
388 retry->func(retry->user, retry->node); in ti_dt_clk_init_retry_clks()
389 list_del(&retry->link); in ti_dt_clk_init_retry_clks()
392 retries--; in ti_dt_clk_init_retry_clks()
397 { .compatible = "fixed-clock" },
398 { .compatible = "fixed-factor-clock" },
403 * ti_clk_add_aliases - setup clock aliases
418 ti_clk_add_alias(NULL, clk, np->name); in ti_clk_add_aliases()
423 * ti_clk_setup_features - setup clock features flags
435 * ti_clk_get_features - get clock driver features flags
446 * omap2_clk_enable_init_clocks - prepare & enable a list of clocks
447 * @clk_names: ptr to an array of strings of clock names to enable
448 * @num_clocks: number of clock names in @clk_names
470 * ti_clk_add_alias - add a clock alias for a TI clock
491 return -ENOMEM; in ti_clk_add_alias()
494 cl->dev_id = dev_name(dev); in ti_clk_add_alias()
495 cl->con_id = con; in ti_clk_add_alias()
496 cl->clk = clk; in ti_clk_add_alias()
504 * ti_clk_register - register a TI clock to the common clock framework
533 * ti_clk_register_omap_hw - register a clk_hw_omap to the clock framework
555 list_add(&oclk->node, &clk_hw_omap_clocks); in ti_clk_register_omap_hw()
561 * omap2_clk_for_each - call function for each registered clk_hw_omap
566 * failure. If @fn returns non-zero, the iteration across clocks
567 * will stop and the non-zero return value will be passed to the
585 * omap2_clk_is_hw_omap - check if the provided clk_hw is OMAP clock
596 if (&oclk->hw == hw) in omap2_clk_is_hw_omap()