Merge tag 'locks-v4.9-1' of git://git.samba.org/jlayton/linux
[cascardo/linux.git] / drivers / clk / sunxi-ng / ccu_nkm.h
index 1936ac1..35493fd 100644 (file)
@@ -32,10 +32,33 @@ struct ccu_nkm {
        struct _ccu_mult        n;
        struct _ccu_mult        k;
        struct _ccu_div         m;
+       struct ccu_mux_internal mux;
 
        struct ccu_common       common;
 };
 
+#define SUNXI_CCU_NKM_WITH_MUX_GATE_LOCK(_struct, _name, _parents, _reg, \
+                                        _nshift, _nwidth,              \
+                                        _kshift, _kwidth,              \
+                                        _mshift, _mwidth,              \
+                                        _muxshift, _muxwidth,          \
+                                        _gate, _lock, _flags)          \
+       struct ccu_nkm _struct = {                                      \
+               .enable         = _gate,                                \
+               .lock           = _lock,                                \
+               .k              = _SUNXI_CCU_MULT(_kshift, _kwidth),    \
+               .n              = _SUNXI_CCU_MULT(_nshift, _nwidth),    \
+               .m              = _SUNXI_CCU_DIV(_mshift, _mwidth),     \
+               .mux            = _SUNXI_CCU_MUX(_muxshift, _muxwidth), \
+               .common         = {                                     \
+                       .reg            = _reg,                         \
+                       .hw.init        = CLK_HW_INIT_PARENTS(_name,    \
+                                                     _parents,         \
+                                                     &ccu_nkm_ops,     \
+                                                     _flags),          \
+               },                                                      \
+       }
+
 #define SUNXI_CCU_NKM_WITH_GATE_LOCK(_struct, _name, _parent, _reg,    \
                                     _nshift, _nwidth,                  \
                                     _kshift, _kwidth,                  \