drivers/clocksource/timer-of.h

Source file repositories/reference/linux-study-clean/drivers/clocksource/timer-of.h

File Facts

System
Linux kernel
Corpus path
drivers/clocksource/timer-of.h
Extension
.h
Size
1342 bytes
Lines
73
Domain
Driver Families
Bucket
drivers/clocksource
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 of_timer_irq {
	int irq;
	int index;
	const char *name;
	unsigned long flags;
	irq_handler_t handler;
};

struct of_timer_base {
	void __iomem *base;
	const char *name;
	int index;
};

struct of_timer_clk {
	struct clk *clk;
	const char *name;
	int index;
	unsigned long rate;
	unsigned long period;
};

struct timer_of {
	unsigned int flags;
	struct device_node *np;
	struct clock_event_device clkevt;
	struct of_timer_base of_base;
	struct of_timer_irq  of_irq;
	struct of_timer_clk  of_clk;
	void *private_data;
};

static inline struct timer_of *to_timer_of(struct clock_event_device *clkevt)
{
	return container_of(clkevt, struct timer_of, clkevt);
}

static inline void __iomem *timer_of_base(struct timer_of *to)
{
	return to->of_base.base;
}

static inline int timer_of_irq(struct timer_of *to)
{
	return to->of_irq.irq;
}

static inline unsigned long timer_of_rate(struct timer_of *to)
{
	return to->of_clk.rate;
}

static inline unsigned long timer_of_period(struct timer_of *to)
{
	return to->of_clk.period;
}

int timer_of_init(struct device_node *np, struct timer_of *to);

void timer_of_cleanup(struct timer_of *to);

#endif

Annotation

Implementation Notes