summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/bus.c
diff options
context:
space:
mode:
authorMayuresh Kulkarni <mkulkarni@nvidia.com>2012-02-03 15:06:07 +0530
committerSimone Willett <swillett@nvidia.com>2012-02-13 09:27:15 -0800
commit410041d0247db2434a3013f16930d2fcd16256c8 (patch)
treebf70ce748d00dad01f80f199a1d82b5f31a0ba26 /drivers/video/tegra/host/bus.c
parente8dc4bd80bf2a31b46bf2bad034dcd514c1e11f5 (diff)
video: tegra: host: use runtime pm for clock management
- use runtime pm for clock management of host1x and its clients thus replacing ACM - start a delayed worker after disabling the clock if module supports power gating - in its timeout handler power gate the module after saving its context for next submit - use auto-suspend mode of runtime pm for clock management - pm core seems to keep a ref count on runtime pm thus we cannot use runtime pm's usage_count as an idicator of module idle during suspend - do not use runtime pm call-backs during system suspend. instead manage the clocks directly for context save of modules that support it - enable runtime pm only during boot-up as pm core disables it before suspending the device and enables it after resume for bug 887332 Change-Id: I3b30643e8e75c13684cf4edaaae4429c3a18d6eb Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-on: http://git-master/r/79186 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/host/bus.c')
-rw-r--r--drivers/video/tegra/host/bus.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/drivers/video/tegra/host/bus.c b/drivers/video/tegra/host/bus.c
index 8234d0fa64c3..8fd4aa830afe 100644
--- a/drivers/video/tegra/host/bus.c
+++ b/drivers/video/tegra/host/bus.c
@@ -19,7 +19,7 @@
#include <linux/pm_runtime.h>
#include <linux/nvhost.h>
-
+#include <mach/clk.h>
#include "dev.h"
struct nvhost_master *nvhost;
@@ -487,17 +487,34 @@ static int nvhost_pm_restore_noirq(struct device *dev)
int __weak nvhost_pm_runtime_suspend(struct device *dev)
{
- return pm_generic_runtime_suspend(dev);
+ int i;
+ struct nvhost_device *device = to_nvhost_device(dev);
+
+ for (i = 0; i < device->num_clks; i++)
+ clk_disable(device->clk[i]);
+
+ if (device->can_powergate)
+ schedule_delayed_work(&device->powerstate_down,
+ msecs_to_jiffies(device->powergate_delay));
+
+ return 0;
};
int __weak nvhost_pm_runtime_resume(struct device *dev)
{
- return pm_generic_runtime_resume(dev);
+ int i;
+ struct nvhost_device *device = to_nvhost_device(dev);
+
+ for (i = 0; i < device->num_clks; i++)
+ clk_enable(device->clk[i]);
+
+ return 0;
};
int __weak nvhost_pm_runtime_idle(struct device *dev)
{
- return pm_generic_runtime_idle(dev);
+ pm_runtime_autosuspend(dev);
+ return 0;
};
#else /* !CONFIG_PM_RUNTIME */