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

clk: qcom: cbf-msm8996: Add support for MSM8996 Pro

The CBF PLL on MSM8996 Pro has a /4 post divisor instead of /2. Handle the
difference accordingly.

Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20230527093934.101335-4-y.oudjana@protonmail.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>

authored by

Yassine Oudjana and committed by
Bjorn Andersson
bc48641a 434cb577

+8 -2
+8 -2
drivers/clk/qcom/clk-cbf-8996.c
··· 52 52 [PLL_OFF_STATUS] = 0x28, 53 53 }; 54 54 55 - static const struct alpha_pll_config cbfpll_config = { 55 + static struct alpha_pll_config cbfpll_config = { 56 56 .l = 72, 57 57 .config_ctl_val = 0x200d4828, 58 58 .config_ctl_hi_val = 0x006, ··· 141 141 { 142 142 struct clk_hw *parent; 143 143 144 - if (req->rate < (DIV_THRESHOLD / 2)) 144 + if (req->rate < (DIV_THRESHOLD / cbf_pll_postdiv.div)) 145 145 return -EINVAL; 146 146 147 147 if (req->rate < DIV_THRESHOLD) ··· 312 312 /* Switch CBF to use the primary PLL */ 313 313 regmap_update_bits(regmap, CBF_MUX_OFFSET, CBF_MUX_PARENT_MASK, 0x1); 314 314 315 + if (of_device_is_compatible(dev->of_node, "qcom,msm8996pro-cbf")) { 316 + cbfpll_config.post_div_val = 0x3 << 8; 317 + cbf_pll_postdiv.div = 4; 318 + } 319 + 315 320 for (i = 0; i < ARRAY_SIZE(cbf_msm8996_hw_clks); i++) { 316 321 ret = devm_clk_hw_register(dev, cbf_msm8996_hw_clks[i]); 317 322 if (ret) ··· 347 342 348 343 static const struct of_device_id qcom_msm8996_cbf_match_table[] = { 349 344 { .compatible = "qcom,msm8996-cbf" }, 345 + { .compatible = "qcom,msm8996pro-cbf" }, 350 346 { /* sentinel */ }, 351 347 }; 352 348 MODULE_DEVICE_TABLE(of, qcom_msm8996_cbf_match_table);