From 58045312bf5a56622b04c4c61dab5067ec079b42 Mon Sep 17 00:00:00 2001 From: Varun Wadekar Date: Tue, 23 Nov 2010 17:25:32 +0530 Subject: [PATCH] video: tegra: host: 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. Change-Id: I2b5452dd4512c7ea16532d28a2d2894ab88929ca Author: Alex Frid Signed-off-by: Varun Wadekar --- drivers/video/tegra/host/dev.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/video/tegra/host/dev.c b/drivers/video/tegra/host/dev.c index 42d268e7da59..d98327978ed4 100644 --- a/drivers/video/tegra/host/dev.c +++ b/drivers/video/tegra/host/dev.c @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -574,7 +575,6 @@ static void power_host(struct nvhost_module *mod, enum nvhost_power_action actio if (action == NVHOST_POWER_ACTION_ON) { nvhost_intr_configure(&dev->intr, clk_get_rate(mod->clk[0])); - nvhost_syncpt_reset(&dev->syncpt); } else if (action == NVHOST_POWER_ACTION_OFF) { int i; @@ -738,13 +738,28 @@ static int nvhost_suspend(struct platform_device *pdev, pm_message_t state) struct nvhost_master *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_master *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 -- 2.34.1