Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: tegra: pllout: Save and restore pllout context

This patch implements save and restore of pllout context.

During system suspend, core power goes off and looses the settings
of the Tegra CAR controller registers.

So during suspend entry the state of pllout is saved and on resume
it is restored back to have pllout in same state as before suspend.

pllout rate is saved and restore in clock divider so it will be at
same rate as before suspend when pllout state is restored.

Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Sowjanya Komatineni and committed by
Thierry Reding
fa622282 d64422d9

+9
+9
drivers/clk/tegra/clk-pll-out.c
··· 69 69 spin_unlock_irqrestore(pll_out->lock, flags); 70 70 } 71 71 72 + static void tegra_clk_pll_out_restore_context(struct clk_hw *hw) 73 + { 74 + if (!__clk_get_enable_count(hw->clk)) 75 + clk_pll_out_disable(hw); 76 + else 77 + clk_pll_out_enable(hw); 78 + } 79 + 72 80 const struct clk_ops tegra_clk_pll_out_ops = { 73 81 .is_enabled = clk_pll_out_is_enabled, 74 82 .enable = clk_pll_out_enable, 75 83 .disable = clk_pll_out_disable, 84 + .restore_context = tegra_clk_pll_out_restore_context, 76 85 }; 77 86 78 87 struct clk *tegra_clk_register_pll_out(const char *name,