diff options
author | Duncan Laurie <dlaurie@google.com> | 2017-07-23 00:28:09 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-08-26 14:58:51 +0000 |
commit | 1bc6436fce086c992805ca2fa366bf31a5d24b77 (patch) | |
tree | 741949dbb2538df722e646388882ef6682aa3683 | |
parent | 430960724dcfda8e13db95632aba68607e27db3f (diff) | |
download | chrome-ec-1bc6436fce086c992805ca2fa366bf31a5d24b77.tar.gz |
eve: Remove CONFIG_BATTERY_REVIVE_DISCONNECT
Since Eve has a custom battery presence function we do not
need the disconnect behavior as it will recover better by
letting the state machine handle it with precharge directly.
Without this change I would sometimes see the first boot after
a cut-off battery get stuck with "battery found in disconnect
state" and not able to boot up the AP.
BUG=b:63957122
BRANCH=eve
TEST=manual testing on Eve with cut-off batteries shows more
consistent behavior to boot the AP after plugging in adapter.
Change-Id: I2d115788c1f9f6171a01525970285abb9f3467a2
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: https://chromium-review.googlesource.com/582538
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2319998
Tested-by: Patryk Duda <pdk@semihalf.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: Patryk Duda <pdk@semihalf.com>
-rw-r--r-- | board/eve/battery.c | 49 | ||||
-rw-r--r-- | board/eve/board.h | 1 |
2 files changed, 0 insertions, 50 deletions
diff --git a/board/eve/battery.c b/board/eve/battery.c index df0c976f7e..30c769dfec 100644 --- a/board/eve/battery.c +++ b/board/eve/battery.c @@ -152,55 +152,6 @@ int board_cut_off_battery(void) return rv ? EC_RES_ERROR : EC_RES_SUCCESS; } -enum battery_disconnect_state battery_get_disconnect_state(void) -{ - uint8_t data[6]; - int rv; - - /* - * Take note if we find that the battery isn't in disconnect state, - * and always return NOT_DISCONNECTED without probing the battery. - * This assumes the battery will not go to disconnect state during - * runtime. - */ - static int not_disconnected; - - if (not_disconnected) - return BATTERY_NOT_DISCONNECTED; - - if (extpower_is_present()) { - /* Check if battery charging + discharging is disabled. */ - rv = sb_read_mfgacc(PARAM_OPERATION_STATUS, - SB_ALT_MANUFACTURER_ACCESS, data, sizeof(data)); - if (rv) - return BATTERY_DISCONNECT_ERROR; - - if (~data[3] & (BATTERY_DISCHARGING_DISABLED | - BATTERY_CHARGING_DISABLED)) { - not_disconnected = 1; - return BATTERY_NOT_DISCONNECTED; - } - - /* - * Battery is neither charging nor discharging. Verify that - * we didn't enter this state due to a safety fault. - */ - rv = sb_read_mfgacc(PARAM_SAFETY_STATUS, - SB_ALT_MANUFACTURER_ACCESS, data, sizeof(data)); - if (rv || data[2] || data[3] || data[4] || data[5]) - return BATTERY_DISCONNECT_ERROR; - - /* - * Battery is present and also the status is initialized and - * no safety fault, battery is disconnected. - */ - if (battery_is_present() == BP_YES) - return BATTERY_DISCONNECTED; - } - not_disconnected = 1; - return BATTERY_NOT_DISCONNECTED; -} - static int charger_should_discharge_on_ac(struct charge_state_data *curr) { /* Can not discharge on AC without battery */ diff --git a/board/eve/board.h b/board/eve/board.h index 2274fa0d5d..7365286b23 100644 --- a/board/eve/board.h +++ b/board/eve/board.h @@ -76,7 +76,6 @@ #define CONFIG_BATTERY_CUT_OFF #define CONFIG_BATTERY_DEVICE_CHEMISTRY "LION" #define CONFIG_BATTERY_PRESENT_CUSTOM -#define CONFIG_BATTERY_REVIVE_DISCONNECT #define CONFIG_BATTERY_SMART /* Charger */ |