@@ -36,6 +36,7 @@
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/clk.h>
+#include <linux/clkdev.h>
#include <linux/clk-provider.h>
#include "clk.h"
@@ -334,6 +335,10 @@ struct clk *rockchip_clk_register_cpuclk(const char *name,
goto free_rate_table;
}
+ /* Protect CPU clock */
+ __clk_get(cclk);
+ clk_prepare_enable(cclk);
+
return cclk;
free_rate_table:
@@ -15,6 +15,7 @@
#include <linux/arm-smccc.h>
#include <linux/clk.h>
+#include <linux/clkdev.h>
#include <linux/clk-provider.h>
#include <linux/io.h>
#include <linux/slab.h>
@@ -147,5 +148,9 @@ struct clk *rockchip_clk_register_ddrclk(const char *name, int flags,
if (IS_ERR(clk))
kfree(ddrclk);
+ /* Protect DDR clock */
+ __clk_get(clk);
+ clk_prepare_enable(clk);
+
return clk;
}
These clks can never be turned off, so protect them as what we do in the sunxi clock-tree. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> --- drivers/clk/rockchip/clk-cpu.c | 5 +++++ drivers/clk/rockchip/clk-ddr.c | 5 +++++ 2 files changed, 10 insertions(+)