drivers/clk/clk-sp7021.c

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

File Facts

System
Linux kernel
Corpus path
drivers/clk/clk-sp7021.c
Extension
.c
Size
15748 bytes
Lines
709
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 sp_pll {
	struct clk_hw hw;
	void __iomem *reg;
	spinlock_t lock;	/* lock for reg */
	int div_shift;
	int div_width;
	int pd_bit;		/* power down bit idx */
	int bp_bit;		/* bypass bit idx */
	unsigned long brate;	/* base rate, TODO: replace brate with muldiv */
	u32 p[P_MAX];		/* for hold PLLTV/PLLA parameters */
};

#define to_sp_pll(_hw)	container_of(_hw, struct sp_pll, hw)

struct sp_clk_gate_info {
	u16	reg;		/* reg_index_shift */
	u16	ext_parent;	/* parent is extclk */
};

static const struct sp_clk_gate_info sp_clk_gates[] = {
	{ 0x02 },
	{ 0x05 },
	{ 0x06 },
	{ 0x07 },
	{ 0x09 },
	{ 0x0b, 1 },
	{ 0x0f, 1 },
	{ 0x14 },
	{ 0x15 },
	{ 0x16 },
	{ 0x17 },
	{ 0x18, 1 },
	{ 0x19, 1 },
	{ 0x1a, 1 },
	{ 0x1b, 1 },
	{ 0x1c, 1 },
	{ 0x1d, 1 },
	{ 0x1e },
	{ 0x1f, 1 },
	{ 0x20 },
	{ 0x21 },
	{ 0x22 },
	{ 0x23 },
	{ 0x24 },
	{ 0x25 },
	{ 0x26 },
	{ 0x2a },
	{ 0x2b },
	{ 0x2d },
	{ 0x2e },
	{ 0x30 },
	{ 0x31 },
	{ 0x32 },
	{ 0x33 },
	{ 0x3d },
	{ 0x3e },
	{ 0x3f },
	{ 0x42 },
	{ 0x44 },
	{ 0x4b },
	{ 0x4c },
	{ 0x4d },
	{ 0x4e },
	{ 0x4f },
	{ 0x50 },
	{ 0x55 },
	{ 0x60 },
	{ 0x61 },
	{ 0x6a },
	{ 0x73 },
	{ 0x86 },
	{ 0x8a },
	{ 0x8b },
	{ 0x8d },
	{ 0x8e },
	{ 0x8f },
	{ 0x90 },
	{ 0x92 },
	{ 0x93 },
	{ 0x95 },
	{ 0x96 },
	{ 0x97 },
	{ 0x98 },
	{ 0x99 },
};

#define _M		1000000UL
#define F_27M		(27 * _M)

/*********************************** PLL_TV **********************************/

Annotation

Implementation Notes