1 /*
2  * (C) Copyright 2007-2011
3  * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
4  * Tom Cubie <tangliang@allwinnertech.com>
5  *
6  * SPDX-License-Identifier:	GPL-2.0+
7  */
8 
9 #ifndef _SUNXI_CLOCK_H
10 #define _SUNXI_CLOCK_H
11 
12 #include <linux/types.h>
13 
14 #define CLK_GATE_OPEN			0x1
15 #define CLK_GATE_CLOSE			0x0
16 
17 /* clock control module regs definition */
18 #if defined(CONFIG_MACH_SUN8I_A83T)
19 #include <asm/arch/clock_sun8i_a83t.h>
20 #elif defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN8I) || \
21       defined(CONFIG_MACH_SUN50I)
22 #include <asm/arch/clock_sun6i.h>
23 #elif defined(CONFIG_MACH_SUN9I)
24 #include <asm/arch/clock_sun9i.h>
25 #else
26 #include <asm/arch/clock_sun4i.h>
27 #endif
28 
29 #ifndef __ASSEMBLY__
30 int clock_init(void);
31 int clock_twi_onoff(int port, int state);
32 void clock_set_de_mod_clock(u32 *clk_cfg, unsigned int hz);
33 void clock_init_safe(void);
34 void clock_init_sec(void);
35 void clock_init_uart(void);
36 #endif
37 
38 #endif /* _SUNXI_CLOCK_H */
39