diff options
author | Ko_Ko <Ko_Ko@compal.corp-partner.google.com> | 2021-01-20 14:30:04 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-22 03:16:56 +0000 |
commit | 326814921dd1f93991cb5b49eba9cc9240f4770a (patch) | |
tree | 7148c3579b1e899949b8a8218f48a335cd4df6d0 | |
parent | 0a5c0b1060f8cd2a77741b064fd8471930c90059 (diff) | |
download | chrome-ec-326814921dd1f93991cb5b49eba9cc9240f4770a.tar.gz |
Madoo: Fix main board charger can't wake from hibernate
In madoo's design, there is a protection IC between USB
connector and TCPC. When EC is hibernate, the CC lines will
be disconnected, which cause the result that TCPC can't
detect AC power and Chromebook won't wake the system.
Enalbing ADC for all modes by setting 0x4C bit 0 to 1 (to be
more precise is that we don't clear bit 0 during hibernation)
can prevent issue mention above.
BUG=b:174971576
BRANCH=dedede
TEST=flash code and make sure ac in can wake system from hibernation
Signed-off-by: Ko_Ko <Ko_Ko@compal.corp-partner.google.com>
Change-Id: I2a83c69e34cbc4bfdff90d760f32817a7924dc26
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2626803
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Reviewed-by: Ko Ko <ko_ko@compal.corp-partner.google.com>
Tested-by: Ko Ko <ko_ko@compal.corp-partner.google.com>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r-- | board/boten/board.c | 2 | ||||
-rw-r--r-- | board/galtic/board.c | 4 | ||||
-rw-r--r-- | board/madoo/board.c | 4 | ||||
-rw-r--r-- | board/magolor/board.c | 4 | ||||
-rw-r--r-- | board/metaknight/board.c | 4 | ||||
-rw-r--r-- | board/sasuke/board.c | 4 | ||||
-rw-r--r-- | board/waddledoo/board.c | 4 | ||||
-rw-r--r-- | driver/charger/isl923x.c | 7 | ||||
-rw-r--r-- | driver/charger/isl923x.h | 3 |
9 files changed, 19 insertions, 17 deletions
diff --git a/board/boten/board.c b/board/boten/board.c index 9a43b1574e..8ff385687e 100644 --- a/board/boten/board.c +++ b/board/boten/board.c @@ -105,7 +105,7 @@ void board_hibernate(void) * Charger IC need to be put into their "low power mode" before * entering the Z-state. */ - raa489000_hibernate(0); + raa489000_hibernate(0, true); } /* Must come after other header files and interrupt handler declarations */ diff --git a/board/galtic/board.c b/board/galtic/board.c index 52e9c15420..0a26811b73 100644 --- a/board/galtic/board.c +++ b/board/galtic/board.c @@ -323,9 +323,9 @@ void board_hibernate(void) * Put all charger ICs present into low power mode before entering * z-state. */ - raa489000_hibernate(CHARGER_PRIMARY); + raa489000_hibernate(CHARGER_PRIMARY, true); if (board_get_charger_chip_count() > 1) - raa489000_hibernate(CHARGER_SECONDARY); + raa489000_hibernate(CHARGER_SECONDARY, true); } __override void board_ocpc_init(struct ocpc_data *ocpc) diff --git a/board/madoo/board.c b/board/madoo/board.c index c5389dfb49..7c81d18ba8 100644 --- a/board/madoo/board.c +++ b/board/madoo/board.c @@ -210,8 +210,8 @@ void board_hibernate(void) * Both charger ICs need to be put into their "low power mode" before * entering the Z-state. */ - raa489000_hibernate(1); - raa489000_hibernate(0); + raa489000_hibernate(1, true); + raa489000_hibernate(0, false); } void board_reset_pd_mcu(void) diff --git a/board/magolor/board.c b/board/magolor/board.c index 82a0690db7..0fb7f72db3 100644 --- a/board/magolor/board.c +++ b/board/magolor/board.c @@ -248,8 +248,8 @@ void board_hibernate(void) * Both charger ICs need to be put into their "low power mode" before * entering the Z-state. */ - raa489000_hibernate(1); - raa489000_hibernate(0); + raa489000_hibernate(1, true); + raa489000_hibernate(0, true); } void board_reset_pd_mcu(void) diff --git a/board/metaknight/board.c b/board/metaknight/board.c index 998e93162d..e5a7365c97 100644 --- a/board/metaknight/board.c +++ b/board/metaknight/board.c @@ -275,8 +275,8 @@ void board_hibernate(void) * entering the Z-state. */ if (board_get_charger_chip_count() > 1) - raa489000_hibernate(1); - raa489000_hibernate(0); + raa489000_hibernate(1, true); + raa489000_hibernate(0, true); } void board_reset_pd_mcu(void) diff --git a/board/sasuke/board.c b/board/sasuke/board.c index 2720295d14..e7e4bfd820 100644 --- a/board/sasuke/board.c +++ b/board/sasuke/board.c @@ -237,8 +237,8 @@ void board_hibernate(void) * entering the Z-state. */ if (board_get_charger_chip_count() > 1) - raa489000_hibernate(1); - raa489000_hibernate(0); + raa489000_hibernate(1, true); + raa489000_hibernate(0, true); } /* USB-A charging control */ diff --git a/board/waddledoo/board.c b/board/waddledoo/board.c index d173a6019f..0bdcb2b684 100644 --- a/board/waddledoo/board.c +++ b/board/waddledoo/board.c @@ -230,8 +230,8 @@ void board_hibernate(void) * entering the Z-state. */ if (board_get_charger_chip_count() > 1) - raa489000_hibernate(1); - raa489000_hibernate(0); + raa489000_hibernate(1, true); + raa489000_hibernate(0, true); } void board_reset_pd_mcu(void) diff --git a/driver/charger/isl923x.c b/driver/charger/isl923x.c index dbe6354476..e6e3042cb7 100644 --- a/driver/charger/isl923x.c +++ b/driver/charger/isl923x.c @@ -767,7 +767,7 @@ out: } #ifdef CONFIG_CHARGER_RAA489000 -void raa489000_hibernate(int chgnum) +void raa489000_hibernate(int chgnum, bool disable_adc) { int rv, regval; @@ -813,8 +813,9 @@ void raa489000_hibernate(int chgnum) rv = raw_read16(chgnum, ISL9238_REG_CONTROL3, ®val); if (!rv) { - /* ADC is active only when adapter plugged in */ - regval &= ~RAA489000_ENABLE_ADC; + if (disable_adc) + /* ADC is active only when adapter plugged in */ + regval &= ~RAA489000_ENABLE_ADC; rv = raw_write16(chgnum, ISL9238_REG_CONTROL3, regval); } diff --git a/driver/charger/isl923x.h b/driver/charger/isl923x.h index 0ae8327ed4..5da8649c38 100644 --- a/driver/charger/isl923x.h +++ b/driver/charger/isl923x.h @@ -9,6 +9,7 @@ #ifndef __CROS_EC_ISL923X_H #define __CROS_EC_ISL923X_H +#include "stdbool.h" #define ISL923X_ADDR_FLAGS (0x09) /* Registers */ @@ -378,7 +379,7 @@ int isl923x_set_comparator_inversion(int chgnum, int invert); * * @param chgnum index into chg_chips table. */ -void raa489000_hibernate(int chgnum); +void raa489000_hibernate(int chgnum, bool disable_adc); enum ec_error_list isl9238c_hibernate(int chgnum); enum ec_error_list isl9238c_resume(int chgnum); |