summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2018-05-07 09:34:05 -0700
committerCommit Bot <commit-bot@chromium.org>2020-09-07 02:24:15 +0000
commit5f4f01f54794d4b85d7f6903ef68296d5bc93640 (patch)
treeb7b06bacf977a2dd87613d8d13b04b048457186c
parentd55be87185ba432114da3f10c46f85d1669241d5 (diff)
downloadchrome-ec-5f4f01f54794d4b85d7f6903ef68296d5bc93640.tar.gz
Revert "eve: Use PCH ACOK signal to control Deep Sleep entry"
This reverts commit a49f19a1aa9ad3f4951490f96f0320fa646b572e. Battery life in S3 (not Deep S3) is terrible, so reverting this change until we determine if improvements can be made. BUG=b:79346372 BRANCH=eve TEST=none Change-Id: I570c5ea1b2b74f17fb41cd46424bfe2a5749d49a Reviewed-on: https://chromium-review.googlesource.com/1047845 Reviewed-by: Duncan Laurie <dlaurie@google.com> Commit-Queue: Duncan Laurie <dlaurie@google.com> Tested-by: Duncan Laurie <dlaurie@google.com> Trybot-Ready: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2320266 Commit-Queue: Patryk Duda <pdk@semihalf.com> Tested-by: Patryk Duda <pdk@semihalf.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--board/eve/board.c26
-rw-r--r--board/eve/board.h1
-rw-r--r--board/eve/usb_pd_policy.c6
3 files changed, 11 insertions, 22 deletions
diff --git a/board/eve/board.c b/board/eve/board.c
index c8c5ff70ba..4665698375 100644
--- a/board/eve/board.c
+++ b/board/eve/board.c
@@ -480,19 +480,6 @@ int board_has_working_reset_flags(void)
return 1;
}
-/*
- * Update status of the ACPRESENT pin on the PCH. In order to prevent
- * Deep S3 when USB is inserted this will indicate that AC is present
- * if either port is supplying VBUS or there an external charger present.
- */
-void board_update_ac_status(void)
-{
- gpio_set_level(GPIO_PCH_ACOK, extpower_is_present() ||
- board_vbus_source_enabled(0) ||
- board_vbus_source_enabled(1));
-}
-DECLARE_HOOK(HOOK_AC_CHANGE, board_update_ac_status, HOOK_PRIO_DEFAULT);
-
/* Initialize board. */
static void board_init(void)
{
@@ -508,8 +495,8 @@ static void board_init(void)
/* Enable interrupts from BMI160 sensor. */
gpio_enable_interrupt(GPIO_ACCELGYRO3_INT_L);
- /* Update AC status to the PCH */
- board_update_ac_status();
+ /* Provide AC status to the PCH */
+ gpio_set_level(GPIO_PCH_ACOK, extpower_is_present());
#ifndef TEST_BUILD
if (board_get_version() == BOARD_VERSION_EVT) {
@@ -527,6 +514,15 @@ static void board_init(void)
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
+/**
+ * Buffer the AC present GPIO to the PCH.
+ */
+static void board_extpower(void)
+{
+ gpio_set_level(GPIO_PCH_ACOK, extpower_is_present());
+}
+DECLARE_HOOK(HOOK_AC_CHANGE, board_extpower, HOOK_PRIO_DEFAULT);
+
int pd_snk_is_vbus_provided(int port)
{
if (port != 0 && port != 1)
diff --git a/board/eve/board.h b/board/eve/board.h
index 4e86fbad21..03e09d5d46 100644
--- a/board/eve/board.h
+++ b/board/eve/board.h
@@ -301,7 +301,6 @@ void board_reset_pd_mcu(void);
void board_set_tcpc_power_mode(int port, int mode);
void board_tcpc_init(void);
void led_register_double_tap(void);
-void board_update_ac_status(void);
/* Sensors without hardware FIFO are in forced mode */
#define CONFIG_ACCEL_FORCE_MODE_MASK (BIT(LID_ACCEL) | BIT(LID_LIGHT))
diff --git a/board/eve/usb_pd_policy.c b/board/eve/usb_pd_policy.c
index b4d0aeb857..4d10047d85 100644
--- a/board/eve/usb_pd_policy.c
+++ b/board/eve/usb_pd_policy.c
@@ -96,9 +96,6 @@ int pd_set_power_supply_ready(int port)
/* notify host of power info change */
pd_send_host_event(PD_EVENT_POWER_CHANGE);
- /* Update AC status to the PCH */
- board_update_ac_status();
-
return EC_SUCCESS; /* we are ready */
}
@@ -121,9 +118,6 @@ void pd_power_supply_reset(int port)
/* notify host of power info change */
pd_send_host_event(PD_EVENT_POWER_CHANGE);
-
- /* Update AC status to the PCH */
- board_update_ac_status();
}
int pd_check_vconn_swap(int port)