Merge branch 'fortglx/39/tip/timers/rtc' of git://git.linaro.org/people/jstultz/linux...
authorThomas Gleixner <tglx@linutronix.de>
Tue, 12 Apr 2011 23:54:09 +0000 (01:54 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 12 Apr 2011 23:54:09 +0000 (01:54 +0200)
1  2 
drivers/rtc/interface.c
drivers/rtc/rtc-bfin.c

diff --combined drivers/rtc/interface.c
@@@ -375,6 -375,32 +375,32 @@@ int rtc_set_alarm(struct rtc_device *rt
  }
  EXPORT_SYMBOL_GPL(rtc_set_alarm);
  
+ /* Called once per device from rtc_device_register */
+ int rtc_initialize_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
+ {
+       int err;
+       err = rtc_valid_tm(&alarm->time);
+       if (err != 0)
+               return err;
+       err = mutex_lock_interruptible(&rtc->ops_lock);
+       if (err)
+               return err;
+       rtc->aie_timer.node.expires = rtc_tm_to_ktime(alarm->time);
+       rtc->aie_timer.period = ktime_set(0, 0);
+       if (alarm->enabled) {
+               rtc->aie_timer.enabled = 1;
+               timerqueue_add(&rtc->timerqueue, &rtc->aie_timer.node);
+       }
+       mutex_unlock(&rtc->ops_lock);
+       return err;
+ }
+ EXPORT_SYMBOL_GPL(rtc_initialize_alarm);
  int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled)
  {
        int err = mutex_lock_interruptible(&rtc->ops_lock);
@@@ -454,7 -480,7 +480,7 @@@ EXPORT_SYMBOL_GPL(rtc_update_irq_enable
   * @rtc: pointer to the rtc device
   *
   * This function is called when an AIE, UIE or PIE mode interrupt
 - * has occured (or been emulated).
 + * has occurred (or been emulated).
   *
   * Triggers the registered irq_task function callback.
   */
diff --combined drivers/rtc/rtc-bfin.c
@@@ -20,9 -20,9 +20,9 @@@
   * write would be discarded and things quickly fall apart.
   *
   * To keep this delay from significantly degrading performance (we, in theory,
 - * would have to sleep for up to 1 second everytime we wanted to write a
 + * would have to sleep for up to 1 second every time we wanted to write a
   * register), we only check the write pending status before we start to issue
 - * a new write.  We bank on the idea that it doesnt matter when the sync
 + * a new write.  We bank on the idea that it doesn't matter when the sync
   * happens so long as we don't attempt another write before it does.  The only
   * time userspace would take this penalty is when they try and do multiple
   * operations right after another ... but in this case, they need to take the
@@@ -250,6 -250,8 +250,8 @@@ static int bfin_rtc_alarm_irq_enable(st
                bfin_rtc_int_set_alarm(rtc);
        else
                bfin_rtc_int_clear(~(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY));
+       return 0;
  }
  
  static int bfin_rtc_read_time(struct device *dev, struct rtc_time *tm)