summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2011-09-09 17:13:47 +0530
committerLee Jones <lee.jones@linaro.org>2012-01-05 10:06:58 +0000
commita40064766a461d2c808c0aec1e43eef5d101a5e4 (patch)
tree4fcbe0c7f21e1e16295ddb7dd19f41ec347a0726 /include
parentc8ef1305d58f080c5b57a39a97352a3f68c787dc (diff)
PM: Export AMBA bus type's default PM callbacks
Export the default PM callbacks defined for the platform bus type so that they can be used by power domains for suspending and resuming platform devices in the future. Like 69c9dd1ecf446ad8a830e4afc539a2a1adc85b78 ("PM: Export platform bus type's default PM callbacks"). Change-Id: I92aa13abe15c153aa5d90def7eb212626f6d0213 Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/amba/bus.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index fcbbe71a3cc..849aec9aba5 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -94,4 +94,64 @@ void amba_release_regions(struct amba_device *);
#define amba_manf(d) AMBA_MANF_BITS((d)->periphid)
#define amba_part(d) AMBA_PART_BITS((d)->periphid)
+#ifdef CONFIG_PM_SLEEP
+extern int amba_pm_prepare(struct device *dev);
+extern void amba_pm_complete(struct device *dev);
+#else
+#define amba_pm_prepare NULL
+#define amba_pm_complete NULL
+#endif
+
+#ifdef CONFIG_SUSPEND
+extern int amba_pm_suspend(struct device *dev);
+extern int amba_pm_suspend_noirq(struct device *dev);
+extern int amba_pm_resume(struct device *dev);
+extern int amba_pm_resume_noirq(struct device *dev);
+#else
+#define amba_pm_suspend NULL
+#define amba_pm_resume NULL
+#define amba_pm_suspend_noirq NULL
+#define amba_pm_resume_noirq NULL
+#endif
+
+#ifdef CONFIG_HIBERNATE_CALLBACKS
+extern int amba_pm_freeze(struct device *dev);
+extern int amba_pm_freeze_noirq(struct device *dev);
+extern int amba_pm_thaw(struct device *dev);
+extern int amba_pm_thaw_noirq(struct device *dev);
+extern int amba_pm_poweroff(struct device *dev);
+extern int amba_pm_poweroff_noirq(struct device *dev);
+extern int amba_pm_restore(struct device *dev);
+extern int amba_pm_restore_noirq(struct device *dev);
+#else
+#define amba_pm_freeze NULL
+#define amba_pm_thaw NULL
+#define amba_pm_poweroff NULL
+#define amba_pm_restore NULL
+#define amba_pm_freeze_noirq NULL
+#define amba_pm_thaw_noirq NULL
+#define amba_pm_poweroff_noirq NULL
+#define amba_pm_restore_noirq NULL
+#endif
+
+#ifdef CONFIG_PM_SLEEP
+#define USE_AMBA_PM_SLEEP_OPS \
+ .prepare = amba_pm_prepare, \
+ .complete = amba_pm_complete, \
+ .suspend = amba_pm_suspend, \
+ .resume = amba_pm_resume, \
+ .freeze = amba_pm_freeze, \
+ .thaw = amba_pm_thaw, \
+ .poweroff = amba_pm_poweroff, \
+ .restore = amba_pm_restore, \
+ .suspend_noirq = amba_pm_suspend_noirq, \
+ .resume_noirq = amba_pm_resume_noirq, \
+ .freeze_noirq = amba_pm_freeze_noirq, \
+ .thaw_noirq = amba_pm_thaw_noirq, \
+ .poweroff_noirq = amba_pm_poweroff_noirq, \
+ .restore_noirq = amba_pm_restore_noirq,
+#else
+#define USE_AMBA_PM_SLEEP_OPS
+#endif
+
#endif