diff options
| author | Nishanth Menon <nm@ti.com> | 2011-07-24 15:57:47 -0400 |
|---|---|---|
| committer | Paolo Pisati <paolo.pisati@canonical.com> | 2012-08-17 04:18:03 -0400 |
| commit | 37ebde996aa6c080eba4518b5e67d36275d9b5b8 (patch) | |
| tree | 6992135094a64f03a0e4ab8083bad9a261c85504 /kernel | |
| parent | c4210b69286bea72b1c4e973d32a285b69f13ca8 (diff) | |
Merge branch 'v3.0-4460-fixes' into omap-pm-integration
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/time/clockevents.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index e4c699dfa4e..a8a3d49c94a 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, | |||
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | /** | 135 | /** |
| 136 | * clockevents_reconfigure - Reconfigure and reprogram a clock event device. | ||
| 137 | * @dev: device to modify | ||
| 138 | * @freq: new device frequency | ||
| 139 | * @secr: guaranteed runtime conversion range in seconds | ||
| 140 | * | ||
| 141 | * Reconfigure and reprogram a clock event device in oneshot | ||
| 142 | * mode. Must only be called from low level idle code where | ||
| 143 | * interaction with hrtimers/nohz code etc. is not possible and | ||
| 144 | * guaranteed not to conflict. Must be called with interrupts | ||
| 145 | * disabled! | ||
| 146 | * Returns 0 on success, -ETIME when the event is in the past or | ||
| 147 | * -EINVAL when called with invalid parameters. | ||
| 148 | */ | ||
| 149 | int clockevents_reconfigure(struct clock_event_device *dev, u32 freq, u32 secr) | ||
| 150 | { | ||
| 151 | if (dev->mode != CLOCK_EVT_MODE_ONESHOT) | ||
| 152 | return -EINVAL; | ||
| 153 | |||
| 154 | clockevents_calc_mult_shift(dev, freq, secr ? secr : 1); | ||
| 155 | |||
| 156 | return clockevents_program_event(dev, dev->next_event, ktime_get()); | ||
| 157 | } | ||
| 158 | |||
| 159 | /** | ||
| 136 | * clockevents_register_notifier - register a clock events change listener | 160 | * clockevents_register_notifier - register a clock events change listener |
| 137 | */ | 161 | */ |
| 138 | int clockevents_register_notifier(struct notifier_block *nb) | 162 | int clockevents_register_notifier(struct notifier_block *nb) |
