summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorAkshu Agrawal <akshu.agrawal@amd.com>2017-09-26 11:46:16 +0530
committerchrome-bot <chrome-bot@chromium.org>2017-09-26 13:36:16 -0700
commitff148ae240ab2ec4971279be55282a288e5c8c6f (patch)
treef5d6fb9f11f964ee3b4dbd8cbd0983dffb84942a /power
parent0ddaa7d9ebc722c56625d0ff800e83cf5d11d67b (diff)
downloadchrome-ec-ff148ae240ab2ec4971279be55282a288e5c8c6f.tar.gz
Kahlee: Provide functionality for apshutdown
Trigger the power press for shutdown. Also, avoid powering up the AP by checking if we are not in G3, before triggering the power press. BUG=b:66698593 TEST= > apshutdown [7045.198370 chipset_force_shutdown()] [7045.198870 PB PCH force press] [7045.199368 PB PCH pwrbtn=LOW] > LPC RESET# asserted[7049.218062 power state 3 = S0, in 0x000c] [7049.218718 Pass through VGATE: 0] [7049.219281 power state 7 = S0->S3, in 0x000c] [7049.220647 chipset -> S3] [7049.221108 power state 2 = S3, in 0x000c] [7049.221763 power state 8 = S3->S5, in 0x000c] [7049.222522 USB charge p0 m0] [7049.223217 chipset -> S5] [7049.223716 power state 1 = S5, in 0x000c] [7049.224334 PB PCH force release] [7049.224840 PB PCH pwrbtn=HIGH] [7049.232875 SW 0x01] [7049.240557 TCPC p1 Low Power Mode] [7049.252249 TCPC p1 Low Power Mode] [7049.254363 TCPC p0 Low Power Mode] [7049.266006 TCPC p0 Low Power Mode] [7059.225553 power state 9 = S5->G3, in 0x000c] [7059.226188 chipset_force_shutdown()] [7059.226717 PB PCH force press] [7059.233871 PB PCH pwrbtn=LOW] [7059.234381 power state 0 = G3, in 0x000c] [7059.250255 power state 0 = G3, in 0x000f] [7059.256533 SW 0x05] Change-Id: Ibc27c90f806deed6a2ca7035869c4e10ca7fbf0b Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com> Reviewed-on: https://chromium-review.googlesource.com/683956 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/stoney.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/power/stoney.c b/power/stoney.c
index a22a2a96a1..b2726f180d 100644
--- a/power/stoney.c
+++ b/power/stoney.c
@@ -28,12 +28,16 @@
#define CPRINTS(format, args...) cprints(CC_CHIPSET, format, ## args)
static int forcing_coldreset; /* Forced coldreset in progress? */
+static int forcing_shutdown; /* Forced shutdown in progress? */
void chipset_force_shutdown(void)
{
CPRINTS("%s()", __func__);
- /* TODO: shutdown */
+ if (!chipset_in_state(CHIPSET_STATE_HARD_OFF)) {
+ forcing_shutdown = 1;
+ power_button_pch_press();
+ }
}
void chipset_reset(int cold_reset)
@@ -111,6 +115,11 @@ static void handle_pass_through(enum power_state state,
enum power_state _power_handle_state(enum power_state state)
{
+ if (state == POWER_S5 && forcing_shutdown) {
+ power_button_pch_release();
+ forcing_shutdown = 0;
+ }
+
switch (state) {
case POWER_G3:
break;