blob: 3e5d99908192e6b8e99fbada1835281006481fe2 [file] [log] [blame]
Ian Campbell643cf0e2014-05-05 11:52:23 +01001/*
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 */
Ian Campbelled41e622014-10-24 21:20:47 +010018#if defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN8I)
Chen-Yu Tsai14177e42014-10-03 20:16:25 +080019#include <asm/arch/clock_sun6i.h>
Hans de Goedee35377d2015-01-14 17:30:22 +010020#elif defined(CONFIG_MACH_SUN9I)
21#include <asm/arch/clock_sun9i.h>
Chen-Yu Tsai14177e42014-10-03 20:16:25 +080022#else
Ian Campbell643cf0e2014-05-05 11:52:23 +010023#include <asm/arch/clock_sun4i.h>
Chen-Yu Tsai14177e42014-10-03 20:16:25 +080024#endif
Ian Campbell643cf0e2014-05-05 11:52:23 +010025
26#ifndef __ASSEMBLY__
27int clock_init(void);
28int clock_twi_onoff(int port, int state);
Hans de Goede0bd51252014-11-08 14:07:27 +010029void clock_set_de_mod_clock(u32 *clk_cfg, unsigned int hz);
Ian Campbell643cf0e2014-05-05 11:52:23 +010030void clock_init_safe(void);
31void clock_init_uart(void);
32#endif
33
34#endif /* _SUNXI_CLOCK_H */