Pull cpuidle into release branch
[pandora-kernel.git] / arch / mips / dec / time.c
index 5729474..820e533 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <asm/bootinfo.h>
 #include <asm/cpu.h>
-#include <asm/div64.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/mipsregs.h>
@@ -36,7 +35,7 @@
 #include <asm/dec/ioasic_addrs.h>
 #include <asm/dec/machtype.h>
 
-static unsigned long dec_rtc_get_time(void)
+unsigned long read_persistent_clock(void)
 {
        unsigned int year, mon, day, hour, min, sec, real_year;
        unsigned long flags;
@@ -75,13 +74,13 @@ static unsigned long dec_rtc_get_time(void)
 }
 
 /*
- * In order to set the CMOS clock precisely, dec_rtc_set_mmss has to
+ * In order to set the CMOS clock precisely, rtc_mips_set_mmss has to
  * be called 500 ms after the second nowtime has started, because when
  * nowtime is written into the registers of the CMOS clock, it will
  * jump to the next second precisely 500 ms later.  Check the Dallas
  * DS1287 data sheet for details.
  */
-static int dec_rtc_set_mmss(unsigned long nowtime)
+int rtc_mips_set_mmss(unsigned long nowtime)
 {
        int retval = 0;
        int real_seconds, real_minutes, cmos_minutes;
@@ -140,7 +139,6 @@ static int dec_rtc_set_mmss(unsigned long nowtime)
        return retval;
 }
 
-
 static int dec_timer_state(void)
 {
        return (CMOS_READ(RTC_REG_C) & RTC_PF) != 0;
@@ -151,7 +149,7 @@ static void dec_timer_ack(void)
        CMOS_READ(RTC_REG_C);                   /* Ack the RTC interrupt.  */
 }
 
-static unsigned int dec_ioasic_hpt_read(void)
+static cycle_t dec_ioasic_hpt_read(void)
 {
        /*
         * The free-running counter is 32-bit which is good for about
@@ -160,32 +158,20 @@ static unsigned int dec_ioasic_hpt_read(void)
        return ioasic_read(IO_REG_FCTR);
 }
 
-static void dec_ioasic_hpt_init(unsigned int count)
-{
-       ioasic_write(IO_REG_FCTR, ioasic_read(IO_REG_FCTR) - count);
-}
-
 
-void __init dec_time_init(void)
+void __init plat_time_init(void)
 {
-       rtc_mips_get_time = dec_rtc_get_time;
-       rtc_mips_set_mmss = dec_rtc_set_mmss;
-
        mips_timer_state = dec_timer_state;
        mips_timer_ack = dec_timer_ack;
 
-       if (!cpu_has_counter && IOASIC) {
+       if (!cpu_has_counter && IOASIC)
                /* For pre-R4k systems we use the I/O ASIC's counter.  */
-               mips_hpt_read = dec_ioasic_hpt_read;
-               mips_hpt_init = dec_ioasic_hpt_init;
-       }
+               clocksource_mips.read = dec_ioasic_hpt_read;
 
        /* Set up the rate of periodic DS1287 interrupts.  */
        CMOS_WRITE(RTC_REF_CLCK_32KHZ | (16 - __ffs(HZ)), RTC_REG_A);
 }
 
-EXPORT_SYMBOL(do_settimeofday);
-
 void __init plat_timer_setup(struct irqaction *irq)
 {
        setup_irq(dec_interrupt[DEC_IRQ_RTC], irq);