Lines Matching +full:dclk +full:- +full:div
1 // SPDX-License-Identifier: GPL-2.0-only
4 * Copyright (C) 2013 ST-Ericsson AB
14 #include <linux/clk-provider.h>
74 pr_crit("force-enabling MXTALO\n"); in nomadik_clk_reboot_handler()
84 { .compatible = "stericsson,nomadik-src" },
122 if (of_property_read_bool(np, "disable-sxtalo")) { in nomadik_src_init()
127 if (of_property_read_bool(np, "disable-mxtalo")) { in nomadik_src_init()
141 * struct clk_pll1 - Nomadik PLL1 clock
151 * struct clk_src - Nomadik src clock
174 if (pll->id == 1) { in pll_clk_enable()
179 } else if (pll->id == 2) { in pll_clk_enable()
194 if (pll->id == 1) { in pll_clk_disable()
199 } else if (pll->id == 2) { in pll_clk_disable()
212 if (pll->id == 1) { in pll_clk_is_enabled()
215 } else if (pll->id == 2) { in pll_clk_is_enabled()
229 if (pll->id == 1) { in pll_clk_recalc_rate()
231 u8 div; in pll_clk_recalc_rate() local
235 div = val & 0x07U; in pll_clk_recalc_rate()
236 return (parent_rate * mul) >> div; in pll_clk_recalc_rate()
239 if (pll->id == 2) { in pll_clk_recalc_rate()
269 return ERR_PTR(-EINVAL); in pll_clk_register()
274 return ERR_PTR(-ENOMEM); in pll_clk_register()
280 pll->hw.init = &init; in pll_clk_register()
281 pll->id = id; in pll_clk_register()
285 ret = clk_hw_register(dev, &pll->hw); in pll_clk_register()
291 return &pll->hw; in pll_clk_register()
296 * you read-modify-write a register. Instead there are separate
306 u32 enreg = sclk->group1 ? SRC_PCKEN1 : SRC_PCKEN0; in src_clk_enable()
307 u32 sreg = sclk->group1 ? SRC_PCKSR1 : SRC_PCKSR0; in src_clk_enable()
309 writel(sclk->clkbit, src_base + enreg); in src_clk_enable()
311 while (!(readl(src_base + sreg) & sclk->clkbit)) in src_clk_enable()
319 u32 disreg = sclk->group1 ? SRC_PCKDIS1 : SRC_PCKDIS0; in src_clk_disable()
320 u32 sreg = sclk->group1 ? SRC_PCKSR1 : SRC_PCKSR0; in src_clk_disable()
322 writel(sclk->clkbit, src_base + disreg); in src_clk_disable()
324 while (readl(src_base + sreg) & sclk->clkbit) in src_clk_disable()
331 u32 sreg = sclk->group1 ? SRC_PCKSR1 : SRC_PCKSR0; in src_clk_is_enabled()
334 return !!(val & sclk->clkbit); in src_clk_is_enabled()
361 return ERR_PTR(-ENOMEM); in src_clk_register()
365 /* Do not force-disable the static SDRAM controller */ in src_clk_register()
372 sclk->hw.init = &init; in src_clk_register()
373 sclk->id = id; in src_clk_register()
374 sclk->group1 = (id > 31); in src_clk_register()
375 sclk->clkbit = BIT(id & 0x1f); in src_clk_register()
378 name, id, sclk->group1, sclk->clkbit); in src_clk_register()
380 ret = clk_hw_register(dev, &sclk->hw); in src_clk_register()
386 return &sclk->hw; in src_clk_register()
453 "3DCLK ",
491 return -ENODEV; in nomadik_src_clk_init_debugfs()
494 debugfs_create_file("nomadik-src-clk", S_IFREG | S_IRUGO, in nomadik_src_clk_init_debugfs()
505 const char *clk_name = np->name; in of_nomadik_pll_setup()
512 if (of_property_read_u32(np, "pll-id", &pll_id)) { in of_nomadik_pll_setup()
513 pr_err("%s: PLL \"%s\" missing pll-id property\n", in of_nomadik_pll_setup()
523 "st,nomadik-pll-clock", of_nomadik_pll_setup);
528 const char *clk_name = np->name; in of_nomadik_hclk_setup()
547 "st,nomadik-hclk-clock", of_nomadik_hclk_setup);
552 const char *clk_name = np->name; in of_nomadik_src_clk_setup()
559 if (of_property_read_u32(np, "clock-id", &clk_id)) { in of_nomadik_src_clk_setup()
560 pr_err("%s: SRC clock \"%s\" missing clock-id property\n", in of_nomadik_src_clk_setup()
570 "st,nomadik-src-clock", of_nomadik_src_clk_setup);