Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 313177
b: refs/heads/master
c: ce9dcb8
h: refs/heads/master
i:
  313175: 3fd9b72
v: v3
  • Loading branch information
Kevin Hilman authored and Sekhar Nori committed Jul 1, 2012
1 parent 47876b3 commit 83ee3e1
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 07caba966dee241cd6599618a243be721195de38
refs/heads/master: ce9dcb8784611c50974d1c6b600c71f5c0a29308
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-davinci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ obj-$(CONFIG_MACH_OMAPL138_HAWKBOARD) += board-omapl138-hawk.o
obj-$(CONFIG_CPU_FREQ) += cpufreq.o
obj-$(CONFIG_CPU_IDLE) += cpuidle.o
obj-$(CONFIG_SUSPEND) += pm.o sleep.o
obj-$(CONFIG_HAVE_CLK) += pm_domain.o
64 changes: 64 additions & 0 deletions trunk/arch/arm/mach-davinci/pm_domain.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Runtime PM support code for DaVinci
*
* Author: Kevin Hilman
*
* Copyright (C) 2012 Texas Instruments, Inc.
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#include <linux/init.h>
#include <linux/pm_runtime.h>
#include <linux/pm_clock.h>
#include <linux/platform_device.h>

#ifdef CONFIG_PM_RUNTIME
static int davinci_pm_runtime_suspend(struct device *dev)
{
int ret;

dev_dbg(dev, "%s\n", __func__);

ret = pm_generic_runtime_suspend(dev);
if (ret)
return ret;

ret = pm_clk_suspend(dev);
if (ret) {
pm_generic_runtime_resume(dev);
return ret;
}

return 0;
}

static int davinci_pm_runtime_resume(struct device *dev)
{
dev_dbg(dev, "%s\n", __func__);

pm_clk_resume(dev);
return pm_generic_runtime_resume(dev);
}
#endif

static struct dev_pm_domain davinci_pm_domain = {
.ops = {
SET_RUNTIME_PM_OPS(davinci_pm_runtime_suspend,
davinci_pm_runtime_resume, NULL)
USE_PLATFORM_PM_SLEEP_OPS
},
};

static struct pm_clk_notifier_block platform_bus_notifier = {
.pm_domain = &davinci_pm_domain,
};

static int __init davinci_pm_runtime_init(void)
{
pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);

return 0;
}
core_initcall(davinci_pm_runtime_init);

0 comments on commit 83ee3e1

Please sign in to comment.