aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohn Stultz <johnstul@us.ibm.com>2010-07-13 20:56:28 -0400
committerThomas Gleixner <tglx@linutronix.de>2010-07-27 06:40:55 -0400
commit852db46d55e85b475a72e665ca08d3317769ceef (patch)
tree3802273b1135f0f650868fe9e048d7c0594195fe /include
parentf12a15be63d1de9a35971f35f06b73088fa25c3a (diff)
clocksource: Add __clocksource_updatefreq_hz/khz methods
To properly handle clocksources that change frequencies at the clocksource->enable() point, this patch adds a method that will update the clocksource's mult/shift and max_idle_ns values. Signed-off-by: John Stultz <johnstul@us.ibm.com> LKML-Reference: <1279068988-21864-12-git-send-email-johnstul@us.ibm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/clocksource.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 21677d99a161..c37b21ad5a3b 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -292,6 +292,8 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec);
292 */ 292 */
293extern int 293extern int
294__clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq); 294__clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq);
295extern void
296__clocksource_updatefreq_scale(struct clocksource *cs, u32 scale, u32 freq);
295 297
296static inline int clocksource_register_hz(struct clocksource *cs, u32 hz) 298static inline int clocksource_register_hz(struct clocksource *cs, u32 hz)
297{ 299{
@@ -303,6 +305,15 @@ static inline int clocksource_register_khz(struct clocksource *cs, u32 khz)
303 return __clocksource_register_scale(cs, 1000, khz); 305 return __clocksource_register_scale(cs, 1000, khz);
304} 306}
305 307
308static inline void __clocksource_updatefreq_hz(struct clocksource *cs, u32 hz)
309{
310 __clocksource_updatefreq_scale(cs, 1, hz);
311}
312
313static inline void __clocksource_updatefreq_khz(struct clocksource *cs, u32 khz)
314{
315 __clocksource_updatefreq_scale(cs, 1000, khz);
316}
306 317
307static inline void 318static inline void
308clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec) 319clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec)