diff options
Diffstat (limited to 'include/chipset.h')
-rw-r--r-- | include/chipset.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/include/chipset.h b/include/chipset.h index 8e126ccddc..ac192f29c9 100644 --- a/include/chipset.h +++ b/include/chipset.h @@ -13,20 +13,29 @@ #include "common.h" -/* Chipset state. +/* Chipset state mask * * Note that this is a non-exhaustive list of states which the main chipset can * be in, and is potentially one-to-many for real, underlying chipset states. * That's why chipset_in_state() asks "Is the chipset in something * approximating this state?" and not "Tell me what state the chipset is in and * I'll compare it myself with the state(s) I want." */ -enum chipset_state { - CHIPSET_STATE_SOFT_OFF, /* Soft off (S5) */ - CHIPSET_STATE_SUSPEND, /* Suspend (S3) */ - CHIPSET_STATE_ON, /* On (S0) */ +enum chipset_state_mask { + CHIPSET_STATE_HARD_OFF = 0x01, /* Hard off (G3) */ + CHIPSET_STATE_SOFT_OFF = 0x02, /* Soft off (S5) */ + CHIPSET_STATE_SUSPEND = 0x04, /* Suspend (S3) */ + CHIPSET_STATE_ON = 0x08, /* On (S0) */ + /* Common combinations */ + CHIPSET_STATE_ANY_OFF = (CHIPSET_STATE_HARD_OFF | + CHIPSET_STATE_SOFT_OFF), /* Any off state */ }; -/* Returns non-zero if the chipset is in the specified state. */ -int chipset_in_state(enum chipset_state in_state); +/* Return non-zero if the chipset is in one of the states specified in the + * mask. */ +int chipset_in_state(int state_mask); + +/* Ask the chipset to exit the hard off state. Does nothing if the chipset has + * already left the state, or was not in the state to begin with. */ +void chipset_exit_hard_off(void); #endif /* __CROS_EC_CHIPSET_H */ |