aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/interconnect-provider.h
diff options
context:
space:
mode:
authorGeorgi Djakov <georgi.djakov@linaro.org>2019-01-16 18:10:58 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-22 13:37:25 +0100
commit87e3031b6fbd83ea83adf1bf9602bcce313ee787 (patch)
treea4c5607d1858e2459239003d3a205fb57d7bf056 /include/linux/interconnect-provider.h
parentdt-bindings: Introduce interconnect binding (diff)
downloadwireguard-linux-87e3031b6fbd83ea83adf1bf9602bcce313ee787.tar.xz
wireguard-linux-87e3031b6fbd83ea83adf1bf9602bcce313ee787.zip
interconnect: Allow endpoints translation via DT
Currently we support only platform data for specifying the interconnect endpoints. As now the endpoints are hard-coded into the consumer driver this may lead to complications when a single driver is used by multiple SoCs, which may have different interconnect topology. To avoid cluttering the consumer drivers, introduce a translation function to help us get the board specific interconnect data from device-tree. Reviewed-by: Evan Green <evgreen@chromium.org> Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/interconnect-provider.h')
-rw-r--r--include/linux/interconnect-provider.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/interconnect-provider.h b/include/linux/interconnect-provider.h
index 78208a754181..63caccadc2db 100644
--- a/include/linux/interconnect-provider.h
+++ b/include/linux/interconnect-provider.h
@@ -12,6 +12,21 @@
#define icc_units_to_bps(bw) ((bw) * 1000ULL)
struct icc_node;
+struct of_phandle_args;
+
+/**
+ * struct icc_onecell_data - driver data for onecell interconnect providers
+ *
+ * @num_nodes: number of nodes in this device
+ * @nodes: array of pointers to the nodes in this device
+ */
+struct icc_onecell_data {
+ unsigned int num_nodes;
+ struct icc_node *nodes[];
+};
+
+struct icc_node *of_icc_xlate_onecell(struct of_phandle_args *spec,
+ void *data);
/**
* struct icc_provider - interconnect provider (controller) entity that might
@@ -21,6 +36,7 @@ struct icc_node;
* @nodes: internal list of the interconnect provider nodes
* @set: pointer to device specific set operation function
* @aggregate: pointer to device specific aggregate operation function
+ * @xlate: provider-specific callback for mapping nodes from phandle arguments
* @dev: the device this interconnect provider belongs to
* @users: count of active users
* @data: pointer to private data
@@ -31,6 +47,7 @@ struct icc_provider {
int (*set)(struct icc_node *src, struct icc_node *dst);
int (*aggregate)(struct icc_node *node, u32 avg_bw, u32 peak_bw,
u32 *agg_avg, u32 *agg_peak);
+ struct icc_node* (*xlate)(struct of_phandle_args *spec, void *data);
struct device *dev;
int users;
void *data;