diff options
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux/pm.h')
-rw-r--r-- | sys/compat/linuxkpi/common/include/linux/pm.h | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/pm.h b/sys/compat/linuxkpi/common/include/linux/pm.h index d67cebb9764a..871c7b587864 100644 --- a/sys/compat/linuxkpi/common/include/linux/pm.h +++ b/sys/compat/linuxkpi/common/include/linux/pm.h @@ -26,17 +26,20 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_PM_H #define _LINUXKPI_LINUX_PM_H +#include <linux/kernel.h> /* pr_debug */ +#include <asm/atomic.h> + /* Needed but breaks linux_usb.c */ /* #include <linux/completion.h> */ /* #include <linux/wait.h> */ +struct device; + typedef struct pm_message { int event; } pm_message_t; @@ -44,23 +47,50 @@ typedef struct pm_message { struct dev_pm_domain { }; +struct dev_pm_info { + atomic_t usage_count; +}; + #define PM_EVENT_FREEZE 0x0001 #define PM_EVENT_SUSPEND 0x0002 +#define pm_sleep_ptr(_p) \ + IS_ENABLED(CONFIG_PM_SLEEP) ? (_p) : NULL + #ifdef CONFIG_PM_SLEEP #define SIMPLE_DEV_PM_OPS(_name, _suspendfunc, _resumefunc) \ const struct dev_pm_ops _name = { \ - .suspend = _suspendfunc, \ - .resume = _resumefunc, \ - .freeze = _suspendfunc, \ - .thaw = _resumefunc, \ - .poweroff = _suspendfunc, \ - .restore = _resumefunc, \ + .suspend = _suspendfunc, \ + .resume = _resumefunc, \ + .freeze = _suspendfunc, \ + .thaw = _resumefunc, \ + .poweroff = _suspendfunc, \ + .restore = _resumefunc, \ +} + +#define DEFINE_SIMPLE_DEV_PM_OPS(_name, _suspendfunc, _resumefunc) \ +const struct dev_pm_ops _name = { \ + .suspend = _suspendfunc, \ + .resume = _resumefunc, \ + .freeze = _suspendfunc, \ + .thaw = _resumefunc, \ + .poweroff = _suspendfunc, \ + .restore = _resumefunc, \ } #else #define SIMPLE_DEV_PM_OPS(_name, _suspendfunc, _resumefunc) \ const struct dev_pm_ops _name = { \ } +#define DEFINE_SIMPLE_DEV_PM_OPS(_name, _suspendfunc, _resumefunc) \ +const struct dev_pm_ops _name = { \ +} #endif +static inline void +pm_wakeup_event(struct device *dev __unused, unsigned int x __unused) +{ + + pr_debug("%s: TODO\n", __func__); +} + #endif /* _LINUXKPI_LINUX_PM_H */ |