4 #include "ccu_common.h"
8 struct ccu_mult_internal {
16 #define _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, _offset, _min, _max) \
25 #define _SUNXI_CCU_MULT_MIN(_shift, _width, _min) \
26 _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, 1, _min, 0)
28 #define _SUNXI_CCU_MULT_OFFSET(_shift, _width, _offset) \
29 _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, _offset, 1, 0)
31 #define _SUNXI_CCU_MULT(_shift, _width) \
32 _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, 1, 1, 0)
37 struct ccu_frac_internal frac;
38 struct ccu_mult_internal mult;
39 struct ccu_mux_internal mux;
40 struct ccu_common common;
43 #define SUNXI_CCU_N_WITH_GATE_LOCK(_struct, _name, _parent, _reg, \
44 _mshift, _mwidth, _gate, _lock, \
46 struct ccu_mult _struct = { \
48 .mult = _SUNXI_CCU_MULT(_mshift, _mwidth), \
51 .hw.init = CLK_HW_INIT(_name, \
58 static inline struct ccu_mult *hw_to_ccu_mult(struct clk_hw *hw)
60 struct ccu_common *common = hw_to_ccu_common(hw);
62 return container_of(common, struct ccu_mult, common);
65 extern const struct clk_ops ccu_mult_ops;
67 #endif /* _CCU_MULT_H_ */