Lines Matching +full:reg +full:- +full:shift

1 // SPDX-License-Identifier: GPL-2.0-only
3 * drivers/clk/clk-axm5516.c
16 #include <linux/clk-provider.h>
18 #include <dt-bindings/clock/lsi,axm5516-clks.h>
22 * struct axxia_clk - Common struct to all Axxia clocks.
33 * struct axxia_pllclk - Axxia PLL generated clock.
35 * @reg: Offset into regmap for PLL control register
39 u32 reg; member
44 * axxia_pllclk_recalc - Calculate the PLL generated clock rate given the
55 regmap_read(aclk->regmap, pll->reg, &control); in axxia_pllclk_recalc()
69 * struct axxia_divclk - Axxia clock divider
71 * @reg: Offset into regmap for PLL control register
72 * @shift: Bit position for divider value
77 u32 reg; member
78 u32 shift; member
84 * axxia_divclk_recalc_rate - Calculate clock divider output rage
93 regmap_read(aclk->regmap, divclk->reg, &ctrl); in axxia_divclk_recalc_rate()
94 div = 1 + ((ctrl >> divclk->shift) & ((1 << divclk->width)-1)); in axxia_divclk_recalc_rate()
104 * struct axxia_clkmux - Axxia clock mux
106 * @reg: Offset into regmap for PLL control register
107 * @shift: Bit position for selection value
112 u32 reg; member
113 u32 shift; member
119 * axxia_clkmux_get_parent - Return the index of selected parent clock
127 regmap_read(aclk->regmap, mux->reg, &ctrl); in axxia_clkmux_get_parent()
128 parent = (ctrl >> mux->shift) & ((1 << mux->width) - 1); in axxia_clkmux_get_parent()
151 .reg = 0x01800,
163 .reg = 0x02000,
175 .reg = 0x02800,
187 .reg = 0x03000,
199 .reg = 0x03800,
215 .reg = 0x10008,
216 .shift = 0,
229 .reg = 0x10008,
230 .shift = 4,
243 .reg = 0x10008,
244 .shift = 8,
257 .reg = 0x10008,
258 .shift = 12,
271 .reg = 0x1000c,
272 .shift = 0,
285 .reg = 0x1000c,
286 .shift = 4,
299 .reg = 0x1000c,
300 .shift = 8,
313 .reg = 0x1000c,
314 .shift = 12,
327 .reg = 0x1000c,
328 .shift = 16,
348 .reg = 0x10000,
349 .shift = 0,
365 .reg = 0x10000,
366 .shift = 2,
382 .reg = 0x10000,
383 .shift = 4,
399 .reg = 0x10000,
400 .shift = 6,
416 .reg = 0x10004,
417 .shift = 0,
433 .reg = 0x10004,
434 .shift = 2,
450 .reg = 0x10004,
451 .shift = 4,
465 .reg = 0x10004,
466 .shift = 6,
480 .reg = 0x10004,
481 .shift = 9,
517 unsigned int idx = clkspec->args[0]; in of_clk_axmclk_get()
521 return ERR_PTR(-EINVAL); in of_clk_axmclk_get()
524 return &axmclk_clocks[idx]->hw; in of_clk_axmclk_get()
536 { .compatible = "lsi,axm5516-clks" },
545 struct device *dev = &pdev->dev; in axmclk_probe()
564 axmclk_clocks[i]->regmap = regmap; in axmclk_probe()
565 ret = devm_clk_hw_register(dev, &axmclk_clocks[i]->hw); in axmclk_probe()
576 .name = "clk-axm5516",
595 MODULE_ALIAS("platform:clk-axm5516");