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
12#define icc_units_to_bps(bw) ((bw) * 1000ULL)12#define icc_units_to_bps(bw) ((bw) * 1000ULL)
13 13
14struct icc_node;14struct icc_node;
15struct 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 */
23struct icc_onecell_data {
24 unsigned int num_nodes;
25 struct icc_node *nodes[];
26};
27
28struct icc_node *of_icc_xlate_onecell(struct of_phandle_args *spec,
29 void *data);
15 30
16/**31/**
17 * struct icc_provider - interconnect provider (controller) entity that might32 * struct icc_provider - interconnect provider (controller) entity that might
@@ -21,6 +36,7 @@ struct icc_node; · 3 unmodified lines
21 * @nodes: internal list of the interconnect provider nodes36 * @nodes: internal list of the interconnect provider nodes
22 * @set: pointer to device specific set operation function37 * @set: pointer to device specific set operation function
23 * @aggregate: pointer to device specific aggregate operation function38 * @aggregate: pointer to device specific aggregate operation function
39 * @xlate: provider-specific callback for mapping nodes from phandle arguments
24 * @dev: the device this interconnect provider belongs to40 * @dev: the device this interconnect provider belongs to
25 * @users: count of active users41 * @users: count of active users
26 * @data: pointer to private data42 * @data: pointer to private data
@@ -31,6 +47,7 @@ struct icc_provider { · 4 unmodified lines
31 int (*set)(struct icc_node *src, struct icc_node *dst);47 int (*set)(struct icc_node *src, struct icc_node *dst);
32 int (*aggregate)(struct icc_node *node, u32 avg_bw, u32 peak_bw,48 int (*aggregate)(struct icc_node *node, u32 avg_bw, u32 peak_bw,
33 u32 *agg_avg, u32 *agg_peak);49 u32 *agg_avg, u32 *agg_peak);
50 struct icc_node* (*xlate)(struct of_phandle_args *spec, void *data);
34 struct device *dev;51 struct device *dev;
35 int users;52 int users;
36 void *data;53 void *data;
include/linux/interconnect.h+7−0
@@ -27,6 +27,7 @@ struct device; · 26 unmodified lines
27 27
28struct icc_path *icc_get(struct device *dev, const int src_id,28struct icc_path *icc_get(struct device *dev, const int src_id,
29 const int dst_id);29 const int dst_id);
30struct icc_path *of_icc_get(struct device *dev, const char *name);
30void icc_put(struct icc_path *path);31void icc_put(struct icc_path *path);
31int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw);32int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw);
32 33
@@ -38,6 +39,12 @@ static inline struct icc_path *icc_get(struct device *dev, const int src_id, · 5 unmodified lines
38 return NULL;39 return NULL;
39}40}
40 41
42static inline struct icc_path *of_icc_get(struct device *dev,
43 const char *name)
44{
45 return NULL;
46}
47
41static inline void icc_put(struct icc_path *path)48static inline void icc_put(struct icc_path *path)
42{49{
43}50}

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