Ignore:
Timestamp:
Mar 18, 2021, 8:57:36 PM (4 years ago)
Author:
David Azarewicz
Message:

Merge changes from Paul's uniaud32next branch.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/include/linux/pm.h

    r441 r679  
    2222#define _LINUX_PM_H
    2323
    24 #ifdef __KERNEL__
    25 
    26 #include <linux/config.h>
    2724#include <linux/list.h>
    2825#include <asm/atomic.h>
     26#include <linux/workqueue.h>
     27
     28enum rpm_status {
     29        RPM_ACTIVE = 0,
     30        RPM_RESUMING,
     31        RPM_SUSPENDED,
     32        RPM_SUSPENDING,
     33};
    2934
    3035/*
     
    230235
    231236struct dev_pm_info {
    232 #ifdef  CONFIG_PM
     237        unsigned int            async_suspend:1;
     238        bool                    is_prepared:1;  /* Owned by the PM core */
    233239        u32                     power_state;
    234240        u8                      * saved_state;
     
    236242        struct device           * pm_parent;
    237243        struct list_head        entry;
    238 #endif
    239244};
    240245
     
    247252
    248253
    249 #endif /* __KERNEL__ */
    250 
    251 typedef u32 __bitwise pm_message_t;
     254typedef struct pm_message {
     255        int event;
     256} pm_message_t;
     257
    252258#define PMSG_FREEZE     3
    253259#define PMSG_SUSPEND    3
    254260#define PMSG_ON         0
     261#define PMSG_RESUME     0
     262#define PMSG_THAW       0
     263#define PMSG_RESTORE    0
     264
     265
     266struct dev_pm_ops {
     267        int (*prepare)(struct device *dev);
     268        void (*complete)(struct device *dev);
     269        int (*suspend)(struct device *dev);
     270        int (*resume)(struct device *dev);
     271        int (*freeze)(struct device *dev);
     272        int (*thaw)(struct device *dev);
     273        int (*poweroff)(struct device *dev);
     274        int (*restore)(struct device *dev);
     275        int (*suspend_late)(struct device *dev);
     276        int (*resume_early)(struct device *dev);
     277        int (*freeze_late)(struct device *dev);
     278        int (*thaw_early)(struct device *dev);
     279        int (*poweroff_late)(struct device *dev);
     280        int (*restore_early)(struct device *dev);
     281        int (*suspend_noirq)(struct device *dev);
     282        int (*resume_noirq)(struct device *dev);
     283        int (*freeze_noirq)(struct device *dev);
     284        int (*thaw_noirq)(struct device *dev);
     285        int (*poweroff_noirq)(struct device *dev);
     286        int (*restore_noirq)(struct device *dev);
     287        int (*runtime_suspend)(struct device *dev);
     288        int (*runtime_resume)(struct device *dev);
     289        int (*runtime_idle)(struct device *dev);
     290};
     291
     292#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
     293        .suspend = suspend_fn, \
     294        .resume = resume_fn, \
     295        .freeze = suspend_fn, \
     296        .thaw = resume_fn, \
     297        .poweroff = suspend_fn, \
     298        .restore = resume_fn,
     299
     300/*
     301 * Use this if you want to use the same suspend and resume callbacks for suspend
     302 * to RAM and hibernation.
     303 */
     304#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
     305const struct dev_pm_ops name = { \
     306        SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
     307}
     308
     309#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
     310        .runtime_suspend = suspend_fn, \
     311        .runtime_resume = resume_fn, \
     312        .runtime_idle = idle_fn,
     313
     314
     315/*
     316 * Power domains provide callbacks that are executed during system suspend,
     317 * hibernation, system resume and during runtime PM transitions along with
     318 * subsystem-level and driver-level callbacks.
     319 */
     320struct dev_pm_domain {
     321        struct dev_pm_ops       ops;
     322};
     323
     324#define PM_EVENT_RESTORE        0x0040
    255325
    256326#endif /* _LINUX_PM_H */
Note: See TracChangeset for help on using the changeset viewer.