blob: bdfdfa0aa7968baa2f81e1c54289082d568fde0d [file] [log] [blame]
Marc Zyngierf5b3b2b2011-11-07 14:28:33 -08001#ifndef __ASMARM_ARCH_TIMER_H
2#define __ASMARM_ARCH_TIMER_H
3
Marc Zyngierdf590cc2012-01-11 17:25:17 +00004#include <linux/ioport.h>
Jeff Ohlstein57808a62012-07-16 13:39:26 -07005#include <linux/clocksource.h>
Stephen Boyd4d84b3b2012-07-26 12:00:03 -07006#include <asm/errno.h>
Marc Zyngierf5b3b2b2011-11-07 14:28:33 -08007
Marc Zyngierdf590cc2012-01-11 17:25:17 +00008struct arch_timer {
Abhimanyu Kapur05b66442012-05-31 23:28:23 -07009 struct resource res[3];
Marc Zyngierdf590cc2012-01-11 17:25:17 +000010};
11
12#ifdef CONFIG_ARM_ARCH_TIMER
13int arch_timer_register(struct arch_timer *);
Sathish Ambley2f27a172012-03-16 10:46:28 -070014int arch_timer_of_register(void);
Jeff Ohlstein57808a62012-07-16 13:39:26 -070015cycle_t arch_counter_get_cntpct(void);
Marc Zyngierdf590cc2012-01-11 17:25:17 +000016#else
17static inline int arch_timer_register(struct arch_timer *at)
18{
19 return -ENXIO;
20}
Sathish Ambley2f27a172012-03-16 10:46:28 -070021
22static inline int arch_timer_of_register(void)
23{
24 return -ENXIO;
25}
Jeff Ohlstein57808a62012-07-16 13:39:26 -070026
27static inline cycle_t arch_counter_get_cntpct(void)
28{
29 return 0;
30}
Marc Zyngierdf590cc2012-01-11 17:25:17 +000031#endif
Marc Zyngierf5b3b2b2011-11-07 14:28:33 -080032
33#endif