|
@@ -923,6 +923,25 @@ static int clk_core_enable_lock(struct clk_core *core)
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * clk_gate_restore_context - restore context for poweroff
|
|
|
+ * @hw: the clk_hw pointer of clock whose state is to be restored
|
|
|
+ *
|
|
|
+ * The clock gate restore context function enables or disables
|
|
|
+ * the gate clocks based on the enable_count. This is done in cases
|
|
|
+ * where the clock context is lost and based on the enable_count
|
|
|
+ * the clock either needs to be enabled/disabled. This
|
|
|
+ * helps restore the state of gate clocks.
|
|
|
+ */
|
|
|
+void clk_gate_restore_context(struct clk_hw *hw)
|
|
|
+{
|
|
|
+ if (hw->clk->core->enable_count)
|
|
|
+ hw->clk->core->ops->enable(hw);
|
|
|
+ else
|
|
|
+ hw->clk->core->ops->disable(hw);
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(clk_gate_restore_context);
|
|
|
+
|
|
|
static int _clk_save_context(struct clk_core *clk)
|
|
|
{
|
|
|
struct clk_core *child;
|