diff options
author | Thierry Reding <treding@nvidia.com> | 2019-12-22 15:10:29 +0100 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2020-01-09 19:12:55 +0100 |
commit | 177602b006414b02152d3ef670746beb2bfde9cd (patch) | |
tree | ea88eff982bb4510aa7ef9335c19ea3ebceaf02d /drivers/memory | |
parent | 6d3ba7616347d3787f361bd7f2fcf8f01bf52c2a (diff) | |
download | linux-177602b006414b02152d3ef670746beb2bfde9cd.tar.bz2 |
memory: tegra: Add system sleep support
Add system suspend/resume support for the memory controller found on
Tegra186 and later. This is required so that the SID registers can be
reprogrammed after their content was lost during system sleep.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/memory')
-rw-r--r-- | drivers/memory/tegra/tegra186.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/memory/tegra/tegra186.c b/drivers/memory/tegra/tegra186.c index 57895116c8e5..77a313f1bf0e 100644 --- a/drivers/memory/tegra/tegra186.c +++ b/drivers/memory/tegra/tegra186.c @@ -602,10 +602,29 @@ static const struct of_device_id tegra186_mc_of_match[] = { }; MODULE_DEVICE_TABLE(of, tegra186_mc_of_match); +static int tegra186_mc_suspend(struct device *dev) +{ + return 0; +} + +static int tegra186_mc_resume(struct device *dev) +{ + struct tegra186_mc *mc = dev_get_drvdata(dev); + + tegra186_mc_program_sid(mc); + + return 0; +} + +static const struct dev_pm_ops tegra186_mc_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(tegra186_mc_suspend, tegra186_mc_resume) +}; + static struct platform_driver tegra186_mc_driver = { .driver = { .name = "tegra186-mc", .of_match_table = tegra186_mc_of_match, + .pm = &tegra186_mc_pm_ops, .suppress_bind_attrs = true, }, .prevent_deferred_probe = true, |