lib/sbi/sbi_timer: Add sbi_timer_frequency() function

Drivers and other library code sometimes need the timer frequency
outside of lib/sbi/sbi_timer.c, but there is currently no accessor
for it. Add sbi_timer_frequency() to expose the frequency of the
registered timer device.

Signed-off-by: Sunil V L <sunilvl@oss.qualcomm.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20260703050530.2460037-2-sunilvl@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Sunil V L
2026-08-20 17:57:45 +05:30
committed by Anup Patel
parent 3876e7574d
commit 6499c02254
2 changed files with 15 additions and 0 deletions
+3
View File
@@ -140,6 +140,9 @@ bool sbi_timer_waitms_until(bool (*predicate)(void *), void *arg,
/** Get timer value for current HART */
u64 sbi_timer_value(void);
/** Get timer frequency for current HART */
unsigned long sbi_timer_frequency(void);
/** Compute timer value after specified milliseconds */
static inline u64 sbi_timer_value_after_msecs(ulong msecs)
{