diff options
author | Varun Wadekar <vwadekar@nvidia.com> | 2010-11-23 17:25:32 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:36:47 -0800 |
commit | fa955b8bf1506483286734cb1dd319774c74dc21 (patch) | |
tree | ff6cf6d1932564f78e0c760c57b6bec36a1386fd /drivers | |
parent | f0ae588bfd57eb551d4a702156b97319fc1aa897 (diff) |
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 <afrid@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/tegra/host/dev.c | 17 |
1 files changed, 16 insertions, 1 deletions
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 <linux/platform_device.h> #include <linux/uaccess.h> #include <linux/file.h> +#include <linux/clk.h> #include <asm/io.h> @@ -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 |