WIP FPC-III support
[linux/fpc-iii.git] / drivers / interconnect / imx / imx.h
blob75da51076c6813fa0137f1e7d36cd5b7ad720212
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Interconnect framework driver for i.MX SoC
5 * Copyright (c) 2019, BayLibre
6 * Copyright (c) 2019-2020, NXP
7 * Author: Alexandre Bailon <abailon@baylibre.com>
8 * Author: Leonard Crestez <leonard.crestez@nxp.com>
9 */
10 #ifndef __DRIVERS_INTERCONNECT_IMX_H
11 #define __DRIVERS_INTERCONNECT_IMX_H
13 #include <linux/kernel.h>
15 #define IMX_ICC_MAX_LINKS 4
18 * struct imx_icc_node_adj - Describe a dynamic adjustable node
20 struct imx_icc_node_adj_desc {
21 unsigned int bw_mul, bw_div;
22 const char *phandle_name;
23 bool main_noc;
27 * struct imx_icc_node - Describe an interconnect node
28 * @name: name of the node
29 * @id: an unique id to identify the node
30 * @links: an array of slaves' node id
31 * @num_links: number of id defined in links
33 struct imx_icc_node_desc {
34 const char *name;
35 u16 id;
36 u16 links[IMX_ICC_MAX_LINKS];
37 u16 num_links;
38 const struct imx_icc_node_adj_desc *adj;
41 #define DEFINE_BUS_INTERCONNECT(_name, _id, _adj, ...) \
42 { \
43 .id = _id, \
44 .name = _name, \
45 .adj = _adj, \
46 .num_links = ARRAY_SIZE(((int[]){ __VA_ARGS__ })), \
47 .links = { __VA_ARGS__ }, \
50 #define DEFINE_BUS_MASTER(_name, _id, _dest_id) \
51 DEFINE_BUS_INTERCONNECT(_name, _id, NULL, _dest_id)
53 #define DEFINE_BUS_SLAVE(_name, _id, _adj) \
54 DEFINE_BUS_INTERCONNECT(_name, _id, _adj)
56 int imx_icc_register(struct platform_device *pdev,
57 struct imx_icc_node_desc *nodes,
58 int nodes_count);
59 int imx_icc_unregister(struct platform_device *pdev);
61 #endif /* __DRIVERS_INTERCONNECT_IMX_H */