1 /* SPDX-License-Identifier: GPL-2.0+ */
4 * Dong Aisheng <aisheng.dong@nxp.com>
7 #ifndef __IMX_CLK_SCU_H
8 #define __IMX_CLK_SCU_H
10 #include <linux/firmware/imx/sci.h>
13 extern struct list_head imx_scu_clks
[];
14 extern const struct dev_pm_ops imx_clk_lpcg_scu_pm_ops
;
16 int imx_clk_scu_init(struct device_node
*np
);
17 struct clk_hw
*imx_scu_of_clk_src_get(struct of_phandle_args
*clkspec
,
19 struct clk_hw
*imx_clk_scu_alloc_dev(const char *name
,
20 const char * const *parents
,
21 int num_parents
, u32 rsrc_id
, u8 clk_type
);
23 struct clk_hw
*__imx_clk_scu(struct device
*dev
, const char *name
,
24 const char * const *parents
, int num_parents
,
25 u32 rsrc_id
, u8 clk_type
);
27 void imx_clk_scu_unregister(void);
29 struct clk_hw
*__imx_clk_lpcg_scu(struct device
*dev
, const char *name
,
30 const char *parent_name
, unsigned long flags
,
31 void __iomem
*reg
, u8 bit_idx
, bool hw_gate
);
32 void imx_clk_lpcg_scu_unregister(struct clk_hw
*hw
);
34 static inline struct clk_hw
*imx_clk_scu(const char *name
, u32 rsrc_id
,
35 u8 clk_type
, u8 clk_cells
)
38 return imx_clk_scu_alloc_dev(name
, NULL
, 0, rsrc_id
, clk_type
);
40 return __imx_clk_scu(NULL
, name
, NULL
, 0, rsrc_id
, clk_type
);
43 static inline struct clk_hw
*imx_clk_scu2(const char *name
, const char * const *parents
,
44 int num_parents
, u32 rsrc_id
, u8 clk_type
,
48 return imx_clk_scu_alloc_dev(name
, parents
, num_parents
, rsrc_id
, clk_type
);
50 return __imx_clk_scu(NULL
, name
, parents
, num_parents
, rsrc_id
, clk_type
);
53 static inline struct clk_hw
*imx_clk_lpcg_scu_dev(struct device
*dev
, const char *name
,
54 const char *parent_name
, unsigned long flags
,
55 void __iomem
*reg
, u8 bit_idx
, bool hw_gate
)
57 return __imx_clk_lpcg_scu(dev
, name
, parent_name
, flags
, reg
,
61 static inline struct clk_hw
*imx_clk_lpcg_scu(const char *name
, const char *parent_name
,
62 unsigned long flags
, void __iomem
*reg
,
63 u8 bit_idx
, bool hw_gate
)
65 return __imx_clk_lpcg_scu(NULL
, name
, parent_name
, flags
, reg
,