diff options
author | Stephen Warren <swarren@nvidia.com> | 2013-06-03 13:37:42 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-06-03 14:53:07 -0400 |
commit | 5c5b08286fa4d782e44cae8738cf4328a29c4326 (patch) | |
tree | 4a7c71cdfcce90ef261b58cee71aa3224cf4ac95 /sound/soc/tegra | |
parent | 2f41a3f48a1400234a4213851453dcb4274322f5 (diff) |
ASoC: tegra: implement suspend/resume for Tegra30 I2S
Add tegra30_i2s_{suspend,resume}. These use regcache functions to
restore all HW registers after power loss during a suspend/resume cycle.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/tegra')
-rw-r--r-- | sound/soc/tegra/tegra30_i2s.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c index 31d092d83c71..bd0ebc09c8be 100644 --- a/sound/soc/tegra/tegra30_i2s.c +++ b/sound/soc/tegra/tegra30_i2s.c | |||
@@ -514,6 +514,24 @@ static int tegra30_i2s_platform_remove(struct platform_device *pdev) | |||
514 | return 0; | 514 | return 0; |
515 | } | 515 | } |
516 | 516 | ||
517 | #ifdef CONFIG_PM_SLEEP | ||
518 | static int tegra30_i2s_suspend(struct device *dev) | ||
519 | { | ||
520 | struct tegra30_i2s *i2s = dev_get_drvdata(dev); | ||
521 | |||
522 | regcache_mark_dirty(i2s->regmap); | ||
523 | |||
524 | return 0; | ||
525 | } | ||
526 | |||
527 | static int tegra30_i2s_resume(struct device *dev) | ||
528 | { | ||
529 | struct tegra30_i2s *i2s = dev_get_drvdata(dev); | ||
530 | |||
531 | return regcache_sync(i2s->regmap); | ||
532 | } | ||
533 | #endif | ||
534 | |||
517 | static const struct of_device_id tegra30_i2s_of_match[] = { | 535 | static const struct of_device_id tegra30_i2s_of_match[] = { |
518 | { .compatible = "nvidia,tegra30-i2s", }, | 536 | { .compatible = "nvidia,tegra30-i2s", }, |
519 | {}, | 537 | {}, |
@@ -522,6 +540,7 @@ static const struct of_device_id tegra30_i2s_of_match[] = { | |||
522 | static const struct dev_pm_ops tegra30_i2s_pm_ops = { | 540 | static const struct dev_pm_ops tegra30_i2s_pm_ops = { |
523 | SET_RUNTIME_PM_OPS(tegra30_i2s_runtime_suspend, | 541 | SET_RUNTIME_PM_OPS(tegra30_i2s_runtime_suspend, |
524 | tegra30_i2s_runtime_resume, NULL) | 542 | tegra30_i2s_runtime_resume, NULL) |
543 | SET_SYSTEM_SLEEP_PM_OPS(tegra30_i2s_suspend, tegra30_i2s_resume) | ||
525 | }; | 544 | }; |
526 | 545 | ||
527 | static struct platform_driver tegra30_i2s_driver = { | 546 | static struct platform_driver tegra30_i2s_driver = { |