summaryrefslogtreecommitdiff
path: root/arch/mips/ath79/clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/ath79/clock.c')
-rw-r--r--arch/mips/ath79/clock.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/mips/ath79/clock.c b/arch/mips/ath79/clock.c
index 4378d63bc3ed..c8351b46e566 100644
--- a/arch/mips/ath79/clock.c
+++ b/arch/mips/ath79/clock.c
@@ -400,6 +400,22 @@ void __init ath79_clocks_init(void)
(ath79_ref_clk.rate / 1000) % 1000);
}
+unsigned long __init
+ath79_get_sys_clk_rate(const char *id)
+{
+ struct clk *clk;
+ unsigned long rate;
+
+ clk = clk_get(NULL, id);
+ if (IS_ERR(clk))
+ panic("unable to get %s clock, err=%d", id, (int) PTR_ERR(clk));
+
+ rate = clk_get_rate(clk);
+ clk_put(clk);
+
+ return rate;
+}
+
/*
* Linux clock API
*/