1 /* 2 * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 */ 18 #ifndef __LINUX_PM_H__ 19 #define __LINUX_PM_H__ 20 21 #include "linux/list.h" 22 23 #ifdef __cplusplus 24 #if __cplusplus 25 extern "C" { 26 #endif /* __cplusplus */ 27 #endif /* __cplusplus */ 28 29 typedef struct pm_message { 30 int event; 31 } dev_pm_message_t; 32 33 struct dev_pm_info { 34 dev_pm_message_t power_state; 35 LOS_DL_LIST entry; 36 }; 37 38 #define PM_EVENT_INVALID (-1) 39 #define PM_EVENT_ON 0x0000 40 #define PM_EVENT_FREEZE 0x0001 41 #define PM_EVENT_SUSPEND 0x0002 42 #define PM_EVENT_HIBERNATE 0x0004 43 #define PM_EVENT_QUIESCE 0x0008 44 #define PM_EVENT_RESUME 0x0010 45 46 #define PMSG_INVALID ((struct pm_message){ .event = PM_EVENT_INVALID, }) 47 #define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) 48 #define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) 49 #define PMSG_QUIESCE ((struct pm_message){ .event = PM_EVENT_QUIESCE, }) 50 #define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, }) 51 #define PMSG_HIBERNATE ((struct pm_message){ .event = PM_EVENT_HIBERNATE, }) 52 #define PMSG_RESUME ((struct pm_message){ .event = PM_EVENT_RESUME, }) 53 54 int dpm_suspend_start(dev_pm_message_t state); 55 void dpm_resume_end(dev_pm_message_t state); 56 57 #ifdef __cplusplus 58 #if __cplusplus 59 } 60 #endif /* __cplusplus */ 61 #endif /* __cplusplus */ 62 63 #endif 64 65