aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/tegra/tegra30_i2s.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/tegra/tegra30_i2s.c')
-rw-r--r--sound/soc/tegra/tegra30_i2s.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c
index 31d092d83c71..d04146cad61f 100644
--- a/sound/soc/tegra/tegra30_i2s.c
+++ b/sound/soc/tegra/tegra30_i2s.c
@@ -514,6 +514,31 @@ 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
518static 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
527static int tegra30_i2s_resume(struct device *dev)
528{
529 struct tegra30_i2s *i2s = dev_get_drvdata(dev);
530 int ret;
531
532 ret = pm_runtime_get_sync(dev);
533 if (ret < 0)
534 return ret;
535 ret = regcache_sync(i2s->regmap);
536 pm_runtime_put(dev);
537
538 return ret;
539}
540#endif
541
517static const struct of_device_id tegra30_i2s_of_match[] = { 542static const struct of_device_id tegra30_i2s_of_match[] = {
518 { .compatible = "nvidia,tegra30-i2s", }, 543 { .compatible = "nvidia,tegra30-i2s", },
519 {}, 544 {},
@@ -522,6 +547,7 @@ static const struct of_device_id tegra30_i2s_of_match[] = {
522static const struct dev_pm_ops tegra30_i2s_pm_ops = { 547static const struct dev_pm_ops tegra30_i2s_pm_ops = {
523 SET_RUNTIME_PM_OPS(tegra30_i2s_runtime_suspend, 548 SET_RUNTIME_PM_OPS(tegra30_i2s_runtime_suspend,
524 tegra30_i2s_runtime_resume, NULL) 549 tegra30_i2s_runtime_resume, NULL)
550 SET_SYSTEM_SLEEP_PM_OPS(tegra30_i2s_suspend, tegra30_i2s_resume)
525}; 551};
526 552
527static struct platform_driver tegra30_i2s_driver = { 553static struct platform_driver tegra30_i2s_driver = {