clk-scu.h (597473720f4dc69749542bfcfed4a927a43d935e) clk-scu.h (77d8f3068c63ee0983f0b5ba3207d3f7cce11be4)
1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright 2018 NXP
4 * Dong Aisheng <aisheng.dong@nxp.com>
5 */
6
7#ifndef __IMX_CLK_SCU_H
8#define __IMX_CLK_SCU_H
9
10#include <linux/firmware/imx/sci.h>
1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright 2018 NXP
4 * Dong Aisheng <aisheng.dong@nxp.com>
5 */
6
7#ifndef __IMX_CLK_SCU_H
8#define __IMX_CLK_SCU_H
9
10#include <linux/firmware/imx/sci.h>
11#include <linux/of.h>
11
12
12int imx_clk_scu_init(void);
13extern struct list_head imx_scu_clks[];
13
14
15int imx_clk_scu_init(struct device_node *np);
16struct clk_hw *imx_scu_of_clk_src_get(struct of_phandle_args *clkspec,
17 void *data);
18struct clk_hw *imx_clk_scu_alloc_dev(const char *name,
19 const char * const *parents,
20 int num_parents, u32 rsrc_id, u8 clk_type);
21
14struct clk_hw *__imx_clk_scu(const char *name, const char * const *parents,
15 int num_parents, u32 rsrc_id, u8 clk_type);
16
22struct clk_hw *__imx_clk_scu(const char *name, const char * const *parents,
23 int num_parents, u32 rsrc_id, u8 clk_type);
24
25void imx_clk_scu_unregister(void);
26
17static inline struct clk_hw *imx_clk_scu(const char *name, u32 rsrc_id,
27static inline struct clk_hw *imx_clk_scu(const char *name, u32 rsrc_id,
18 u8 clk_type)
28 u8 clk_type, u8 clk_cells)
19{
29{
20 return __imx_clk_scu(name, NULL, 0, rsrc_id, clk_type);
30 if (clk_cells == 2)
31 return imx_clk_scu_alloc_dev(name, NULL, 0, rsrc_id, clk_type);
32 else
33 return __imx_clk_scu(name, NULL, 0, rsrc_id, clk_type);
21}
22
23static inline struct clk_hw *imx_clk_scu2(const char *name, const char * const *parents,
34}
35
36static inline struct clk_hw *imx_clk_scu2(const char *name, const char * const *parents,
24 int num_parents, u32 rsrc_id, u8 clk_type)
37 int num_parents, u32 rsrc_id, u8 clk_type,
38 u8 clk_cells)
25{
39{
26 return __imx_clk_scu(name, parents, num_parents, rsrc_id, clk_type);
40 if (clk_cells == 2)
41 return imx_clk_scu_alloc_dev(name, parents, num_parents, rsrc_id, clk_type);
42 else
43 return __imx_clk_scu(name, parents, num_parents, rsrc_id, clk_type);
27}
28
29struct clk_hw *imx_clk_lpcg_scu(const char *name, const char *parent_name,
30 unsigned long flags, void __iomem *reg,
31 u8 bit_idx, bool hw_gate);
32#endif
44}
45
46struct clk_hw *imx_clk_lpcg_scu(const char *name, const char *parent_name,
47 unsigned long flags, void __iomem *reg,
48 u8 bit_idx, bool hw_gate);
49#endif