xref: /OK3568_Linux_fs/kernel/drivers/interconnect/internal.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Interconnect framework internal structs
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Copyright (c) 2019, Linaro Ltd.
6*4882a593Smuzhiyun  * Author: Georgi Djakov <georgi.djakov@linaro.org>
7*4882a593Smuzhiyun  */
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun #ifndef __DRIVERS_INTERCONNECT_INTERNAL_H
10*4882a593Smuzhiyun #define __DRIVERS_INTERCONNECT_INTERNAL_H
11*4882a593Smuzhiyun 
12*4882a593Smuzhiyun /**
13*4882a593Smuzhiyun  * struct icc_req - constraints that are attached to each node
14*4882a593Smuzhiyun  * @req_node: entry in list of requests for the particular @node
15*4882a593Smuzhiyun  * @node: the interconnect node to which this constraint applies
16*4882a593Smuzhiyun  * @dev: reference to the device that sets the constraints
17*4882a593Smuzhiyun  * @enabled: indicates whether the path with this request is enabled
18*4882a593Smuzhiyun  * @tag: path tag (optional)
19*4882a593Smuzhiyun  * @avg_bw: an integer describing the average bandwidth in kBps
20*4882a593Smuzhiyun  * @peak_bw: an integer describing the peak bandwidth in kBps
21*4882a593Smuzhiyun  */
22*4882a593Smuzhiyun struct icc_req {
23*4882a593Smuzhiyun 	struct hlist_node req_node;
24*4882a593Smuzhiyun 	struct icc_node *node;
25*4882a593Smuzhiyun 	struct device *dev;
26*4882a593Smuzhiyun 	bool enabled;
27*4882a593Smuzhiyun 	u32 tag;
28*4882a593Smuzhiyun 	u32 avg_bw;
29*4882a593Smuzhiyun 	u32 peak_bw;
30*4882a593Smuzhiyun };
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun /**
33*4882a593Smuzhiyun  * struct icc_path - interconnect path structure
34*4882a593Smuzhiyun  * @name: a string name of the path (useful for ftrace)
35*4882a593Smuzhiyun  * @num_nodes: number of hops (nodes)
36*4882a593Smuzhiyun  * @reqs: array of the requests applicable to this path of nodes
37*4882a593Smuzhiyun  */
38*4882a593Smuzhiyun struct icc_path {
39*4882a593Smuzhiyun 	const char *name;
40*4882a593Smuzhiyun 	size_t num_nodes;
41*4882a593Smuzhiyun 	struct icc_req reqs[];
42*4882a593Smuzhiyun };
43*4882a593Smuzhiyun 
44*4882a593Smuzhiyun #endif
45