kernel-ark/kernel/time
Thomas Gleixner 7d2f944a2b clocksource: Provide a generic mult/shift factor calculation
MIPS has two functions to calculcate the mult/shift factors for clock
sources and clock events at run time. ARM needs such functions as
well.

Implement a function which calculates the mult/shift factors based on
the frequencies to which and from which is converted. The function
also has a parameter to specify the minimum conversion range in
seconds. This range is guaranteed not to produce a 64bit overflow when
a value is multiplied with the calculated mult factor. The larger the
conversion range the less becomes the conversion accuracy.

Provide two inline wrappers which handle clock events and clock
sources. For clock events the "from" frequency is nano seconds per
second which corresponds to 1GHz and "to" is the device frequency. For
clock sources "from" is the device frequency and "to" is nano seconds
per second.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Mikael Pettersson <mikpe@it.uu.se>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Cc: John Stultz <johnstul@us.ibm.com>
LKML-Reference: <20091111134229.766673305@linutronix.de>
2009-11-13 20:46:23 +01:00
..
clockevents.c clockevent: Prevent dead lock on clockevents_lock 2009-08-19 18:15:10 +02:00
clocksource.c clocksource: Provide a generic mult/shift factor calculation 2009-11-13 20:46:23 +01:00
jiffies.c clocksource: Cleanup clocksource selection 2009-08-15 10:55:46 +02:00
Kconfig
Makefile time: add function to convert between calendar time and broken-down time for universal use 2009-09-24 07:20:56 -07:00
ntp.c timekeeping: Introduce timekeeping_leap_insert 2009-08-15 10:55:45 +02:00
tick-broadcast.c clockevent: Prevent dead lock on clockevents_lock 2009-08-19 18:15:10 +02:00
tick-common.c clockevents: prevent endless loop in tick_handle_periodic() 2009-05-02 10:22:27 +02:00
tick-internal.h
tick-oneshot.c clocksource: prevent selection of low resolution clocksourse also for nohz=on 2009-06-13 12:00:26 +02:00
tick-sched.c nohz: Introduce arch_needs_cpu 2009-11-05 07:53:53 +01:00
timecompare.c timecompare: generic infrastructure to map between two time bases 2009-02-15 22:43:32 -08:00
timeconv.c time: add function to convert between calendar time and broken-down time for universal use 2009-09-24 07:20:56 -07:00
timekeeping.c time: Remove xtime_cache 2009-10-05 13:52:02 +02:00
timer_list.c clockevents: Use u32 for mult and shift factors 2009-11-13 20:46:23 +01:00
timer_stats.c const: constify remaining file_operations 2009-10-01 16:11:11 -07:00