1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2018 Amarula Solutions.
4 * Author: Jagan Teki <jagan@amarulasolutions.com>
7 #ifndef _ASM_ARCH_CCU_H
8 #define _ASM_ARCH_CCU_H
11 * enum ccu_flags - ccu clock/reset flags
13 * @CCU_CLK_F_IS_VALID: is given clock gate is valid?
14 * @CCU_RST_F_IS_VALID: is given reset control is valid?
17 CCU_CLK_F_IS_VALID = BIT(0),
18 CCU_RST_F_IS_VALID = BIT(1),
22 * struct ccu_clk_gate - ccu clock gate
25 * @flags: ccu clock gate flags
33 #define GATE(_off, _bit) { \
36 .flags = CCU_CLK_F_IS_VALID, \
40 * struct ccu_reset - ccu reset
43 * @flags: ccu reset control flags
51 #define RESET(_off, _bit) { \
54 .flags = CCU_RST_F_IS_VALID, \
58 * struct ccu_desc - clock control unit descriptor
64 const struct ccu_clk_gate *gates;
65 const struct ccu_reset *resets;
69 * struct ccu_priv - sunxi clock control unit
72 * @desc: ccu descriptor
76 const struct ccu_desc *desc;
80 * sunxi_clk_probe - common sunxi clock probe
83 int sunxi_clk_probe(struct udevice *dev);
85 extern struct clk_ops sunxi_clk_ops;
88 * sunxi_reset_bind() - reset binding
92 * @return 0 success, or error value
94 int sunxi_reset_bind(struct udevice *dev, ulong count);
96 #endif /* _ASM_ARCH_CCU_H */