1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2019 DENX Software Engineering
4 * Lukasz Majewski, DENX Software Engineering, lukma@denx.de
6 #ifndef __MACH_IMX_CLK_H
7 #define __MACH_IMX_CLK_H
9 #include <linux/clk-provider.h>
23 struct clk *clk_register_gate2(struct device *dev, const char *name,
24 const char *parent_name, unsigned long flags,
25 void __iomem *reg, u8 bit_idx, u8 cgr_val,
28 struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
29 const char *parent_name, void __iomem *base,
32 static inline struct clk *imx_clk_gate2(const char *name, const char *parent,
33 void __iomem *reg, u8 shift)
35 return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg,
39 static inline struct clk *imx_clk_fixed_factor(const char *name,
40 const char *parent, unsigned int mult, unsigned int div)
42 return clk_register_fixed_factor(NULL, name, parent,
43 CLK_SET_RATE_PARENT, mult, div);
46 static inline struct clk *imx_clk_divider(const char *name, const char *parent,
47 void __iomem *reg, u8 shift, u8 width)
49 return clk_register_divider(NULL, name, parent, CLK_SET_RATE_PARENT,
50 reg, shift, width, 0);
53 struct clk *imx_clk_pfd(const char *name, const char *parent_name,
54 void __iomem *reg, u8 idx);
56 struct clk *imx_clk_fixup_mux(const char *name, void __iomem *reg,
57 u8 shift, u8 width, const char * const *parents,
58 int num_parents, void (*fixup)(u32 *val));
60 static inline struct clk *imx_clk_mux(const char *name, void __iomem *reg,
61 u8 shift, u8 width, const char * const *parents,
64 return clk_register_mux(NULL, name, parents, num_parents,
65 CLK_SET_RATE_NO_REPARENT, reg, shift,
69 #endif /* __MACH_IMX_CLK_H */