Commit 5dbee350 authored by Yao Zi's avatar Yao Zi Committed by Drew Fustini
Browse files

clk: thead: th1520-ap: Add macro to define multiplexers with flags



The new macro, TH_CCU_MUX_FLAGS, extends TH_CCU_MUX macro by adding two
parameters to specify clock flags and multiplexer flags.

Reviewed-by: default avatarDrew Fustini <fustini@kernel.org>
Signed-off-by: default avatarYao Zi <ziyao@disroot.org>
Signed-off-by: default avatarDrew Fustini <fustini@kernel.org>
parent 238cc631
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -101,17 +101,22 @@ struct ccu_pll {
		.flags	= _flags,					\
	}

#define TH_CCU_MUX(_name, _parents, _shift, _width)			\
#define TH_CCU_MUX_FLAGS(_name, _parents, _shift, _width, _flags,	\
			 _mux_flags)					\
	{								\
		.mask		= GENMASK(_width - 1, 0),		\
		.shift		= _shift,				\
		.flags		= _mux_flags,				\
		.hw.init	= CLK_HW_INIT_PARENTS_DATA(		\
					_name,				\
					_parents,			\
					&clk_mux_ops,			\
					0),				\
					_flags),			\
	}

#define TH_CCU_MUX(_name, _parents, _shift, _width)			\
	TH_CCU_MUX_FLAGS(_name, _parents, _shift, _width, 0, 0)

#define CCU_GATE(_clkid, _struct, _name, _parent, _reg, _bit, _flags)	\
	struct ccu_gate _struct = {					\
		.clkid	= _clkid,					\