drivers/clk/spacemit/ccu_ddn.h

Source file repositories/reference/linux-study-clean/drivers/clk/spacemit/ccu_ddn.h

File Facts

System
Linux kernel
Corpus path
drivers/clk/spacemit/ccu_ddn.h
Extension
.h
Size
1327 bytes
Lines
51
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 ccu_ddn {
	struct ccu_common common;
	unsigned int num_mask;
	unsigned int num_shift;
	unsigned int den_mask;
	unsigned int den_shift;
	unsigned int pre_div;
};

#define CCU_DDN_INIT(_name, _parent, _flags) \
	CLK_HW_INIT_HW(#_name, &_parent.common.hw, &spacemit_ccu_ddn_ops, _flags)

#define CCU_DDN_DEFINE(_name, _parent, _reg_ctrl, _num_shift, _num_width,	\
		       _den_shift, _den_width, _pre_div, _flags)		\
static struct ccu_ddn _name = {							\
	.common = {								\
		.reg_ctrl	= _reg_ctrl,					\
		.hw.init	= CCU_DDN_INIT(_name, _parent, _flags),		\
	},									\
	.num_mask	= GENMASK(_num_shift + _num_width - 1, _num_shift),	\
	.num_shift	= _num_shift,						\
	.den_mask	= GENMASK(_den_shift + _den_width - 1, _den_shift),	\
	.den_shift	= _den_shift,						\
	.pre_div	= _pre_div,						\
}

static inline struct ccu_ddn *hw_to_ccu_ddn(struct clk_hw *hw)
{
	struct ccu_common *common = hw_to_ccu_common(hw);

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

extern const struct clk_ops spacemit_ccu_ddn_ops;

#endif

Annotation

Implementation Notes