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

clk: qcom: cpu-8996: declare ACD clocks

To simplify the code, define 1:1 fixed factor clocks to represent the
ACD pmux parent.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220714100351.1834711-4-dmitry.baryshkov@linaro.org

authored by

Dmitry Baryshkov and committed by
Bjorn Andersson
f1e3fcc4 a808c784

+41 -12
+41 -12
drivers/clk/qcom/clk-cpu-8996.c
··· 168 168 }, 169 169 }; 170 170 171 + static struct clk_fixed_factor perfcl_pll_acd = { 172 + .mult = 1, 173 + .div = 1, 174 + .hw.init = &(struct clk_init_data){ 175 + .name = "perfcl_pll_acd", 176 + .parent_data = &(const struct clk_parent_data){ 177 + .hw = &perfcl_pll.clkr.hw 178 + }, 179 + .num_parents = 1, 180 + .ops = &clk_fixed_factor_ops, 181 + .flags = CLK_SET_RATE_PARENT, 182 + }, 183 + }; 184 + 185 + static struct clk_fixed_factor pwrcl_pll_acd = { 186 + .mult = 1, 187 + .div = 1, 188 + .hw.init = &(struct clk_init_data){ 189 + .name = "pwrcl_pll_acd", 190 + .parent_data = &(const struct clk_parent_data){ 191 + .hw = &pwrcl_pll.clkr.hw 192 + }, 193 + .num_parents = 1, 194 + .ops = &clk_fixed_factor_ops, 195 + .flags = CLK_SET_RATE_PARENT, 196 + }, 197 + }; 198 + 171 199 static const struct pll_vco alt_pll_vco_modes[] = { 172 200 VCO(3, 250000000, 500000000), 173 201 VCO(2, 500000000, 750000000), ··· 356 328 static const struct clk_hw *pwrcl_pmux_parents[] = { 357 329 [SMUX_INDEX] = &pwrcl_smux.clkr.hw, 358 330 [PLL_INDEX] = &pwrcl_pll.clkr.hw, 359 - [ACD_INDEX] = &pwrcl_pll.clkr.hw, 331 + [ACD_INDEX] = &pwrcl_pll_acd.hw, 360 332 [ALT_INDEX] = &pwrcl_alt_pll.clkr.hw, 361 333 }; 362 334 363 335 static const struct clk_hw *perfcl_pmux_parents[] = { 364 336 [SMUX_INDEX] = &perfcl_smux.clkr.hw, 365 337 [PLL_INDEX] = &perfcl_pll.clkr.hw, 366 - [ACD_INDEX] = &perfcl_pll.clkr.hw, 338 + [ACD_INDEX] = &perfcl_pll_acd.hw, 367 339 [ALT_INDEX] = &perfcl_alt_pll.clkr.hw, 368 340 }; 369 341 ··· 410 382 .val_format_endian = REGMAP_ENDIAN_LITTLE, 411 383 }; 412 384 385 + static struct clk_hw *cpu_msm8996_hw_clks[] = { 386 + &pwrcl_pll_postdiv.hw, 387 + &perfcl_pll_postdiv.hw, 388 + &pwrcl_pll_acd.hw, 389 + &perfcl_pll_acd.hw, 390 + }; 391 + 413 392 static struct clk_regmap *cpu_msm8996_clks[] = { 414 393 &pwrcl_pll.clkr, 415 394 &perfcl_pll.clkr, ··· 433 398 { 434 399 int i, ret; 435 400 436 - ret = devm_clk_hw_register(dev, &pwrcl_pll_postdiv.hw); 437 - if (ret) { 438 - dev_err(dev, "Failed to register pwrcl_pll_postdiv: %d", ret); 439 - return ret; 440 - } 441 - 442 - ret = devm_clk_hw_register(dev, &perfcl_pll_postdiv.hw); 443 - if (ret) { 444 - dev_err(dev, "Failed to register perfcl_pll_postdiv: %d", ret); 445 - return ret; 401 + for (i = 0; i < ARRAY_SIZE(cpu_msm8996_hw_clks); i++) { 402 + ret = devm_clk_hw_register(dev, cpu_msm8996_hw_clks[i]); 403 + if (ret) 404 + return ret; 446 405 } 447 406 448 407 for (i = 0; i < ARRAY_SIZE(cpu_msm8996_clks); i++) {