interconnect: qcom: icc-rpm: Support multiple buckets
authorLeo Yan <leo.yan@linaro.org>
Tue, 12 Jul 2022 01:59:28 +0000 (09:59 +0800)
committerGeorgi Djakov <djakov@kernel.org>
Tue, 12 Jul 2022 07:03:09 +0000 (10:03 +0300)
commitdcbce7b0a79cc5bc16759079090e1a3aa8dfea34
tree52158b3491d735f1b9a55db0fac7d6887b7decdd
parentad510e4ed2a3b6f195c2aed6fe21a311440b489b
interconnect: qcom: icc-rpm: Support multiple buckets

The current interconnect rpm driver uses a single aggregate bandwidth to
calculate the clock rates for both active and sleep clocks; therefore,
it has no chance to separate bandwidth requests for these two kinds of
clocks.

This patch studies the implementation from interconnect rpmh driver to
support multiple buckets.  The rpmh driver provides three buckets for
AMC, WAKE, and SLEEP; this driver only needs to use WAKE and SLEEP
buckets, but we keep the same way with rpmh driver, this can allow us to
reuse the DT binding and avoid to define duplicated data structures.

This patch introduces two callbacks: qcom_icc_pre_bw_aggregate() is used
to clean up bucket values before aggregate bandwidth requests, and
qcom_icc_bw_aggregate() is to aggregate bandwidth for buckets.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
Link: https://lore.kernel.org/r/20220712015929.2789881-5-leo.yan@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org>
drivers/interconnect/qcom/icc-rpm.c
drivers/interconnect/qcom/icc-rpm.h