aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2016-12-29 06:34:06 -0500
committerMark Brown <broonie@kernel.org>2016-12-31 13:36:31 -0500
commitafa99da863e8e00efd8ce2f8840ed31d50abb889 (patch)
tree632745e6d92e23a222dcdd6e58321ce2475641e0
parente7e52dfc68a2160570c7ec51415e391961160edb (diff)
ASoC: samsung: i2s: Let runtime PM operations to control op_clk too
This patch adds handling of parent operational clock to runtime PM callbacks. This way it is ensured that when I2S module is in runtime suspended state, all its parent clocks are disabled and unprepared. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/samsung/i2s.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index df3fae862665..b2b9ee4a177a 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -546,6 +546,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
546 546
547 if (WARN_ON(IS_ERR(i2s->op_clk))) { 547 if (WARN_ON(IS_ERR(i2s->op_clk))) {
548 ret = PTR_ERR(i2s->op_clk); 548 ret = PTR_ERR(i2s->op_clk);
549 i2s->op_clk = NULL;
549 goto err; 550 goto err;
550 } 551 }
551 552
@@ -1121,6 +1122,8 @@ static int i2s_runtime_suspend(struct device *dev)
1121 i2s->suspend_i2scon = readl(i2s->addr + I2SCON); 1122 i2s->suspend_i2scon = readl(i2s->addr + I2SCON);
1122 i2s->suspend_i2spsr = readl(i2s->addr + I2SPSR); 1123 i2s->suspend_i2spsr = readl(i2s->addr + I2SPSR);
1123 1124
1125 if (i2s->op_clk)
1126 clk_disable_unprepare(i2s->op_clk);
1124 clk_disable_unprepare(i2s->clk); 1127 clk_disable_unprepare(i2s->clk);
1125 1128
1126 return 0; 1129 return 0;
@@ -1131,6 +1134,8 @@ static int i2s_runtime_resume(struct device *dev)
1131 struct i2s_dai *i2s = dev_get_drvdata(dev); 1134 struct i2s_dai *i2s = dev_get_drvdata(dev);
1132 1135
1133 clk_prepare_enable(i2s->clk); 1136 clk_prepare_enable(i2s->clk);
1137 if (i2s->op_clk)
1138 clk_prepare_enable(i2s->op_clk);
1134 1139
1135 writel(i2s->suspend_i2scon, i2s->addr + I2SCON); 1140 writel(i2s->suspend_i2scon, i2s->addr + I2SCON);
1136 writel(i2s->suspend_i2smod, i2s->addr + I2SMOD); 1141 writel(i2s->suspend_i2smod, i2s->addr + I2SMOD);