include/linux/: Spelling fixes
[linux-2.6.git] / include / linux / pm.h
index 6b27e07..eccf59e 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <linux/list.h>
 #include <asm/atomic.h>
+#include <asm/errno.h>
 
 /*
  * Power management requests... these are passed to pm_send_all() and friends.
@@ -94,42 +95,14 @@ struct pm_dev
 };
 
 /* Functions above this comment are list-based old-style power
- * managment. Please avoid using them.  */
+ * management. Please avoid using them.  */
 
 /*
  * Callbacks for platform drivers to implement.
  */
 extern void (*pm_idle)(void);
 extern void (*pm_power_off)(void);
-
-typedef int __bitwise suspend_state_t;
-
-#define PM_SUSPEND_ON          ((__force suspend_state_t) 0)
-#define PM_SUSPEND_STANDBY     ((__force suspend_state_t) 1)
-#define PM_SUSPEND_MEM         ((__force suspend_state_t) 3)
-#define PM_SUSPEND_DISK                ((__force suspend_state_t) 4)
-#define PM_SUSPEND_MAX         ((__force suspend_state_t) 5)
-
-typedef int __bitwise suspend_disk_method_t;
-
-#define        PM_DISK_FIRMWARE        ((__force suspend_disk_method_t) 1)
-#define        PM_DISK_PLATFORM        ((__force suspend_disk_method_t) 2)
-#define        PM_DISK_SHUTDOWN        ((__force suspend_disk_method_t) 3)
-#define        PM_DISK_REBOOT          ((__force suspend_disk_method_t) 4)
-#define        PM_DISK_MAX             ((__force suspend_disk_method_t) 5)
-
-struct pm_ops {
-       suspend_disk_method_t pm_disk_mode;
-       int (*valid)(suspend_state_t state);
-       int (*prepare)(suspend_state_t state);
-       int (*enter)(suspend_state_t state);
-       int (*finish)(suspend_state_t state);
-};
-
-extern void pm_set_ops(struct pm_ops *);
-extern struct pm_ops *pm_ops;
-extern int pm_suspend(suspend_state_t state);
-
+extern void (*pm_power_off_prepare)(void);
 
 /*
  * Device power management
@@ -203,24 +176,17 @@ typedef struct pm_message {
 struct dev_pm_info {
        pm_message_t            power_state;
        unsigned                can_wakeup:1;
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
        unsigned                should_wakeup:1;
-       pm_message_t            prev_state;
-       void                    * saved_state;
-       struct device           * pm_parent;
        struct list_head        entry;
 #endif
 };
 
-extern void device_pm_set_parent(struct device * dev, struct device * parent);
-
 extern int device_power_down(pm_message_t state);
 extern void device_power_up(void);
 extern void device_resume(void);
 
-#ifdef CONFIG_PM
-extern suspend_disk_method_t pm_disk_mode;
-
+#ifdef CONFIG_PM_SLEEP
 extern int device_suspend(pm_message_t state);
 extern int device_prepare_suspend(pm_message_t state);
 
@@ -229,8 +195,6 @@ extern int device_prepare_suspend(pm_message_t state);
 #define device_may_wakeup(dev) \
        (device_can_wakeup(dev) && (dev)->power.should_wakeup)
 
-extern int dpm_runtime_suspend(struct device *, pm_message_t);
-extern void dpm_runtime_resume(struct device *);
 extern void __suspend_report_result(const char *function, void *fn, int ret);
 
 #define suspend_report_result(fn, ret)                                 \
@@ -238,28 +202,38 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
                __suspend_report_result(__FUNCTION__, fn, ret);         \
        } while (0)
 
-#else /* !CONFIG_PM */
+/*
+ * Platform hook to activate device wakeup capability, if that's not already
+ * handled by enable_irq_wake() etc.
+ * Returns zero on success, else negative errno
+ */
+extern int (*platform_enable_wakeup)(struct device *dev, int is_on);
 
-static inline int device_suspend(pm_message_t state)
+static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
 {
+       if (platform_enable_wakeup)
+               return (*platform_enable_wakeup)(dev, is_on);
        return 0;
 }
 
-#define device_set_wakeup_enable(dev,val)      do{}while(0)
-#define device_may_wakeup(dev)                 (0)
+#else /* !CONFIG_PM_SLEEP */
 
-static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state)
+static inline int device_suspend(pm_message_t state)
 {
        return 0;
 }
 
-static inline void dpm_runtime_resume(struct device * dev)
-{
-}
+#define device_set_wakeup_enable(dev,val)      do{}while(0)
+#define device_may_wakeup(dev)                 (0)
 
 #define suspend_report_result(fn, ret) do { } while (0)
 
-#endif
+static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
+{
+       return 0;
+}
+
+#endif /* !CONFIG_PM_SLEEP */
 
 /* changes to device_may_wakeup take effect on the next pm state change.
  * by default, devices should wakeup if they can.
@@ -272,6 +246,15 @@ static inline void dpm_runtime_resume(struct device * dev)
                device_set_wakeup_enable(dev,val); \
        } while(0)
 
+/*
+ * Global Power Management flags
+ * Used to keep APM and ACPI from both being active
+ */
+extern unsigned int    pm_flags;
+
+#define PM_APM 1
+#define PM_ACPI        2
+
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_PM_H */