Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

clk: qcom: msm8996-cpu: Statically define PLL dividers

This will allow for adding them to clk_parent_data arrays
in an upcoming patch.

Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220621160621.24415-3-y.oudjana@protonmail.com

authored by

Yassine Oudjana and committed by
Bjorn Andersson
de37e021 1ba0a3bb

+42 -24
+42 -24
drivers/clk/qcom/clk-cpu-8996.c
··· 135 135 }, 136 136 }; 137 137 138 + static struct clk_fixed_factor pwrcl_pll_postdiv = { 139 + .mult = 1, 140 + .div = 2, 141 + .hw.init = &(struct clk_init_data){ 142 + .name = "pwrcl_pll_postdiv", 143 + .parent_data = &(const struct clk_parent_data){ 144 + .hw = &pwrcl_pll.clkr.hw 145 + }, 146 + .num_parents = 1, 147 + .ops = &clk_fixed_factor_ops, 148 + .flags = CLK_SET_RATE_PARENT, 149 + }, 150 + }; 151 + 152 + static struct clk_fixed_factor perfcl_pll_postdiv = { 153 + .mult = 1, 154 + .div = 2, 155 + .hw.init = &(struct clk_init_data){ 156 + .name = "perfcl_pll_postdiv", 157 + .parent_data = &(const struct clk_parent_data){ 158 + .hw = &perfcl_pll.clkr.hw 159 + }, 160 + .num_parents = 1, 161 + .ops = &clk_fixed_factor_ops, 162 + .flags = CLK_SET_RATE_PARENT, 163 + }, 164 + }; 165 + 138 166 static const struct pll_vco alt_pll_vco_modes[] = { 139 167 VCO(3, 250000000, 500000000), 140 168 VCO(2, 500000000, 750000000), ··· 289 261 .name = "pwrcl_smux", 290 262 .parent_names = (const char *[]){ 291 263 "xo", 292 - "pwrcl_pll_main", 264 + "pwrcl_pll_postdiv", 293 265 }, 294 266 .num_parents = 2, 295 267 .ops = &clk_cpu_8996_mux_ops, ··· 305 277 .name = "perfcl_smux", 306 278 .parent_names = (const char *[]){ 307 279 "xo", 308 - "perfcl_pll_main", 280 + "perfcl_pll_postdiv", 309 281 }, 310 282 .num_parents = 2, 311 283 .ops = &clk_cpu_8996_mux_ops, ··· 382 354 { 383 355 int i, ret; 384 356 385 - perfcl_smux.pll = clk_hw_register_fixed_factor(dev, "perfcl_pll_main", 386 - "perfcl_pll", 387 - CLK_SET_RATE_PARENT, 388 - 1, 2); 389 - if (IS_ERR(perfcl_smux.pll)) { 390 - dev_err(dev, "Failed to initialize perfcl_pll_main\n"); 391 - return PTR_ERR(perfcl_smux.pll); 357 + ret = devm_clk_hw_register(dev, &pwrcl_pll_postdiv.hw); 358 + if (ret) { 359 + dev_err(dev, "Failed to register pwrcl_pll_postdiv: %d", ret); 360 + return ret; 392 361 } 393 362 394 - pwrcl_smux.pll = clk_hw_register_fixed_factor(dev, "pwrcl_pll_main", 395 - "pwrcl_pll", 396 - CLK_SET_RATE_PARENT, 397 - 1, 2); 398 - if (IS_ERR(pwrcl_smux.pll)) { 399 - dev_err(dev, "Failed to initialize pwrcl_pll_main\n"); 400 - clk_hw_unregister(perfcl_smux.pll); 401 - return PTR_ERR(pwrcl_smux.pll); 363 + ret = devm_clk_hw_register(dev, &perfcl_pll_postdiv.hw); 364 + if (ret) { 365 + dev_err(dev, "Failed to register perfcl_pll_postdiv: %d", ret); 366 + return ret; 402 367 } 368 + 369 + pwrcl_smux.pll = &pwrcl_pll_postdiv.hw; 370 + perfcl_smux.pll = &perfcl_pll_postdiv.hw; 403 371 404 372 for (i = 0; i < ARRAY_SIZE(cpu_msm8996_clks); i++) { 405 373 ret = devm_clk_register_regmap(dev, cpu_msm8996_clks[i]); 406 - if (ret) { 407 - clk_hw_unregister(perfcl_smux.pll); 408 - clk_hw_unregister(pwrcl_smux.pll); 374 + if (ret) 409 375 return ret; 410 - } 411 376 } 412 377 413 378 clk_alpha_pll_configure(&perfcl_pll, regmap, &hfpll_config); ··· 429 408 ret = clk_notifier_unregister(perfcl_pmux.clkr.hw.clk, &perfcl_pmux.nb); 430 409 if (ret) 431 410 return ret; 432 - 433 - clk_hw_unregister(perfcl_smux.pll); 434 - clk_hw_unregister(pwrcl_smux.pll); 435 411 436 412 return 0; 437 413 }