drivers/clk/actions/owl-mux.h

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

File Facts

System
Linux kernel
Corpus path
drivers/clk/actions/owl-mux.h
Extension
.h
Size
1420 bytes
Lines
62
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_mux_hw {
	u32			reg;
	u8			shift;
	u8			width;
};

struct owl_mux {
	struct owl_mux_hw	mux_hw;
	struct owl_clk_common	common;
};

#define OWL_MUX_HW(_reg, _shift, _width)		\
	{						\
		.reg	= _reg,				\
		.shift	= _shift,			\
		.width	= _width,			\
	}

#define OWL_MUX(_struct, _name, _parents, _reg,				\
		_shift, _width, _flags)					\
	struct owl_mux _struct = {					\
		.mux_hw	= OWL_MUX_HW(_reg, _shift, _width),		\
		.common = {						\
			.regmap = NULL,					\
			.hw.init = CLK_HW_INIT_PARENTS(_name,		\
						       _parents,	\
						       &owl_mux_ops,	\
						       _flags),		\
		},							\
	}

static inline struct owl_mux *hw_to_owl_mux(struct clk_hw *hw)
{
	struct owl_clk_common *common = hw_to_owl_clk_common(hw);

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

u8 owl_mux_helper_get_parent(const struct owl_clk_common *common,
			     const struct owl_mux_hw *mux_hw);
int owl_mux_helper_set_parent(const struct owl_clk_common *common,
			      struct owl_mux_hw *mux_hw, u8 index);

extern const struct clk_ops owl_mux_ops;

#endif /* _OWL_MUX_H_ */

Annotation

Implementation Notes