diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-05-09 15:34:50 -0700 |
---|---|---|
committer | Randall Spangler <rspangler@chromium.org> | 2012-05-09 16:54:17 -0700 |
commit | 30a33e6b0412c132c375cc569f9629da6eb168f3 (patch) | |
tree | 9aa61aafc6209ab62ea36553af238052f07dfae0 /include | |
parent | 1655c8727a82d8a344400f1708d315decb57c73c (diff) | |
download | chrome-ec-30a33e6b0412c132c375cc569f9629da6eb168f3.tar.gz |
Drop DPWROK when system is off for more than 10 secrelease-R20-2268.B
This saves ~70mw of power.
To make this work, I also had to stretch the power button signal to
give the system a chance to come back up when the user taps the power
button.
Signed-off-by: Randall Spangler <rspangler@chromium.org>
BUG=chrome-os-partner:9574
TEST=manual
For each of the following tests, wait ~15 sec after the system is
powered off to give it a chance to drop DPWROK.
1) tap power button -> system turns on
2) hold power button 1 sec -> system turns on
3) open lid -> system turns on
4) silego reset (power+refresh, or power+esc on proto1) -> system stays off
5) silego recovery (power+esc+refresh) -> system turns on
6) hold down power button and type 'reboot' on EC console -> system turns on
7) type 'powerbtn' on EC console -> system turns on
Change-Id: I781cf3e665104192521b7fb9ff75a3c3e7f43464
Diffstat (limited to 'include')
-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 */ |