OMAP2+ / PM: move runtime PM implementation to use device power domains
In commit 7538e3db6e
(PM: add support
for device power domains) a better way for handling platform-specific
power hooks was introduced.
Rather than using the platform_bus dev_pm_ops overrides
(platform_bus_set_pm_ops()), this patch moves the OMAP runtime PM
implementation over to using device power domains.
Since OMAP is the only user of platform_bus_set_pm_ops(), that
interface can be removed (and will be in a forthcoming patch.)
[rjw: Rebased on top of a previous change modifying the handling of
power domains by the PM core so that power domain callbacks take
precendence over subsystem-level PM callbacks.]
Signed-off-by: Kevin Hilman <khilman@ti.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
This commit is contained in:

committed by
Rafael J. Wysocki

parent
8b313a38ec
commit
638080c37a
@@ -536,6 +536,28 @@ int omap_early_device_register(struct omap_device *od)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int _od_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
|
||||
return omap_device_idle(pdev);
|
||||
}
|
||||
|
||||
static int _od_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
|
||||
return omap_device_enable(pdev);
|
||||
}
|
||||
|
||||
static struct dev_power_domain omap_device_power_domain = {
|
||||
.ops = {
|
||||
.runtime_suspend = _od_runtime_suspend,
|
||||
.runtime_resume = _od_runtime_resume,
|
||||
USE_PLATFORM_PM_SLEEP_OPS
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* omap_device_register - register an omap_device with one omap_hwmod
|
||||
* @od: struct omap_device * to register
|
||||
@@ -549,6 +571,7 @@ int omap_device_register(struct omap_device *od)
|
||||
pr_debug("omap_device: %s: registering\n", od->pdev.name);
|
||||
|
||||
od->pdev.dev.parent = &omap_device_parent;
|
||||
od->pdev.dev.pwr_domain = &omap_device_power_domain;
|
||||
return platform_device_register(&od->pdev);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user