1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include "ccu_common.h"
9 struct ccu_mult_internal {
17 #define _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, _offset, _min, _max) \
26 #define _SUNXI_CCU_MULT_MIN(_shift, _width, _min) \
27 _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, 1, _min, 0)
29 #define _SUNXI_CCU_MULT_OFFSET(_shift, _width, _offset) \
30 _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, _offset, 1, 0)
32 #define _SUNXI_CCU_MULT(_shift, _width) \
33 _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, 1, 1, 0)
39 struct ccu_frac_internal frac;
40 struct ccu_mult_internal mult;
41 struct ccu_mux_internal mux;
42 struct ccu_common common;
45 #define SUNXI_CCU_N_WITH_GATE_LOCK(_struct, _name, _parent, _reg, \
46 _mshift, _mwidth, _gate, _lock, \
48 struct ccu_mult _struct = { \
51 .mult = _SUNXI_CCU_MULT(_mshift, _mwidth), \
54 .hw.init = CLK_HW_INIT(_name, \
61 static inline struct ccu_mult *hw_to_ccu_mult(struct clk_hw *hw)
63 struct ccu_common *common = hw_to_ccu_common(hw);
65 return container_of(common, struct ccu_mult, common);
68 extern const struct clk_ops ccu_mult_ops;
70 #endif /* _CCU_MULT_H_ */