From: Stephen Warren Date: Tue, 4 Jun 2013 18:58:14 +0000 (-0600) Subject: ASoC: tegra: add runtime PM to resume functions X-Git-Tag: v3.11-rc4~4^2~3^2~1^2~8^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=249e66c32679a24706ec182256a79bf7b1dac9a2;p=platform%2Fkernel%2Flinux-stable.git ASoC: tegra: add runtime PM to resume functions Tegra HW needs clocks etc. active when touching registers. Make sure they are active during resume, by calling pm_runtime_get_sync() before touching HW. Signed-off-by: Stephen Warren Signed-off-by: Mark Brown --- diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c index 0f4787c..d554d46 100644 --- a/sound/soc/tegra/tegra30_ahub.c +++ b/sound/soc/tegra/tegra30_ahub.c @@ -640,8 +640,12 @@ static int tegra30_ahub_resume(struct device *dev) { int ret; + ret = pm_runtime_get_sync(dev); + if (ret < 0) + return ret; ret = regcache_sync(ahub->regmap_ahub); ret |= regcache_sync(ahub->regmap_apbif); + pm_runtime_put(dev); return ret; } diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c index bd0ebc0..d04146c 100644 --- a/sound/soc/tegra/tegra30_i2s.c +++ b/sound/soc/tegra/tegra30_i2s.c @@ -527,8 +527,15 @@ static int tegra30_i2s_suspend(struct device *dev) static int tegra30_i2s_resume(struct device *dev) { struct tegra30_i2s *i2s = dev_get_drvdata(dev); + int ret; - return regcache_sync(i2s->regmap); + ret = pm_runtime_get_sync(dev); + if (ret < 0) + return ret; + ret = regcache_sync(i2s->regmap); + pm_runtime_put(dev); + + return ret; } #endif