Lines Matching +full:mpfs +full:- +full:ccc
1 // SPDX-License-Identifier: GPL-2.0-only
7 #include <linux/clk-provider.h>
12 #include <dt-bindings/clock/microchip,mpfs-clock.h>
58 * mpfs_ccc_lock prevents anything else from writing to a fabric ccc
76 void __iomem *mult_addr = ccc_hw->base + ccc_hw->reg_offset; in mpfs_ccc_pll_recalc_rate()
77 void __iomem *ref_div_addr = ccc_hw->base + MPFS_CCC_REF_CR; in mpfs_ccc_pll_recalc_rate()
91 void __iomem *pll_cr_addr = ccc_hw->base + MPFS_CCC_PLL_CR; in mpfs_ccc_pll_get_parent()
167 char *name = devm_kasprintf(dev, GFP_KERNEL, "%s_out%u", parent->name, i); in mpfs_ccc_register_outputs()
170 return -ENOMEM; in mpfs_ccc_register_outputs()
172 out_hw->divider.hw.init = CLK_HW_INIT_HW(name, &parent->hw, &clk_divider_ops, 0); in mpfs_ccc_register_outputs()
173 out_hw->divider.reg = data->pll_base[i / MPFS_CCC_OUTPUTS_PER_PLL] + in mpfs_ccc_register_outputs()
174 out_hw->reg_offset; in mpfs_ccc_register_outputs()
176 ret = devm_clk_hw_register(dev, &out_hw->divider.hw); in mpfs_ccc_register_outputs()
179 out_hw->id); in mpfs_ccc_register_outputs()
181 data->hw_data.hws[out_hw->id] = &out_hw->divider.hw; in mpfs_ccc_register_outputs()
204 pll_hw->name = devm_kasprintf(dev, GFP_KERNEL, "ccc%s_pll%u", in mpfs_ccc_register_plls()
205 strchrnul(dev->of_node->full_name, '@'), i); in mpfs_ccc_register_plls()
206 if (!pll_hw->name) in mpfs_ccc_register_plls()
207 return -ENOMEM; in mpfs_ccc_register_plls()
209 pll_hw->base = data->pll_base[i]; in mpfs_ccc_register_plls()
210 pll_hw->hw.init = CLK_HW_INIT_PARENTS_DATA_FIXED_SIZE(pll_hw->name, in mpfs_ccc_register_plls()
211 pll_hw->parents, in mpfs_ccc_register_plls()
214 ret = devm_clk_hw_register(dev, &pll_hw->hw); in mpfs_ccc_register_plls()
216 return dev_err_probe(dev, ret, "failed to register ccc id: %d\n", in mpfs_ccc_register_plls()
217 pll_hw->id); in mpfs_ccc_register_plls()
219 data->hw_data.hws[pll_hw->id] = &pll_hw->hw; in mpfs_ccc_register_plls()
240 clk_data = devm_kzalloc(&pdev->dev, struct_size(clk_data, hw_data.hws, num_clks), in mpfs_ccc_probe()
243 return -ENOMEM; in mpfs_ccc_probe()
253 clk_data->pll_base = pll_base; in mpfs_ccc_probe()
254 clk_data->hw_data.num = num_clks; in mpfs_ccc_probe()
255 clk_data->dev = &pdev->dev; in mpfs_ccc_probe()
257 ret = mpfs_ccc_register_plls(clk_data->dev, mpfs_ccc_pll_clks, in mpfs_ccc_probe()
262 return devm_of_clk_add_hw_provider(clk_data->dev, of_clk_hw_onecell_get, in mpfs_ccc_probe()
263 &clk_data->hw_data); in mpfs_ccc_probe()
267 { .compatible = "microchip,mpfs-ccc", },
275 .name = "microchip-mpfs-ccc",