summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2010-08-27 00:47:59 -0700
committerYu-Huan Hsu <yhsu@nvidia.com>2010-09-09 21:29:48 -0700
commit573fa124d2094bbe5d0bb3d2fc41d148f8d6a19c (patch)
treef1402a938a773147d352740b15c3185ac547878d /drivers
parent89079690fd134eb2cbd53b72b2f8b9cfba01ff25 (diff)
[tegra/ARM] nvhost: Added nvhost resume.
Added nvhost device resume function, and moved syncpoints restoration here from run-time power_host() control. Respectively added syncpoints saving to nvhost suspend procedure. This change is required, since power_host() has no way to account for display advancing syncpoints after they have been already saved. Bug 726052 (cherry picked from commit 629bbd439e1bb156a8cfce3de9384e42586d4f42) Change-Id: I6149cfa1bff72cb9b5e9e9da0f302c7d8a3032a0 Reviewed-on: http://git-master/r/6282 Tested-by: Aleksandr Frid <afrid@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/tegra/host/nvhost_dev.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/video/tegra/host/nvhost_dev.c b/drivers/video/tegra/host/nvhost_dev.c
index bc63d24c73b7..334e9b6acdb9 100644
--- a/drivers/video/tegra/host/nvhost_dev.c
+++ b/drivers/video/tegra/host/nvhost_dev.c
@@ -567,7 +567,10 @@ static void power_host(struct nvhost_module *mod, enum nvhost_power_action actio
if (action == NVHOST_POWER_ACTION_ON) {
nvhost_intr_start(&dev->intr, clk_get_rate(mod->clk[0]));
- nvhost_syncpt_reset(&dev->syncpt);
+ /* don't do it, as display may have changed syncpt
+ * after the last save
+ * nvhost_syncpt_reset(&dev->syncpt);
+ */
} else if (action == NVHOST_POWER_ACTION_OFF) {
int i;
for (i = 0; i < NVHOST_NUMCHANNELS; i++)
@@ -723,13 +726,28 @@ static int nvhost_suspend(struct platform_device *pdev, pm_message_t state)
struct nvhost_dev *host = platform_get_drvdata(pdev);
dev_info(&pdev->dev, "suspending\n");
nvhost_module_suspend(&host->mod);
+ clk_enable(host->mod.clk[0]);
+ nvhost_syncpt_save(&host->syncpt);
+ clk_disable(host->mod.clk[0]);
dev_info(&pdev->dev, "suspended\n");
return 0;
}
+static int nvhost_resume(struct platform_device *pdev)
+{
+ struct nvhost_dev *host = platform_get_drvdata(pdev);
+ dev_info(&pdev->dev, "resuming\n");
+ clk_enable(host->mod.clk[0]);
+ nvhost_syncpt_reset(&host->syncpt);
+ clk_disable(host->mod.clk[0]);
+ dev_info(&pdev->dev, "resumed\n");
+ return 0;
+}
+
static struct platform_driver nvhost_driver = {
.remove = __exit_p(nvhost_remove),
.suspend = nvhost_suspend,
+ .resume = nvhost_resume,
.driver = {
.owner = THIS_MODULE,
.name = DRIVER_NAME