From 5002cec2001d68cb80056d4e07ce8bafd16ce91b Mon Sep 17 00:00:00 2001 From: Sai Gurrappadi Date: Tue, 11 Jul 2017 17:31:35 -0700 Subject: [PATCH] video: tegra: host: t19x: CV cluster clamps for pg The CV cluster needs to be clamped before/after a rail gate/ungate sequence. Since there is no way to hook into the CV power domain's poweroff/poweron functions, track references to the CV domain explicitly by having client CV modules get/put references to the CV cluster. The first client module to poweron will result in the CV cluster clamp getting disabled and the last client module to poweroff will result in the clamp getting set. This will ensure that any subsequent CV rail gating sequence happens with the clamps in place. Jira HOSTX-194 Change-Id: Ic65176e15c1a487a020712a02147cbfc3f2f83c3 Signed-off-by: Sai Gurrappadi Reviewed-on: https://git-master.nvidia.com/r/1517643 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/video/tegra/host/nvdla/nvdla.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/video/tegra/host/nvdla/nvdla.c b/drivers/video/tegra/host/nvdla/nvdla.c index afd70341..f405f5b9 100644 --- a/drivers/video/tegra/host/nvdla/nvdla.c +++ b/drivers/video/tegra/host/nvdla/nvdla.c @@ -37,6 +37,7 @@ #include "t194/t194.h" #include "nvhost_queue.h" +#include "nvhost_cv_pm.h" #include "nvdla/nvdla.h" #include "nvdla/nvdla_debug.h" @@ -531,9 +532,14 @@ int nvhost_nvdla_prepare_poweroff(struct platform_device *pdev) nvdla_dbg_fn(pdev, ""); ret = nvhost_flcn_prepare_poweroff(pdev); - if (ret) + if (ret) { nvdla_dbg_err(pdev, "failed to poweroff\n"); + goto out; + } + cv_cluster_clamp(pdev); + +out: return ret; }