]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soc: qcom: geni-se: Handle core clk in geni_se_clks_off() and geni_se_clks_on()
authorPraveen Talari <praveen.talari@oss.qualcomm.com>
Fri, 27 Feb 2026 06:15:35 +0000 (11:45 +0530)
committerBjorn Andersson <andersson@kernel.org>
Fri, 22 May 2026 02:56:38 +0000 (21:56 -0500)
Currently, core clk is handled individually in protocol drivers like
the I2C driver. Move this clock management to the common clock APIs
(geni_se_clks_on/off) that are already present in the common GENI SE
driver to maintain consistency across all protocol drivers.

Core clk is now properly managed alongside the other clocks (se->clk
and wrapper clocks) in the fundamental clock control functions,
eliminating the need for individual protocol drivers to handle this
clock separately.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Link: https://lore.kernel.org/r/20260227061544.1785978-5-praveen.talari@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/soc/qcom/qcom-geni-se.c

index 75e722cd1a940979377251d4291ef2da7596e231..2e41595ff91248ef0918720f812f356001fbe97a 100644 (file)
@@ -583,6 +583,7 @@ static void geni_se_clks_off(struct geni_se *se)
 
        clk_disable_unprepare(se->clk);
        clk_bulk_disable_unprepare(wrapper->num_clks, wrapper->clks);
+       clk_disable_unprepare(se->core_clk);
 }
 
 /**
@@ -619,7 +620,18 @@ static int geni_se_clks_on(struct geni_se *se)
 
        ret = clk_prepare_enable(se->clk);
        if (ret)
-               clk_bulk_disable_unprepare(wrapper->num_clks, wrapper->clks);
+               goto err_bulk_clks;
+
+       ret = clk_prepare_enable(se->core_clk);
+       if (ret)
+               goto err_se_clk;
+
+       return 0;
+
+err_se_clk:
+       clk_disable_unprepare(se->clk);
+err_bulk_clks:
+       clk_bulk_disable_unprepare(wrapper->num_clks, wrapper->clks);
        return ret;
 }