1
2
3
4
5
6#ifndef __DRIVERS_INTERCONNECT_QCOM_ICC_RPM_H
7#define __DRIVERS_INTERCONNECT_QCOM_ICC_RPM_H
8
9#define RPM_BUS_MASTER_REQ 0x73616d62
10#define RPM_BUS_SLAVE_REQ 0x766c7362
11
12#define QCOM_MAX_LINKS 12
13
14#define to_qcom_provider(_provider) \
15 container_of(_provider, struct qcom_icc_provider, provider)
16
17
18
19
20
21
22
23struct qcom_icc_provider {
24 struct icc_provider provider;
25 struct clk_bulk_data *bus_clks;
26 int num_clks;
27};
28
29
30
31
32
33
34
35
36
37
38
39
40struct qcom_icc_node {
41 unsigned char *name;
42 u16 id;
43 u16 links[QCOM_MAX_LINKS];
44 u16 num_links;
45 u16 buswidth;
46 int mas_rpm_id;
47 int slv_rpm_id;
48 u64 rate;
49};
50
51struct qcom_icc_desc {
52 struct qcom_icc_node **nodes;
53 size_t num_nodes;
54};
55
56#define DEFINE_QNODE(_name, _id, _buswidth, _mas_rpm_id, _slv_rpm_id, \
57 ...) \
58 static struct qcom_icc_node _name = { \
59 .name = #_name, \
60 .id = _id, \
61 .buswidth = _buswidth, \
62 .mas_rpm_id = _mas_rpm_id, \
63 .slv_rpm_id = _slv_rpm_id, \
64 .num_links = ARRAY_SIZE(((int[]){ __VA_ARGS__ })), \
65 .links = { __VA_ARGS__ }, \
66 }
67
68
69int qnoc_probe(struct platform_device *pdev, size_t cd_size, int cd_num,
70 const struct clk_bulk_data *cd);
71int qnoc_remove(struct platform_device *pdev);
72
73#endif
74