aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/interconnect.h
diff options
context:
space:
mode:
authorGeorgi Djakov <georgi.djakov@linaro.org>2020-07-29 15:34:39 +0300
committerGeorgi Djakov <georgi.djakov@linaro.org>2020-09-08 16:28:49 +0300
commitb41b0ce5982693e27307cfe0aaf49bc8e3a20900 (patch)
treee616cf1187c5588ad3bf1ea9ce235270673b239b /include/linux/interconnect.h
parentinterconnect: qcom: Fix small BW votes being truncated to zero (diff)
downloadwireguard-linux-b41b0ce5982693e27307cfe0aaf49bc8e3a20900.tar.xz
wireguard-linux-b41b0ce5982693e27307cfe0aaf49bc8e3a20900.zip
interconnect: Add bulk API helpers
There are drivers which just need to get multiple interconnect paths, request some predefined amounts of bandwidth and then just toggle the paths between enabled/disabled state. The aim of this patch is simplify the above and to allow drivers to put all the path names and bandwidth data into a single static icc_bulk_data table and call the icc_bulk_* functions on that table in order to scale all the interconnect paths in parallel. Suggested-by: Evan Green <evgreen@chromium.org> Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20200729123439.9961-1-georgi.djakov@linaro.org Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Diffstat (limited to 'include/linux/interconnect.h')
-rw-r--r--include/linux/interconnect.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/interconnect.h b/include/linux/interconnect.h
index 3a63d98613fc..f2dd2fc8d3cd 100644
--- a/include/linux/interconnect.h
+++ b/include/linux/interconnect.h
@@ -23,6 +23,28 @@
struct icc_path;
struct device;
+/**
+ * struct icc_bulk_data - Data used for bulk icc operations.
+ *
+ * @path: reference to the interconnect path (internal use)
+ * @name: the name from the "interconnect-names" DT property
+ * @avg_bw: average bandwidth in icc units
+ * @peak_bw: peak bandwidth in icc units
+ */
+struct icc_bulk_data {
+ struct icc_path *path;
+ const char *name;
+ u32 avg_bw;
+ u32 peak_bw;
+};
+
+int __must_check of_icc_bulk_get(struct device *dev, int num_paths,
+ struct icc_bulk_data *paths);
+void icc_bulk_put(int num_paths, struct icc_bulk_data *paths);
+int icc_bulk_set_bw(int num_paths, const struct icc_bulk_data *paths);
+int icc_bulk_enable(int num_paths, const struct icc_bulk_data *paths);
+void icc_bulk_disable(int num_paths, const struct icc_bulk_data *paths);
+
#if IS_ENABLED(CONFIG_INTERCONNECT)
struct icc_path *icc_get(struct device *dev, const int src_id,