]>
git.ipfire.org Git - thirdparty/u-boot.git/blob - include/sandbox-clk.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
4 * Lukasz Majewski, DENX Software Engineering, lukma@denx.de
7 #ifndef __SANDBOX_CLK_H__
8 #define __SANDBOX_CLK_H__
10 #include <linux/clk-provider.h>
17 SANDBOX_CLK_ECSPI_ROOT
,
20 SANDBOX_CLK_USDHC1_SEL
,
21 SANDBOX_CLK_USDHC2_SEL
,
26 enum sandbox_pllv3_type
{
27 SANDBOX_PLLV3_GENERIC
,
31 struct clk
*sandbox_clk_pllv3(enum sandbox_pllv3_type type
, const char *name
,
32 const char *parent_name
, void __iomem
*base
,
35 static inline struct clk
*sandbox_clk_fixed_factor(const char *name
,
40 return clk_register_fixed_factor(NULL
, name
, parent
,
41 CLK_SET_RATE_PARENT
, mult
, div
);
44 static inline struct clk
*sandbox_clk_divider(const char *name
,
46 void __iomem
*reg
, u8 shift
,
49 return clk_register_divider(NULL
, name
, parent
, CLK_SET_RATE_PARENT
,
50 reg
, shift
, width
, 0);
53 struct clk
*sandbox_clk_register_gate2(struct device
*dev
, const char *name
,
54 const char *parent_name
,
56 void __iomem
*reg
, u8 bit_idx
,
57 u8 cgr_val
, u8 clk_gate_flags
);
59 static inline struct clk
*sandbox_clk_gate2(const char *name
,
61 void __iomem
*reg
, u8 shift
)
63 return sandbox_clk_register_gate2(NULL
, name
, parent
,
64 CLK_SET_RATE_PARENT
, reg
, shift
,
68 static inline struct clk
*sandbox_clk_mux(const char *name
, void __iomem
*reg
,
70 const char * const *parents
,
73 return clk_register_mux(NULL
, name
, parents
, num_parents
,
74 CLK_SET_RATE_NO_REPARENT
, reg
, shift
,
78 int sandbox_clk_enable_count(struct clk
*clk
);
80 #endif /* __SANDBOX_CLK_H__ */