Lines Matching +full:divider +full:- +full:width
1 // SPDX-License-Identifier: GPL-2.0-only
3 * drivers/clk/clk-axm5516.c
6 * the Axxia device: PLL clock, a clock divider and a clock mux.
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.
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
72 * @shift: Bit position for divider value
73 * @width: Number of bits in divider value
79 u32 width; 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
108 * @width: Number of bits in selection value
114 u32 width; 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()
217 .width = 4,
231 .width = 4,
245 .width = 4,
259 .width = 4,
273 .width = 4,
287 .width = 4,
301 .width = 4,
315 .width = 4,
329 .width = 4,
350 .width = 2,
367 .width = 2,
384 .width = 2,
401 .width = 2,
418 .width = 2,
435 .width = 2,
452 .width = 2,
467 .width = 1,
482 .width = 1,
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");