clk: renesas: div6: Restore clock state during resume
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 21 Jun 2017 20:34:33 +0000 (22:34 +0200)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 20 Oct 2017 09:15:37 +0000 (11:15 +0200)
commit9f8c71e5134982cdf8ee35acb204715a2a47ba2e
tree9356c9cdccacb5157196febb4146e24aa116490f
parent1f4023cdd1bdbe6cb01d0b2cbd1f46207189e3cf
clk: renesas: div6: Restore clock state during resume

On R-Car Gen3 systems, PSCI system suspend powers down the SoC, losing
clock configuration.  Register an (optional) notifier to restore the
DIV6 clock state during system resume.

As DIV6 clocks can be picky w.r.t. modifying multiple register fields at
once, restore is not implemented by blindly restoring the register
value, but by using the existing cpg_div6_clock_{en,dis}able() helpers.

Note that this does not yet support DIV6 clocks with multiple parents,
which do not exist on R-Car Gen3 SoCs.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
drivers/clk/renesas/clk-div6.c
drivers/clk/renesas/clk-div6.h
drivers/clk/renesas/renesas-cpg-mssr.c