1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2018 Amarula Solutions.
4 * Author: Jagan Teki <jagan@amarulasolutions.com>
10 #include <linux/bitops.h>
13 * enum ccu_flags - ccu clock/reset flags
15 * @CCU_CLK_F_IS_VALID: is given clock gate is valid?
16 * @CCU_RST_F_IS_VALID: is given reset control is valid?
19 CCU_CLK_F_IS_VALID = BIT(0),
20 CCU_RST_F_IS_VALID = BIT(1),
24 * struct ccu_clk_gate - ccu clock gate
27 * @flags: ccu clock gate flags
35 #define GATE(_off, _bit) { \
38 .flags = CCU_CLK_F_IS_VALID, \
42 * struct ccu_reset - ccu reset
45 * @flags: ccu reset control flags
53 #define RESET(_off, _bit) { \
56 .flags = CCU_RST_F_IS_VALID, \
60 * struct ccu_desc - clock control unit descriptor
66 const struct ccu_clk_gate *gates;
67 const struct ccu_reset *resets;
71 * struct ccu_priv - sunxi clock control unit
74 * @desc: ccu descriptor
78 const struct ccu_desc *desc;
82 * sunxi_clk_probe - common sunxi clock probe
85 int sunxi_clk_probe(struct udevice *dev);
87 extern struct clk_ops sunxi_clk_ops;
90 * sunxi_reset_bind() - reset binding
94 * Return: 0 success, or error value
96 int sunxi_reset_bind(struct udevice *dev, ulong count);
98 #endif /* _CLK_SUNXI_H */