drivers/clk/clk-bm1880.c

Source file repositories/reference/linux-study-clean/drivers/clk/clk-bm1880.c

File Facts

System
Linux kernel
Corpus path
drivers/clk/clk-bm1880.c
Extension
.c
Size
27134 bytes
Lines
947
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 bm1880_clock_data {
	void __iomem *pll_base;
	void __iomem *sys_base;
	struct clk_hw_onecell_data hw_data;
};

struct bm1880_gate_clock {
	unsigned int	id;
	const char	*name;
	const char      *parent;
	u32		gate_reg;
	s8		gate_shift;
	unsigned long	flags;
};

struct bm1880_mux_clock {
	unsigned int	id;
	const char	*name;
	const char      * const *parents;
	s8		num_parents;
	u32		reg;
	s8		shift;
	unsigned long	flags;
};

struct bm1880_div_clock {
	unsigned int	id;
	const char	*name;
	u32		reg;
	u8		shift;
	u8		width;
	u32		initval;
	const struct clk_div_table *table;
	unsigned long flags;
};

struct bm1880_div_hw_clock {
	struct bm1880_div_clock div;
	void __iomem *base;
	spinlock_t *lock;
	struct clk_hw hw;
	struct clk_init_data init;
};

struct bm1880_composite_clock {
	unsigned int	id;
	const char	*name;
	const char	*parent;
	const char      * const *parents;
	unsigned int	num_parents;
	unsigned long	flags;

	u32		gate_reg;
	u32		mux_reg;
	u32		div_reg;

	s8		gate_shift;
	s8		mux_shift;
	s8		div_shift;
	s8		div_width;
	s16		div_initval;
	const struct clk_div_table *table;
};

struct bm1880_pll_clock {
	unsigned int	id;
	const char	*name;
	u32		reg;
	unsigned long	flags;
};

struct bm1880_pll_hw_clock {
	struct bm1880_pll_clock pll;
	void __iomem *base;
	struct clk_hw hw;
	struct clk_init_data init;
};

static const struct clk_ops bm1880_pll_ops;
static const struct clk_ops bm1880_clk_div_ops;

#define GATE_DIV(_id, _name, _parent, _gate_reg, _gate_shift, _div_reg,	\
			_div_shift, _div_width, _div_initval, _table,	\
			_flags) {					\
		.id = _id,						\
		.parent = _parent,					\
		.name = _name,						\
		.gate_reg = _gate_reg,					\
		.gate_shift = _gate_shift,				\
		.div_reg = _div_reg,					\

Annotation

Implementation Notes