History

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.

Georgi Djakov committed 7 years ago

Commit 87e30311 parent 06b37733 files · +173 −0Browse files

Showing the changes to include/linux (2 of 3 files). Show all

Unified · Split

2 files
  1. include/linux/interconnect-provider.h +17 −0
  2. include/linux/interconnect.h +7 −0
include/linux/interconnect-provider.h+17−0
@@ -12,6 +12,21 @@ · 11 unmodified lines
1212 #define icc_units_to_bps(bw) ((bw) * 1000ULL)
1313
1414 struct icc_node;
15+struct of_phandle_args;
16+
17+/**
18+ * struct icc_onecell_data - driver data for onecell interconnect providers
19+ *
20+ * @num_nodes: number of nodes in this device
21+ * @nodes: array of pointers to the nodes in this device
22+ */
23+struct icc_onecell_data {
24+ unsigned int num_nodes;
25+ struct icc_node *nodes[];
26+};
27+
28+struct icc_node *of_icc_xlate_onecell(struct of_phandle_args *spec,
29+ void *data);
1530
1631 /**
1732 * struct icc_provider - interconnect provider (controller) entity that might
@@ -21,6 +36,7 @@ struct icc_node; · 3 unmodified lines
2136 * @nodes: internal list of the interconnect provider nodes
2237 * @set: pointer to device specific set operation function
2338 * @aggregate: pointer to device specific aggregate operation function
39+ * @xlate: provider-specific callback for mapping nodes from phandle arguments
2440 * @dev: the device this interconnect provider belongs to
2541 * @users: count of active users
2642 * @data: pointer to private data
@@ -31,6 +47,7 @@ struct icc_provider { · 4 unmodified lines
3147 int (*set)(struct icc_node *src, struct icc_node *dst);
3248 int (*aggregate)(struct icc_node *node, u32 avg_bw, u32 peak_bw,
3349 u32 *agg_avg, u32 *agg_peak);
50+ struct icc_node* (*xlate)(struct of_phandle_args *spec, void *data);
3451 struct device *dev;
3552 int users;
3653 void *data;
include/linux/interconnect.h+7−0
@@ -27,6 +27,7 @@ struct device; · 26 unmodified lines
2727
2828 struct icc_path *icc_get(struct device *dev, const int src_id,
2929 const int dst_id);
30+struct icc_path *of_icc_get(struct device *dev, const char *name);
3031 void icc_put(struct icc_path *path);
3132 int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw);
3233
@@ -38,6 +39,12 @@ static inline struct icc_path *icc_get(struct device *dev, const int src_id, · 5 unmodified lines
3839 return NULL;
3940 }
4041
42+static inline struct icc_path *of_icc_get(struct device *dev,
43+ const char *name)
44+{
45+ return NULL;
46+}
47+
4148 static inline void icc_put(struct icc_path *path)
4249 {
4350 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t