summaryrefslogtreecommitdiff
path: root/drivers/interconnect/qcom/icc-rpm.c
diff options
context:
space:
mode:
authorKonrad Dybcio <konrad.dybcio@linaro.org>2023-04-07 23:14:48 +0300
committerGeorgi Djakov <djakov@kernel.org>2023-05-21 10:25:58 +0300
commita867cf9b65eadc172bc73e56b13458742d4d050e (patch)
treec327667f8bb8ad00dadfc81b56ff33323e3d39fc /drivers/interconnect/qcom/icc-rpm.c
parent2e2113c8a64f2668baca28a82144a4f0dc22a217 (diff)
downloadlinux-a867cf9b65eadc172bc73e56b13458742d4d050e.tar.xz
interconnect: qcom: icc-rpm: Enforce 2 or 0 bus clocks
For SMD RPM bus scaling to work, we need a pair of sleep-wake clocks. The variable number of them we previously supported was only a hack to keep the clocks required for QoS register access, but now that these are separated, we can leave bus_clks to the actual bus clocks. In cases where there is no actual bus scaling (such as A0NoC on MSM8996 and GNoC on SDM660 where the HLOS is only supposed to program the QoS registers and the bus is either static or controlled remotely), allow for no clock scaling with a boolean property. Remove all the code related to allowing an arbitrary number of bus_clks, replace the number by BUS_CLK_MAX (= 2) and guard the bus clock paths to ensure they are not taken on non-scaling buses. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230228-topic-qos-v8-6-ee696a2c15a9@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
Diffstat (limited to 'drivers/interconnect/qcom/icc-rpm.c')
-rw-r--r--drivers/interconnect/qcom/icc-rpm.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c
index c34f75703a66..bebc7928af24 100644
--- a/drivers/interconnect/qcom/icc-rpm.c
+++ b/drivers/interconnect/qcom/icc-rpm.c
@@ -449,17 +449,9 @@ int qnoc_probe(struct platform_device *pdev)
for (i = 0; i < cd_num; i++)
qp->intf_clks[i].id = cds[i];
- if (desc->num_bus_clocks) {
- cds = desc->bus_clocks;
- cd_num = desc->num_bus_clocks;
- } else {
- cds = bus_clocks;
- cd_num = ARRAY_SIZE(bus_clocks);
- }
-
- for (i = 0; i < cd_num; i++)
- qp->bus_clks[i].id = cds[i];
- qp->num_bus_clks = cd_num;
+ qp->num_bus_clks = desc->no_clk_scaling ? 0 : NUM_BUS_CLKS;
+ for (i = 0; i < qp->num_bus_clks; i++)
+ qp->bus_clks[i].id = bus_clocks[i];
qp->type = desc->type;
qp->qos_offset = desc->qos_offset;