From 442c8176d2efa468577738e3a99a6e051f6e8e55 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 8 May 2011 14:06:52 +0100 Subject: clocksource: add common mmio clocksource Add a generic mmio clocksource, covering both 32-bit and 16-bit register access sizes, for up or down counters. This can be used to easily create clocksources for simple counter-based implementations. Cc: Alessandro Rubini Cc: Colin Cross Cc: Eric Miao Cc: Erik Gilling Acked-by: "Hans J. Koch" Cc: Imre Kaloz Cc: Krzysztof Halasa Cc: Kukjin Kim Cc: Lennert Buytenhek Cc: Linus Walleij Cc: linux-omap@vger.kernel.org Acked-by: Nicolas Pitre Cc: Olof Johansson Tested-by: Sascha Hauer Reviewed-by: Thomas Gleixner Tested-by: Tony Lindgren Reviewed-by: Viresh Kumar Cc: Wan ZongShun Signed-off-by: Russell King --- include/linux/clocksource.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/linux/clocksource.h') diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index c918fbd33ee5..d4646b48dc4a 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h @@ -337,6 +337,14 @@ static inline void update_vsyscall_tz(void) extern void timekeeping_notify(struct clocksource *clock); +extern cycle_t clocksource_mmio_readl_up(struct clocksource *); +extern cycle_t clocksource_mmio_readl_down(struct clocksource *); +extern cycle_t clocksource_mmio_readw_up(struct clocksource *); +extern cycle_t clocksource_mmio_readw_down(struct clocksource *); + +extern int clocksource_mmio_init(void __iomem *, const char *, + unsigned long, int, unsigned, cycle_t (*)(struct clocksource *)); + extern int clocksource_i8253_init(void); #endif /* _LINUX_CLOCKSOURCE_H */ -- cgit v1.2.3