summaryrefslogtreecommitdiff
path: root/drivers/interconnect/qcom/bcm-voter.h
diff options
context:
space:
mode:
authorDavid Dai <daidavid1@codeaurora.org>2020-02-28 13:11:40 +0300
committerGeorgi Djakov <georgi.djakov@linaro.org>2020-02-28 13:11:40 +0300
commit976daac4a1c581e5d5fd64047519fd6fcde39738 (patch)
tree711dc486d7971342b1bb267339da3fee71a4ac4d /drivers/interconnect/qcom/bcm-voter.h
parent6f690e16b5a08919feeced1dc4603aca01d7ed58 (diff)
downloadlinux-976daac4a1c581e5d5fd64047519fd6fcde39738.tar.xz
interconnect: qcom: Consolidate interconnect RPMh support
Add bcm voter driver and add support for RPMh specific interconnect providers which implements the set and aggregate functionalities that translates bandwidth requests into RPMh messages. These modules provide a common set of functionalities for all Qualcomm RPMh based interconnect providers and should help reduce code duplication when adding new providers. Signed-off-by: David Dai <daidavid1@codeaurora.org> Signed-off-by: Odelu Kukatla <okukatla@codeaurora.org> Reviewed-by: Evan Green <evgreen@chromium.org> Signed-off-by: Sibi Sankar <sibis@codeaurora.org> Link: https://lore.kernel.org/r/20200228095951.15457-1-sibis@codeaurora.org Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Diffstat (limited to 'drivers/interconnect/qcom/bcm-voter.h')
-rw-r--r--drivers/interconnect/qcom/bcm-voter.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/interconnect/qcom/bcm-voter.h b/drivers/interconnect/qcom/bcm-voter.h
new file mode 100644
index 000000000000..0f64c0bab2c0
--- /dev/null
+++ b/drivers/interconnect/qcom/bcm-voter.h
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ */
+
+#ifndef __DRIVERS_INTERCONNECT_QCOM_BCM_VOTER_H__
+#define __DRIVERS_INTERCONNECT_QCOM_BCM_VOTER_H__
+
+#include <soc/qcom/cmd-db.h>
+#include <soc/qcom/rpmh.h>
+#include <soc/qcom/tcs.h>
+
+#include "icc-rpmh.h"
+
+#define DEFINE_QBCM(_name, _bcmname, _keepalive, ...) \
+static struct qcom_icc_bcm _name = { \
+ .name = _bcmname, \
+ .keepalive = _keepalive, \
+ .num_nodes = ARRAY_SIZE(((struct qcom_icc_node *[]){ __VA_ARGS__ })), \
+ .nodes = { __VA_ARGS__ }, \
+}
+
+struct bcm_voter *of_bcm_voter_get(struct device *dev, const char *name);
+void qcom_icc_bcm_voter_add(struct bcm_voter *voter, struct qcom_icc_bcm *bcm);
+int qcom_icc_bcm_voter_commit(struct bcm_voter *voter);
+
+#endif