From 6887c5bed9d7dc26f8dbd196a5878c9c4a128d94 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 14 Nov 2019 12:57:26 -0700 Subject: common: Move some time functions out of common.h These functions belong in time.h so move them over and add comments. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- include/time.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/time.h') diff --git a/include/time.h b/include/time.h index a114952..a1bdefc 100644 --- a/include/time.h +++ b/include/time.h @@ -70,4 +70,20 @@ uint64_t usec_to_tick(unsigned long usec); (time_after_eq(a,b) && \ time_before(a,c)) +/** + * usec2ticks() - Convert microseconds to internal ticks + * + * @usec: Value of microseconds to convert + * @return Corresponding internal ticks value, calculated using get_tbclk() + */ +ulong usec2ticks(unsigned long usec); + +/** + * ticks2usec() - Convert internal ticks to microseconds + * + * @ticks: Value of ticks to convert + * @return Corresponding microseconds value, calculated using get_tbclk() + */ +ulong ticks2usec(unsigned long ticks); + #endif /* _TIME_H */ -- cgit v1.1