1 /*
2  * Copyright (c) 2020-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 POWER_STATE_TOKEN_H
10 #define POWER_STATE_TOKEN_H
11 
12 #include "hdf_sref.h"
13 #include "power_state_token_if.h"
14 #include "hdf_pm.h"
15 
16 struct PowerStateToken {
17     struct IPowerStateToken super;
18     const struct IPowerEventListener *listener;
19     struct HdfDeviceObject *deviceObject;
20     struct HdfSRef wakeRef;
21     HdfPsmState psmState;
22     uint32_t mode;
23 };
24 
25 struct PowerStateToken *PowerStateTokenNewInstance(
26     struct HdfDeviceObject *deviceObject, const struct IPowerEventListener *listener);
27 void PowerStateTokenFreeInstance(struct PowerStateToken *stateToken);
28 int PowerStateChange(struct PowerStateToken *stateToken, uint32_t pEvent);
29 #endif /* POWER_STATE_TOKEN_H */