aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-06-14 11:46:56 -0700
committerColin Cross <ccross@android.com>2011-06-14 11:46:56 -0700
commitad1f9adb36d07438bd38270744f190b49d094ad8 (patch)
treebf155f7af98e1702abc1b7aa3c87226323606367 /kernel/time
parent4a968e99063abdd6cf118d85bab68e8f0d8b717c (diff)
parentb26b13a08ed71b2db6152774e4adb5c93e0636e5 (diff)
downloadkernel_samsung_espresso10-ad1f9adb36d07438bd38270744f190b49d094ad8.zip
kernel_samsung_espresso10-ad1f9adb36d07438bd38270744f190b49d094ad8.tar.gz
kernel_samsung_espresso10-ad1f9adb36d07438bd38270744f190b49d094ad8.tar.bz2
Merge branch 'linux-omap-pm-3.0' into linux-omap-3.0
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/clockevents.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index e4c699d..a8a3d49 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -133,6 +133,30 @@ int clockevents_program_event(struct clock_event_device *dev, ktime_t expires,
}
/**
+ * clockevents_reconfigure - Reconfigure and reprogram a clock event device.
+ * @dev: device to modify
+ * @freq: new device frequency
+ * @secr: guaranteed runtime conversion range in seconds
+ *
+ * Reconfigure and reprogram a clock event device in oneshot
+ * mode. Must only be called from low level idle code where
+ * interaction with hrtimers/nohz code etc. is not possible and
+ * guaranteed not to conflict. Must be called with interrupts
+ * disabled!
+ * Returns 0 on success, -ETIME when the event is in the past or
+ * -EINVAL when called with invalid parameters.
+ */
+int clockevents_reconfigure(struct clock_event_device *dev, u32 freq, u32 secr)
+{
+ if (dev->mode != CLOCK_EVT_MODE_ONESHOT)
+ return -EINVAL;
+
+ clockevents_calc_mult_shift(dev, freq, secr ? secr : 1);
+
+ return clockevents_program_event(dev, dev->next_event, ktime_get());
+}
+
+/**
* clockevents_register_notifier - register a clock events change listener
*/
int clockevents_register_notifier(struct notifier_block *nb)