Commit 6f91c601 authored by Maxime Ripard's avatar Maxime Ripard

clk: sunxi-ng: div: Add mux table macros

Add some macros to ease the declaration of clocks that are using them.
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: default avatarChen-Yu Tsai <wens@csie.org>
parent c6e6c96d
...@@ -77,13 +77,16 @@ struct ccu_div { ...@@ -77,13 +77,16 @@ struct ccu_div {
_shift, _width, _table, 0, \ _shift, _width, _table, 0, \
_flags) _flags)
#define SUNXI_CCU_M_WITH_MUX_GATE(_struct, _name, _parents, _reg, \ #define SUNXI_CCU_M_WITH_MUX_TABLE_GATE(_struct, _name, \
_mshift, _mwidth, _muxshift, _muxwidth, \ _parents, _table, \
_gate, _flags) \ _reg, \
_mshift, _mwidth, \
_muxshift, _muxwidth, \
_gate, _flags) \
struct ccu_div _struct = { \ struct ccu_div _struct = { \
.enable = _gate, \ .enable = _gate, \
.div = _SUNXI_CCU_DIV(_mshift, _mwidth), \ .div = _SUNXI_CCU_DIV(_mshift, _mwidth), \
.mux = _SUNXI_CCU_MUX(_muxshift, _muxwidth), \ .mux = _SUNXI_CCU_MUX_TABLE(_muxshift, _muxwidth, _table), \
.common = { \ .common = { \
.reg = _reg, \ .reg = _reg, \
.hw.init = CLK_HW_INIT_PARENTS(_name, \ .hw.init = CLK_HW_INIT_PARENTS(_name, \
...@@ -93,12 +96,23 @@ struct ccu_div { ...@@ -93,12 +96,23 @@ struct ccu_div {
}, \ }, \
} }
#define SUNXI_CCU_M_WITH_MUX_GATE(_struct, _name, _parents, _reg, \
_mshift, _mwidth, _muxshift, _muxwidth, \
_gate, _flags) \
SUNXI_CCU_M_WITH_MUX_TABLE_GATE(_struct, _name, \
_parents, NULL, \
_reg, _mshift, _mwidth, \
_muxshift, _muxwidth, \
_gate, _flags)
#define SUNXI_CCU_M_WITH_MUX(_struct, _name, _parents, _reg, \ #define SUNXI_CCU_M_WITH_MUX(_struct, _name, _parents, _reg, \
_mshift, _mwidth, _muxshift, _muxwidth, \ _mshift, _mwidth, _muxshift, _muxwidth, \
_flags) \ _flags) \
SUNXI_CCU_M_WITH_MUX_GATE(_struct, _name, _parents, _reg, \ SUNXI_CCU_M_WITH_MUX_TABLE_GATE(_struct, _name, \
_mshift, _mwidth, _muxshift, _muxwidth, \ _parents, NULL, \
0, _flags) _reg, _mshift, _mwidth, \
_muxshift, _muxwidth, \
0, _flags)
#define SUNXI_CCU_M_WITH_GATE(_struct, _name, _parent, _reg, \ #define SUNXI_CCU_M_WITH_GATE(_struct, _name, _parent, _reg, \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment