drivers/clk/pistachio/clk.h

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

File Facts

System
Linux kernel
Corpus path
drivers/clk/pistachio/clk.h
Extension
.h
Size
3872 bytes
Lines
172
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 pistachio_gate {
	unsigned int id;
	unsigned long reg;
	unsigned int shift;
	const char *name;
	const char *parent;
};

#define GATE(_id, _name, _pname, _reg, _shift)	\
	{					\
		.id	= _id,			\
		.reg	= _reg,			\
		.shift	= _shift,		\
		.name	= _name,		\
		.parent = _pname,		\
	}

struct pistachio_mux {
	unsigned int id;
	unsigned long reg;
	unsigned int shift;
	unsigned int num_parents;
	const char *name;
	const char *const *parents;
};

#define PNAME(x) static const char *const x[] __initconst

#define MUX(_id, _name, _pnames, _reg, _shift)			\
	{							\
		.id		= _id,				\
		.reg		= _reg,				\
		.shift		= _shift,			\
		.name		= _name,			\
		.parents	= _pnames,			\
		.num_parents	= ARRAY_SIZE(_pnames)		\
	}


struct pistachio_div {
	unsigned int id;
	unsigned long reg;
	unsigned int width;
	unsigned int div_flags;
	const char *name;
	const char *parent;
};

#define DIV(_id, _name, _pname, _reg, _width)			\
	{							\
		.id		= _id,				\
		.reg		= _reg,				\
		.width		= _width,			\
		.div_flags	= 0,				\
		.name		= _name,			\
		.parent		= _pname,			\
	}

#define DIV_F(_id, _name, _pname, _reg, _width, _div_flags)	\
	{							\
		.id		= _id,				\
		.reg		= _reg,				\
		.width		= _width,			\
		.div_flags	= _div_flags,			\
		.name		= _name,			\
		.parent		= _pname,			\
	}

struct pistachio_fixed_factor {
	unsigned int id;
	unsigned int div;
	const char *name;
	const char *parent;
};

#define FIXED_FACTOR(_id, _name, _pname, _div)			\
	{							\
		.id		= _id,				\
		.div		= _div,				\
		.name		= _name,			\
		.parent		= _pname,			\
	}

struct pistachio_pll_rate_table {
	unsigned long long fref;
	unsigned long long fout;
	unsigned long long refdiv;
	unsigned long long fbdiv;
	unsigned long long postdiv1;
	unsigned long long postdiv2;

Annotation

Implementation Notes