]> git.baikalelectronics.ru Git - kernel.git/commit
timekeeping: Provide new API to get the current time resolution
authorHarald Geyer <harald@ccbib.org>
Tue, 7 Apr 2015 11:12:35 +0000 (11:12 +0000)
committerJohn Stultz <john.stultz@linaro.org>
Fri, 22 May 2015 16:12:28 +0000 (09:12 -0700)
commit7e0aa75d726ad178edbf93026d2f16378e461771
tree1dc1736d56f2ef68c114e338d31e0f295a83aef7
parent4b9a15e6584c90d42e1d2c13c70caa3f3ea80fa0
timekeeping: Provide new API to get the current time resolution

This patch series introduces a new function
u32 ktime_get_resolution_ns(void)
which allows to clean up some driver code.

In particular the IIO subsystem has a function to provide timestamps for
events but no means to get their resolution. So currently the dht11 driver
tries to guess the resolution in a rather messy and convoluted way. We
can do much better with the new code.

This API is not designed to be exposed to user space.

This has been tested on i386, sunxi and mxs.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Harald Geyer <harald@ccbib.org>
[jstultz: Tweaked to make it build after upstream changes]
Signed-off-by: John Stultz <john.stultz@linaro.org>
include/linux/timekeeping.h
kernel/time/timekeeping.c