memory: tegra186-emc: Register rates with opp

This will be used in the upcoming non-bpmp icc support, which will use
the common tegra emc rate support which uses the opp framework.

Change-Id: If4a3efaae0ad06de029ffd34c2b11faea5044d58
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
This commit is contained in:
Aaron Kling committed 2026-08-22 11:35:33 -05:00
1 parent fd1455c178
commit 0b691900f2
1 file changed
+6
+6
View File
@@ -9,6 +9,7 @@
#include <linux/mod_devicetable.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/pm_opp.h>
#include <soc/tegra/bpmp.h>
#include "mc.h"
@@ -196,12 +197,15 @@ static int tegra186_emc_get_emc_dvfs_latency(struct tegra186_emc *emc)
if (emc->dvfs[i].rate > emc->debugfs.max_rate)
emc->debugfs.max_rate = emc->dvfs[i].rate;
dev_pm_opp_add(emc->dev, emc->dvfs[i].rate, 0);
dev_dbg(emc->dev, " %2u: %lu Hz -> %lu us\n", i,
emc->dvfs[i].rate, emc->dvfs[i].latency);
}
err = clk_set_rate_range(emc->clk, emc->debugfs.min_rate, emc->debugfs.max_rate);
if (err < 0) {
dev_pm_opp_remove_all_dynamic(emc->dev);
dev_err(emc->dev, "failed to set rate range [%lu-%lu] for %pC\n",
emc->debugfs.min_rate, emc->debugfs.max_rate, emc->clk);
return err;
@@ -385,6 +389,8 @@ static void tegra186_emc_remove(struct platform_device *pdev)
debugfs_remove_recursive(emc->debugfs.root);
dev_pm_opp_remove_all_dynamic(emc->dev);
mc->bpmp = NULL;
tegra_bpmp_put(emc->bpmp);
}