host: vi: Deprecate nvhost_module_pm_ops

Deprecate the usage of nvhost_module_pm_ops as part of the wider
nvhost API deprecation while maintaining equivalent functionality.

The VI driver does not register prepare_poweroff, poweron_reset,
finalize_poweron callbacks nor set the clock gating regs with nvhost,
so the runtime operations will only call clk APIs.

Bug 4921620

Change-Id: I639d428f5ea1ed1071d4502a877841b7049b9cd2
Signed-off-by: Akihiro Mizusawa <amizusawa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3320983
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Tested-by: FNU Raunak <fraunak@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: FNU Raunak <fraunak@nvidia.com>
Reviewed-by: Chinniah Poosapadi <cpoosapadi@nvidia.com>
This commit is contained in:
Akihiro Mizusawa
2025-03-17 19:09:14 +00:00
committed by Jon Hunter
parent 6e5aec9ce4
commit c84bc1ebe7

View File

@@ -515,21 +515,18 @@ static int vi_runtime_suspend(struct device *dev)
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct nvhost_device_data *info = platform_get_drvdata(pdev); struct nvhost_device_data *info = platform_get_drvdata(pdev);
struct host_vi5 *vi5 = info->private_data; struct host_vi5 *vi5 = info->private_data;
int err; int err = 0;
if (nvhost_module_pm_ops.runtime_suspend != NULL) { clk_bulk_disable_unprepare(info->num_clks, info->clks);
err = nvhost_module_pm_ops.runtime_suspend(dev);
if (!err && vi5->icc_write) { if (vi5->icc_write) {
err = icc_set_bw(vi5->icc_write, 0, 0); err = icc_set_bw(vi5->icc_write, 0, 0);
if (err) if (err)
dev_warn(dev, dev_warn(dev,
"failed to set icc_write bw: %d\n", err); "failed to set icc_write bw: %d\n", err);
return 0;
}
return err;
} }
return -EOPNOTSUPP; return err;
} }
static int vi_runtime_resume(struct device *dev) static int vi_runtime_resume(struct device *dev)
@@ -537,21 +534,23 @@ static int vi_runtime_resume(struct device *dev)
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct nvhost_device_data *pdata = platform_get_drvdata(pdev); struct nvhost_device_data *pdata = platform_get_drvdata(pdev);
struct host_vi5 *vi5 = pdata->private_data; struct host_vi5 *vi5 = pdata->private_data;
int err; int err = 0;
if (nvhost_module_pm_ops.runtime_resume != NULL) {
err = nvhost_module_pm_ops.runtime_resume(dev); err = clk_bulk_prepare_enable(pdata->num_clks, pdata->clks);
if (!err && vi5->icc_write) { if (err) {
err = icc_set_bw(vi5->icc_write, 0, UINT_MAX); dev_warn(dev, "failed to enable clocks: %d\n", err);
if (err)
dev_warn(dev,
"failed to set icc_write bw: %d\n", err);
return 0;
}
return err; return err;
} }
return -EOPNOTSUPP; if (vi5->icc_write) {
err = icc_set_bw(vi5->icc_write, 0, UINT_MAX);
if (err)
dev_warn(dev,
"failed to set icc_write bw: %d\n", err);
}
return err;
} }
const struct dev_pm_ops vi_pm_ops = { const struct dev_pm_ops vi_pm_ops = {