X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=include%2Fasm-mips%2Ftime.h;h=d3bd5c5aa2ecd0ae1fa34c9083debcac6c4107e0;hb=e5d3fd38f93755c5ab1e04b8e40196135f576355;hp=a632cef830a273cae8d1a9ee5548f5dc962c6ab1;hpb=bef986502fa398b1785a3979b1aa17cd902d3527;p=linux-2.6-omap-h63xx.git diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h index a632cef830a..d3bd5c5aa2e 100644 --- a/include/asm-mips/time.h +++ b/include/asm-mips/time.h @@ -10,83 +10,70 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. - * - * Please refer to Documentation/mips/time.README. */ #ifndef _ASM_TIME_H #define _ASM_TIME_H -#include -#include -#include #include #include +#include #include extern spinlock_t rtc_lock; /* - * RTC ops. By default, they point to no-RTC functions. - * rtc_mips_get_time - mktime(year, mon, day, hour, min, sec) in seconds. + * RTC ops. By default, they point to weak no-op RTC functions. * rtc_mips_set_time - reverse the above translation and set time to RTC. * rtc_mips_set_mmss - similar to rtc_set_time, but only min and sec need * to be set. Used by RTC sync-up. */ -extern unsigned long (*rtc_mips_get_time)(void); -extern int (*rtc_mips_set_time)(unsigned long); -extern int (*rtc_mips_set_mmss)(unsigned long); - -/* - * Timer interrupt functions. - * mips_timer_state is needed for high precision timer calibration. - * mips_timer_ack may be NULL if the interrupt is self-recoverable. - */ -extern int (*mips_timer_state)(void); -extern void (*mips_timer_ack)(void); +extern int rtc_mips_set_time(unsigned long); +extern int rtc_mips_set_mmss(unsigned long); /* - * High precision timer clocksource. - * If .read is NULL, an R4k-compatible timer setup is attempted. - */ -extern struct clocksource clocksource_mips; - -/* - * to_tm() converts system time back to (year, mon, day, hour, min, sec). - * It is intended to help implement rtc_set_time() functions. - * Copied from PPC implementation. + * board specific routines required by time_init(). */ -extern void to_tm(unsigned long tim, struct rtc_time *tm); +extern void plat_time_init(void); /* - * high-level timer interrupt routines. + * mips_hpt_frequency - must be set if you intend to use an R4k-compatible + * counter as a timer interrupt source. */ -extern irqreturn_t timer_interrupt(int irq, void *dev_id); +extern unsigned int mips_hpt_frequency; /* - * the corresponding low-level timer interrupt routine. + * The performance counter IRQ on MIPS is a close relative to the timer IRQ + * so it lives here. */ -extern asmlinkage void ll_timer_interrupt(int irq); +extern int (*perf_irq)(void); /* - * profiling and process accouting is done separately in local_timer_interrupt + * Initialize the calling CPU's compare interrupt as clockevent device */ -extern void local_timer_interrupt(int irq, void *dev_id); -extern asmlinkage void ll_local_timer_interrupt(int irq); +#ifdef CONFIG_CEVT_R4K +extern int mips_clockevent_init(void); +extern unsigned int __weak get_c0_compare_int(void); +#else +static inline int mips_clockevent_init(void) +{ + return -ENXIO; +} +#endif /* - * board specific routines required by time_init(). - * board_time_init is defaulted to NULL and can remain so. - * plat_timer_setup must be setup properly in machine setup routine. + * Initialize the count register as a clocksource */ -struct irqaction; -extern void (*board_time_init)(void); -extern void plat_timer_setup(struct irqaction *irq); +#ifdef CONFIG_CEVT_R4K +extern int init_mips_clocksource(void); +#else +static inline int init_mips_clocksource(void) +{ + return 0; +} +#endif -/* - * mips_hpt_frequency - must be set if you intend to use an R4k-compatible - * counter as a timer interrupt source; otherwise it can be set up - * automagically with an aid of mips_timer_state. - */ -extern unsigned int mips_hpt_frequency; +extern void clocksource_set_clock(struct clocksource *cs, unsigned int clock); +extern void clockevent_set_clock(struct clock_event_device *cd, + unsigned int clock); #endif /* _ASM_TIME_H */