drivers/clk/samsung/clk.h

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

File Facts

System
Linux kernel
Corpus path
drivers/clk/samsung/clk.h
Extension
.h
Size
15186 bytes
Lines
493
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 samsung_clk_provider {
	void __iomem *reg_base;
	struct device *dev;
	struct regmap *sysreg;
	spinlock_t lock;
	bool auto_clock_gate;
	u32 gate_dbg_offset;
	u32 option_offset;
	u32 drcg_offset;
	u32 memclk_offset;
	/* clk_data must be the last entry due to variable length 'hws' array */
	struct clk_hw_onecell_data clk_data;
};

/**
 * struct samsung_clock_alias - information about mux clock
 * @id: platform specific id of the clock
 * @dev_name: name of the device to which this clock belongs
 * @alias: optional clock alias name to be assigned to this clock
 */
struct samsung_clock_alias {
	unsigned int		id;
	const char		*dev_name;
	const char		*alias;
};

#define ALIAS(_id, dname, a)	\
	{							\
		.id		= _id,				\
		.dev_name	= dname,			\
		.alias		= a,				\
	}

#define MHZ (1000 * 1000)

/**
 * struct samsung_fixed_rate_clock - information about fixed-rate clock
 * @id: platform specific id of the clock
 * @name: name of this fixed-rate clock
 * @parent_name: optional parent clock name
 * @flags: optional fixed-rate clock flags
 * @fixed_rate: fixed clock rate of this clock
 */
struct samsung_fixed_rate_clock {
	unsigned int		id;
	char			*name;
	const char		*parent_name;
	unsigned long		flags;
	unsigned long		fixed_rate;
};

#define FRATE(_id, cname, pname, f, frate)		\
	{						\
		.id		= _id,			\
		.name		= cname,		\
		.parent_name	= pname,		\
		.flags		= f,			\
		.fixed_rate	= frate,		\
	}

/**
 * struct samsung_fixed_factor_clock - information about fixed-factor clock
 * @id: platform specific id of the clock
 * @name: name of this fixed-factor clock
 * @parent_name: parent clock name
 * @mult: fixed multiplication factor
 * @div: fixed division factor
 * @flags: optional fixed-factor clock flags
 */
struct samsung_fixed_factor_clock {
	unsigned int		id;
	char			*name;
	const char		*parent_name;
	unsigned long		mult;
	unsigned long		div;
	unsigned long		flags;
};

#define FFACTOR(_id, cname, pname, m, d, f)		\
	{						\
		.id		= _id,			\
		.name		= cname,		\
		.parent_name	= pname,		\
		.mult		= m,			\
		.div		= d,			\
		.flags		= f,			\
	}

/**
 * struct samsung_mux_clock - information about mux clock

Annotation

Implementation Notes