Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: tegra: add runtime PM to resume functions
@ 2013-06-04 18:58 Stephen Warren
  2013-06-04 19:47 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Warren @ 2013-06-04 18:58 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown
  Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

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 <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 sound/soc/tegra/tegra30_ahub.c | 4 ++++
 sound/soc/tegra/tegra30_i2s.c  | 9 ++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

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
 
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: tegra: add runtime PM to resume functions
  2013-06-04 18:58 [PATCH] ASoC: tegra: add runtime PM to resume functions Stephen Warren
@ 2013-06-04 19:47 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-06-04 19:47 UTC (permalink / raw)
  To: Stephen Warren; +Cc: linux-tegra, alsa-devel, Stephen Warren, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 296 bytes --]

On Tue, Jun 04, 2013 at 12:58:14PM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
> 
> 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.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-04 19:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-04 18:58 [PATCH] ASoC: tegra: add runtime PM to resume functions Stephen Warren
2013-06-04 19:47 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox