]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/clk/sunxi-ng/ccu_nkm.h
Merge remote-tracking branches 'asoc/topic/atmel', 'asoc/topic/chmap', 'asoc/topic...
[karo-tx-linux.git] / drivers / clk / sunxi-ng / ccu_nkm.h
index 1936ac1c6b37b505b3fabc04dc68ed35f62d9097..34580894f4d1cd7b3f7df76a780735d58d72173e 100644 (file)
@@ -29,13 +29,36 @@ struct ccu_nkm {
        u32                     enable;
        u32                     lock;
 
-       struct _ccu_mult        n;
-       struct _ccu_mult        k;
-       struct _ccu_div         m;
+       struct ccu_mult_internal        n;
+       struct ccu_mult_internal        k;
+       struct ccu_div_internal         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,                  \