1 /* SPDX-License-Identifier: GPL-2.0 */
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>
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
;
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
{
36 u16 links
[IMX_ICC_MAX_LINKS
];
38 const struct imx_icc_node_adj_desc
*adj
;
41 #define DEFINE_BUS_INTERCONNECT(_name, _id, _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
,
59 int imx_icc_unregister(struct platform_device
*pdev
);
61 #endif /* __DRIVERS_INTERCONNECT_IMX_H */