*/
if (pll1_sw_clk.parent != &pll2_pfd_400M) {
pll2_pfd_400M.enable(&pll2_pfd_400M);
+ pll2_pfd_400M.usecount++;
arm_needs_pll2_400 = true;
pll1_sw_clk.set_parent(&pll1_sw_clk, &pll2_pfd_400M);
pll1_sw_clk.parent = &pll2_pfd_400M;
/* Make sure pll1_sw_clk is from pll1_sys_main_clk */
pll1_sw_clk.set_parent(&pll1_sw_clk, &pll1_sys_main_clk);
pll1_sw_clk.parent = &pll1_sys_main_clk;
+ if (arm_needs_pll2_400)
+ pll2_pfd_400M.usecount--;
arm_needs_pll2_400 = false;
if (pll2_pfd_400M.usecount == 0)
pll2_pfd_400M.disable(&pll2_pfd_400M);
if (pll1_sw_clk.parent != &pll2_pfd2_400M) {
pll2_pfd2_400M.enable(&pll2_pfd2_400M);
arm_needs_pll2_400 = true;
+ pll2_pfd2_400M.usecount++;
pll1_sw_clk.set_parent(&pll1_sw_clk, &pll2_pfd2_400M);
pll1_sw_clk.parent = &pll2_pfd2_400M;
}
pll1_sw_clk.set_parent(&pll1_sw_clk, &pll1_sys_main_clk);
pll1_sw_clk.parent = &pll1_sys_main_clk;
+ if (arm_needs_pll2_400)
+ pll2_pfd2_400M.usecount--;
arm_needs_pll2_400 = false;
if (pll2_pfd2_400M.usecount == 0)
pll2_pfd2_400M.disable(&pll2_pfd2_400M);
IS_ERR(parent) || clk->set_parent == NULL)
return ret;
- if (clk->usecount)
- clk_enable(parent);
-
mutex_lock(&clocks_mutex);
+
+ if (clk->usecount) {
+ if (in_interrupt()) {
+ printk(KERN_ERR " clk_enable cannot be called in an interrupt context\n");
+ dump_stack();
+ mutex_unlock(&clocks_mutex);
+ BUG();
+ }
+ __clk_enable(parent);
+ }
+
ret = clk->set_parent(clk, parent);
if (ret == 0) {
old = clk->parent;
} else {
old = parent;
}
- mutex_unlock(&clocks_mutex);
-
if (clk->usecount)
- clk_disable(old);
+ __clk_disable(old);
+
+ mutex_unlock(&clocks_mutex);
return ret;
}