clk: qcom: apss-ipq6018: ipq5332: add safe source switch for a53pll
authorVaradarajan Narayanan <quic_varada@quicinc.com>
Fri, 20 Oct 2023 06:19:35 +0000 (11:49 +0530)
committerBjorn Andersson <andersson@kernel.org>
Sat, 21 Oct 2023 15:48:40 +0000 (08:48 -0700)
commit00331227f42045314b3775957f2f7809fb3ac32f
tree2edb3d6d5f5985cd8bcde9c58e362fc7fe3d6d6c
parent5b7a4d3d2b33398330aef69e0ff5656273483587
clk: qcom: apss-ipq6018: ipq5332: add safe source switch for a53pll

Stromer Plus PLL found on IPQ53xx doesn't support dynamic
frequency scaling. To achieve the same, we need to park the APPS
PLL source to GPLL0, re configure the PLL and then switch the
source to APSS_PLL_EARLY.

To support this, register a clock notifier to get the PRE_RATE
and POST_RATE notification. Change the APSS PLL source to GPLL0
when PRE_RATE notification is received, then configure the PLL
and then change back the source to APSS_PLL_EARLY.

Additionally, not all SKUs of IPQ53xx support scaling. Hence,
do the above to the SKUs that support scaling.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Kathiravan T <quic_kathirav@quicinc.com>
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
Link: https://lore.kernel.org/r/49422d258d67d33a2547fbb7f4f6e72d489c2301.1697781921.git.quic_varada@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/clk/qcom/apss-ipq6018.c