diff options
author | Sugar Zhang <sugar.zhang@rock-chips.com> | 2016-09-07 02:30:21 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-09-12 15:00:46 -0400 |
commit | 3628c6987fb45d719cd963805bbba9f15017290e (patch) | |
tree | 8bf6e41e7b6cffc88b522dcbb13832e0b16c58f8 | |
parent | f0447f6cbb202e1be8244d15aee390a96d65e490 (diff) |
ASoC: rockchip: spdif: restore register during runtime_suspend/resume cycle
when step into runtime_suspend, spdif pd will be disabled and loss state.
so need to restore register when runtime_resume.
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/rockchip/rockchip_spdif.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c index 4ca265737eda..fa8101d1e16f 100644 --- a/sound/soc/rockchip/rockchip_spdif.c +++ b/sound/soc/rockchip/rockchip_spdif.c | |||
@@ -65,6 +65,7 @@ static int __maybe_unused rk_spdif_runtime_suspend(struct device *dev) | |||
65 | { | 65 | { |
66 | struct rk_spdif_dev *spdif = dev_get_drvdata(dev); | 66 | struct rk_spdif_dev *spdif = dev_get_drvdata(dev); |
67 | 67 | ||
68 | regcache_cache_only(spdif->regmap, true); | ||
68 | clk_disable_unprepare(spdif->mclk); | 69 | clk_disable_unprepare(spdif->mclk); |
69 | clk_disable_unprepare(spdif->hclk); | 70 | clk_disable_unprepare(spdif->hclk); |
70 | 71 | ||
@@ -88,7 +89,16 @@ static int __maybe_unused rk_spdif_runtime_resume(struct device *dev) | |||
88 | return ret; | 89 | return ret; |
89 | } | 90 | } |
90 | 91 | ||
91 | return 0; | 92 | regcache_cache_only(spdif->regmap, false); |
93 | regcache_mark_dirty(spdif->regmap); | ||
94 | |||
95 | ret = regcache_sync(spdif->regmap); | ||
96 | if (ret) { | ||
97 | clk_disable_unprepare(spdif->mclk); | ||
98 | clk_disable_unprepare(spdif->hclk); | ||
99 | } | ||
100 | |||
101 | return ret; | ||
92 | } | 102 | } |
93 | 103 | ||
94 | static int rk_spdif_hw_params(struct snd_pcm_substream *substream, | 104 | static int rk_spdif_hw_params(struct snd_pcm_substream *substream, |