summaryrefslogtreecommitdiffstats
path: root/backport-include/linux/pm_runtime.h
diff options
context:
space:
mode:
authorroot <root@artemis.panaceas.org>2015-12-25 15:00:15 +0000
committerroot <root@artemis.panaceas.org>2015-12-25 15:00:15 +0000
commitddd86436f4e3643c04b797f858dab95d5f2e4de9 (patch)
treebfe7a780cf9a2f4fc33aec32c82e625e79dece1f /backport-include/linux/pm_runtime.h
downloadbackports-3.10.19-1-master.tar.gz
backports-3.10.19-1-master.tar.bz2
backports-3.10.19-1-master.zip
Diffstat (limited to 'backport-include/linux/pm_runtime.h')
-rw-r--r--backport-include/linux/pm_runtime.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/backport-include/linux/pm_runtime.h b/backport-include/linux/pm_runtime.h
new file mode 100644
index 0000000..31cfde9
--- /dev/null
+++ b/backport-include/linux/pm_runtime.h
@@ -0,0 +1,65 @@
+#include <linux/version.h>
+
+#ifndef __COMPAT_LINUX_PM_RUNTIME_H
+#define __COMPAT_LINUX_PM_RUNTIME_H
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
+#include_next <linux/pm_runtime.h>
+#else
+
+static inline void pm_runtime_enable(struct device *dev) {}
+
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
+/*
+ * Backports 5e928f77a09a07f9dd595bb8a489965d69a83458
+ * run-time power management cannot really be backported
+ * given that the implementation added bus specific
+ * callbacks that we won't have on older kernels. If
+ * you really want run-time power management or good
+ * power management upgrade your kernel. We'll just
+ * compile this out as if run-time power management was
+ * disabled just as the kernel disables run-time power management
+ * when CONFIG_PM_RUNTIME is disabled.
+ */
+static inline void pm_runtime_init(struct device *dev) {}
+static inline void pm_runtime_remove(struct device *dev) {}
+static inline int pm_runtime_get(struct device *dev)
+{
+ return 0;
+}
+
+static inline int pm_runtime_get_sync(struct device *dev)
+{
+ return 0;
+}
+
+static inline int pm_runtime_put(struct device *dev)
+{
+ return 0;
+}
+
+static inline int pm_runtime_put_sync(struct device *dev)
+{
+ return 0;
+}
+
+static inline int pm_runtime_set_active(struct device *dev)
+{
+ return 0;
+}
+
+static inline void pm_runtime_set_suspended(struct device *dev)
+{
+}
+
+static inline void pm_runtime_disable(struct device *dev)
+{
+}
+
+static inline void pm_runtime_put_noidle(struct device *dev) {}
+static inline void pm_runtime_get_noresume(struct device *dev) {}
+#endif
+
+#endif