Re: [PATCH v6] memory: tegra210: Support interconnect framework

From: Aaron Kling

Date: Fri Oct 31 2025 - 13:34:11 EST


On Fri, Oct 31, 2025 at 8:19 AM Krzysztof Kozlowski <krzk@xxxxxxxxxx> wrote:
>
> On 27/10/2025 18:48, Aaron Kling via B4 Relay wrote:
> > +
> > + err = dev_pm_opp_of_add_table(emc->dev);
> > + if (err) {
> > + if (err == -ENODEV)
> > + dev_err_probe(emc->dev, err,
> > + "OPP table not found, please update your device tree\n");
> > + else
> > + dev_err_probe(emc->dev, err, "failed to add OPP table\n");
> > +
> > + goto put_hw_table;
> > + }
> > +
> > + max_opps = dev_pm_opp_get_opp_count(emc->dev);
> > + if (max_opps <= 0) {
> > + dev_err_probe(emc->dev, err, "Failed to add OPPs\n");
> > + goto remove_table;
> > + }
> > +
> > + if (emc->num_timings != max_opps) {
> > + dev_err_probe(emc->dev, err, "OPP table does not match emc table\n");
> > + goto remove_table;
> > + }
> > +
> > + for (i = 0; i < emc->num_timings; i++) {
> > + rate = emc->timings[i].rate * 1000;
> > + opp = dev_pm_opp_find_freq_exact(emc->dev, rate, true);
> > + if (IS_ERR(opp)) {
> > + dev_err_probe(emc->dev, err, "Rate %lu not found in OPP table\n", rate);
> > + goto remove_table;
> > + }
> > +
> > + dev_pm_opp_put(opp);
> > + }
> > +
> > + dev_info_once(emc->dev, "OPP HW ver. 0x%x, current clock rate %lu MHz\n",
> > + hw_version, clk_get_rate(emc->clk) / 1000000);
> > +
> > + return 0;
> > +
> > +remove_table:
> > + dev_pm_opp_of_remove_table(emc->dev);
> > +put_hw_table:
> > + dev_pm_opp_put_supported_hw(opp_token);
> > +
> > + return err;
> > +}
> > +
> > static void tegra210_emc_detect(struct tegra210_emc *emc)
> > {
> > u32 value;
> > @@ -1966,6 +2222,14 @@ static int tegra210_emc_probe(struct platform_device *pdev)
> >
> > tegra210_emc_debugfs_init(emc);
> >
> > + err = tegra210_emc_opp_table_init(emc);
> > + if (!err) {
> > + tegra210_emc_rate_requests_init(emc);
> > + tegra210_emc_interconnect_init(emc);
>
> This looks like new ABI or did I miss something and it is already
> documented? If so please always mention in the changelog that bindings
> are already merged to master tree.
>
> Same question for earlier PM OPP.

Both of these bindings were picked up on v3 of the original combined series [0].

Aaron

[0] https://lore.kernel.org/all/175749727162.29308.12636309161261093675.b4-ty@xxxxxxxxxx/