1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 #ifndef HDF_POWER_MANAGER_H 10 #define HDF_POWER_MANAGER_H 11 12 #include "hdf_task_queue.h" 13 #include "power_state_token.h" 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif /* __cplusplus */ 18 19 typedef enum { 20 HDF_PM_REQUEST_ACQUIRE, 21 HDF_PM_REQUEST_RELEASE, 22 } HDF_PM_REQUEST_TYPE; 23 24 struct HdfPmRequest { 25 struct PowerStateToken *token; 26 HDF_PM_REQUEST_TYPE pmType; 27 struct HdfTaskType task; 28 }; 29 30 struct PmTaskQueue *HdfPmTaskQueueInit(HdfTaskFunc func); 31 32 int32_t HdfPowerManagerInit(void); 33 void HdfPmTaskPut(struct PowerStateToken *powerToken, HDF_PM_REQUEST_TYPE type); 34 void HdfPowerManagerExit(void); 35 36 #ifdef __cplusplus 37 } 38 #endif /* __cplusplus */ 39 40 #endif /* HDF_POWER_MANAGER_H */ 41