1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2016 Maxime Ripard. All rights reserved.
9 #include <linux/clk-provider.h>
11 #include "ccu_common.h"
16 * struct ccu_nk - Definition of an N-K clock
18 * Clocks based on the formula parent * N * K
25 struct ccu_mult_internal n
;
26 struct ccu_mult_internal k
;
28 unsigned int fixed_post_div
;
30 struct ccu_common common
;
33 #define SUNXI_CCU_NK_WITH_GATE_LOCK_POSTDIV(_struct, _name, _parent, _reg, \
36 _gate, _lock, _postdiv, \
38 struct ccu_nk _struct = { \
41 .k = _SUNXI_CCU_MULT(_kshift, _kwidth), \
42 .n = _SUNXI_CCU_MULT(_nshift, _nwidth), \
43 .fixed_post_div = _postdiv, \
46 .features = CCU_FEATURE_FIXED_POSTDIV, \
47 .hw.init = CLK_HW_INIT(_name, \
54 static inline struct ccu_nk
*hw_to_ccu_nk(struct clk_hw
*hw
)
56 struct ccu_common
*common
= hw_to_ccu_common(hw
);
58 return container_of(common
, struct ccu_nk
, common
);
61 extern const struct clk_ops ccu_nk_ops
;
63 #endif /* _CCU_NK_H_ */