drivers/clk/actions/owl-composite.h

Source file repositories/reference/linux-study-clean/drivers/clk/actions/owl-composite.h

File Facts

System
Linux kernel
Corpus path
drivers/clk/actions/owl-composite.h
Extension
.h
Size
3188 bytes
Lines
125
Domain
Driver Families
Bucket
drivers/clk
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct owl_composite {
	struct owl_mux_hw	mux_hw;
	struct owl_gate_hw	gate_hw;
	union owl_rate		rate;

	const struct clk_ops	*fix_fact_ops;

	struct owl_clk_common	common;
};

#define OWL_COMP_DIV(_struct, _name, _parent,				\
		     _mux, _gate, _div, _flags)				\
	struct owl_composite _struct = {				\
		.mux_hw		= _mux,					\
		.gate_hw	= _gate,				\
		.rate.div_hw	= _div,					\
		.common = {						\
			.regmap		= NULL,				\
			.hw.init	= CLK_HW_INIT_PARENTS(_name,	\
						     _parent,		\
						      &owl_comp_div_ops,\
						     _flags),		\
		},							\
	}

#define OWL_COMP_DIV_FIXED(_struct, _name, _parent,			\
		     _gate, _div, _flags)				\
	struct owl_composite _struct = {				\
		.gate_hw	= _gate,				\
		.rate.div_hw	= _div,					\
		.common = {						\
			.regmap		= NULL,				\
			.hw.init	= CLK_HW_INIT(_name,		\
						     _parent,		\
						      &owl_comp_div_ops,\
						     _flags),		\
		},							\
	}

#define OWL_COMP_FACTOR(_struct, _name, _parent,			\
			_mux, _gate, _factor, _flags)			\
	struct owl_composite _struct = {				\
		.mux_hw		= _mux,					\
		.gate_hw	= _gate,				\
		.rate.factor_hw	= _factor,				\
		.common = {						\
			.regmap		= NULL,				\
			.hw.init	= CLK_HW_INIT_PARENTS(_name,	\
						     _parent,		\
						     &owl_comp_fact_ops,\
						     _flags),		\
		},							\
	}

#define OWL_COMP_FIXED_FACTOR(_struct, _name, _parent,			\
			_gate, _mul, _div, _flags)			\
	struct owl_composite _struct = {				\
		.gate_hw		= _gate,			\
		.rate.fix_fact_hw.mult	= _mul,				\
		.rate.fix_fact_hw.div	= _div,				\
		.fix_fact_ops		= &clk_fixed_factor_ops,	\
		.common = {						\
			.regmap		= NULL,				\
			.hw.init	= CLK_HW_INIT(_name,		\
						 _parent,		\
						 &owl_comp_fix_fact_ops,\
						 _flags),		\
		},							\
	}

#define OWL_COMP_PASS(_struct, _name, _parent,				\
		      _mux, _gate, _flags)				\
	struct owl_composite _struct = {				\
		.mux_hw		= _mux,					\
		.gate_hw	= _gate,				\
		.common = {						\
			.regmap		= NULL,				\
			.hw.init	= CLK_HW_INIT_PARENTS(_name,	\
						     _parent,		\
						     &owl_comp_pass_ops,\
						     _flags),		\
		},							\
	}

static inline struct owl_composite *hw_to_owl_comp(struct clk_hw *hw)
{
	struct owl_clk_common *common = hw_to_owl_clk_common(hw);

	return container_of(common, struct owl_composite, common);
}

Annotation

Implementation Notes