rk: freq limit resume when disable_limit
[firefly-linux-kernel-4.4.55.git] / arch / arm / plat-rk / clock.c
index 473d161354a8aff37de5731eac02f5ac8a977b19..9c4e8badb3b3fdbcf9da914559fac40da5b91bb7 100644 (file)
@@ -280,6 +280,8 @@ int clk_set_rate_nolock(struct clk *clk, unsigned long rate)
                __propagate_rate(clk);
        }
 
+       clk->last_set_rate = rate;
+
        if (clk->notifier_count)
                clk_notify(clk, ret ? CLK_ABORT_RATE_CHANGE : CLK_POST_RATE_CHANGE, old_rate, clk->rate);
 
@@ -492,8 +494,10 @@ void clk_disable(struct clk *clk)
 {
        if (clk == NULL || IS_ERR(clk))
                return;
-       if (dvfs_support_clk_disable(clk->dvfs_info)==true)
-               return dvfs_vd_clk_disable(clk, 0);
+       if (dvfs_support_clk_disable(clk->dvfs_info) == true) {
+               dvfs_vd_clk_disable(clk, 0);
+               return;
+       }
 
        LOCK();
        clk_disable_nolock(clk);
@@ -708,12 +712,14 @@ cnu_out:
 }
 EXPORT_SYMBOL(clk_notifier_unregister);
 
+#ifdef CONFIG_PROC_FS
 static struct clk_dump_ops *dump_def_ops;
 
 void clk_register_dump_ops(struct clk_dump_ops *ops)
 {
        dump_def_ops=ops;
 }
+#endif
 
 #ifdef CONFIG_RK_CLOCK_PROC
 static int proc_clk_show(struct seq_file *s, void *v)
@@ -761,3 +767,25 @@ static int __init clk_proc_init(void)
 late_initcall(clk_proc_init);
 #endif /* CONFIG_RK_CLOCK_PROC */
 
+static int clk_panic(struct notifier_block *this, unsigned long ev, void *ptr)
+{
+#ifdef RK30_CRU_BASE
+#define CRU_BASE RK30_CRU_BASE
+#elif defined(RK2928_CRU_BASE)
+#define CRU_BASE RK2928_CRU_BASE
+#endif
+#ifdef CRU_BASE
+       print_hex_dump(KERN_WARNING, "", DUMP_PREFIX_ADDRESS, 16, 4, CRU_BASE, 0x150, false);
+#endif
+       return NOTIFY_DONE;
+}
+
+static struct notifier_block clk_panic_block = {
+       .notifier_call = clk_panic,
+};
+
+static int __init clk_panic_init(void)
+{
+       return atomic_notifier_chain_register(&panic_notifier_list, &clk_panic_block);
+}
+pure_initcall(clk_panic_init);