Currently the kernel relies on a global variable to reference the PMC
context. Use an explicit lookup for the PMC and pass that to the public
PMC APIs.
Acked-by: Danilo Krummrich <dakr@kernel.org>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
struct regulator *vdd;
+ struct tegra_pmc *pmc;
+
struct {
/*
* Protects accesses to mm from subsystems
reset_control_assert(tdev->rst);
udelay(10);
- ret = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D);
+ ret = tegra_pmc_powergate_remove_clamping(tdev->pmc,
+ TEGRA_POWERGATE_3D);
if (ret)
goto err_clamp;
udelay(10);
goto free;
}
+ tdev->pmc = devm_tegra_pmc_get(&pdev->dev);
+ if (IS_ERR(tdev->pmc)) {
+ ret = PTR_ERR(tdev->pmc);
+ goto free;
+ }
+
/**
* The IOMMU bit defines the upper limit of the GPU-addressable space.
*/