1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2018 Amarula Solutions.
7 #ifndef _ASM_ARCH_CCU_H
8 #define _ASM_ARCH_CCU_H
11 #include <linux/bitops.h>
15 * enum ccu_flags - ccu clock/reset flags
17 * @CCU_CLK_F_IS_VALID: is given clock gate is valid?
18 * @CCU_RST_F_IS_VALID: is given reset control is valid?
21 CCU_CLK_F_IS_VALID = BIT(0),
22 CCU_RST_F_IS_VALID = BIT(1),
26 * struct ccu_clk_gate - ccu clock gate
29 * @flags: ccu clock gate flags
37 #define GATE(_off, _bit) { \
40 .flags = CCU_CLK_F_IS_VALID, \
44 * struct ccu_reset - ccu reset
47 * @flags: ccu reset control flags
55 #define RESET(_off, _bit) { \
58 .flags = CCU_RST_F_IS_VALID, \
62 * struct ccu_desc - clock control unit descriptor
68 const struct ccu_clk_gate *gates;
69 const struct ccu_reset *resets;
73 * struct ccu_priv - sunxi clock control unit
76 * @desc: ccu descriptor
80 const struct ccu_desc *desc;
84 * sunxi_clk_probe - common sunxi clock probe
87 int sunxi_clk_probe(struct udevice *dev);
89 extern struct clk_ops sunxi_clk_ops;
92 * sunxi_reset_bind() - reset binding
96 * @return 0 success, or error value
98 int sunxi_reset_bind(struct udevice *dev, ulong count);
100 #endif /* _ASM_ARCH_CCU_H */