]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
clk: qcom: Add support for Video Clock Controller on QCS8300
authorImran Shaik <quic_imrashai@quicinc.com>
Thu, 9 Jan 2025 08:57:49 +0000 (14:27 +0530)
committerBjorn Andersson <andersson@kernel.org>
Fri, 14 Feb 2025 17:34:50 +0000 (11:34 -0600)
The QCS8300 Video clock controller is a derivative of SA8775P, but has a
minor difference. Hence add support for QCS8300 Video clock controller by
extending the SA8775P VideoCC.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Imran Shaik <quic_imrashai@quicinc.com>
Link: https://lore.kernel.org/r/20250109-qcs8300-mm-patches-new-v4-6-63e8ac268b02@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/clk/qcom/videocc-sa8775p.c

index bf5de411fd5d634f84a924a78a4e3aa00b72f90a..db492984fd7d6565f2db9608fc37d29737121b60 100644 (file)
@@ -523,6 +523,7 @@ static struct qcom_cc_desc video_cc_sa8775p_desc = {
 };
 
 static const struct of_device_id video_cc_sa8775p_match_table[] = {
+       { .compatible = "qcom,qcs8300-videocc" },
        { .compatible = "qcom,sa8775p-videocc" },
        { }
 };
@@ -550,6 +551,13 @@ static int video_cc_sa8775p_probe(struct platform_device *pdev)
        clk_lucid_evo_pll_configure(&video_pll0, regmap, &video_pll0_config);
        clk_lucid_evo_pll_configure(&video_pll1, regmap, &video_pll1_config);
 
+       /*
+        * Set mvs0c clock divider to div-3 to make the mvs0 and
+        * mvs0c clocks to run at the same frequency on QCS8300
+        */
+       if (of_device_is_compatible(pdev->dev.of_node, "qcom,qcs8300-videocc"))
+               regmap_write(regmap, video_cc_mvs0c_div2_div_clk_src.reg, 2);
+
        /* Keep some clocks always enabled */
        qcom_branch_set_clk_en(regmap, 0x80ec); /* VIDEO_CC_AHB_CLK */
        qcom_branch_set_clk_en(regmap, 0x8144); /* VIDEO_CC_SLEEP_CLK */