aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/memory/tegra/tegra186.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2019-12-22 15:10:30 +0100
committerThierry Reding <treding@nvidia.com>2020-01-09 19:35:54 +0100
commit52d15dd23f0b0f1d1cf87b1581cc5f1f8c22eb0c (patch)
tree99319ea5760db5b44123ca3abea62167f48ba64b /drivers/memory/tegra/tegra186.c
parentmemory: tegra: Add system sleep support (diff)
downloadlinux-dev-52d15dd23f0b0f1d1cf87b1581cc5f1f8c22eb0c.tar.xz
linux-dev-52d15dd23f0b0f1d1cf87b1581cc5f1f8c22eb0c.zip
memory: tegra: Support DVFS on Tegra186 and later
Add a Tegra186 (and later) EMC driver that reads the EMC DVFS tables from BPMP and uses the EMC clock to change the external memory clock. This currently only provides a debugfs interface to show the available frequencies and set lower and upper limits of the allowed range. This can be used for testing the various frequencies. The goal is to eventually integrate this with the interconnect framework so that the EMC frequency can be scaled based on demand from memory clients. Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/memory/tegra/tegra186.c')
-rw-r--r--drivers/memory/tegra/tegra186.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/memory/tegra/tegra186.c b/drivers/memory/tegra/tegra186.c
index 77a313f1bf0e..fe23c4f71f13 100644
--- a/drivers/memory/tegra/tegra186.c
+++ b/drivers/memory/tegra/tegra186.c
@@ -590,10 +590,23 @@ static int tegra186_mc_probe(struct platform_device *pdev)
mc->dev = &pdev->dev;
+ err = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
+ if (err < 0)
+ return err;
+
platform_set_drvdata(pdev, mc);
tegra186_mc_program_sid(mc);
- return err;
+ return 0;
+}
+
+static int tegra186_mc_remove(struct platform_device *pdev)
+{
+ struct tegra186_mc *mc = platform_get_drvdata(pdev);
+
+ of_platform_depopulate(mc->dev);
+
+ return 0;
}
static const struct of_device_id tegra186_mc_of_match[] = {
@@ -627,8 +640,8 @@ static struct platform_driver tegra186_mc_driver = {
.pm = &tegra186_mc_pm_ops,
.suppress_bind_attrs = true,
},
- .prevent_deferred_probe = true,
.probe = tegra186_mc_probe,
+ .remove = tegra186_mc_remove,
};
module_platform_driver(tegra186_mc_driver);