summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-02-10 11:35:15 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-02-10 23:07:20 +0000
commit98345fdfc1c89d77f429c6a2ed9bdef1bfc1e1ab (patch)
tree1bb195d555104c70aef9456a2e3266aeff7028b3
parent5444205f7925acb2022412c129889091410e099b (diff)
downloadchrome-ec-98345fdfc1c89d77f429c6a2ed9bdef1bfc1e1ab.tar.gz
samus: fix won't charge after zinger plugged in during EC reboot
Fix bug recently introduced in 1ab9aac that causes some units to not charge after an EC reboot with zinger plugged in. The problem is that we don't log the previous state of ACOK on initialization of the extpower task. So, the PD MCU gets stuck in charge state NONE when you unplug zinger because the EC thinks that ACOK transitioned from low to low. Fixed in two ways: first, the EC stores the initial state of ACOK when extpower task first runs. second, changed extpower_board_hacks() to run the same code when ACOK goes from low to low as it does when it goes high to low. BUG=chrome-os-partner:36596 BRANCH=samus TEST=Found a unit that reliably shows the problem. loaded this fix in RO and ToT in RW. sysjump RW with AC plugged in, then when you unplug AC, the PD goes to chgstate NONE and won't ever charge on subsequent attaches. sysjump RO with AC plugged in, then when you unplug AC, the PD acts as normal and goes to chgstate NONE and then 5V, and will allow charging every time AC is subsequently attached. Change-Id: I4124535b17d43a5711586ff2894df67a3bd49ec6 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/248170 Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--board/samus/extpower.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/board/samus/extpower.c b/board/samus/extpower.c
index 5e9e168853..a52206e2c6 100644
--- a/board/samus/extpower.c
+++ b/board/samus/extpower.c
@@ -195,7 +195,7 @@ static void extpower_board_hacks(int extpower, int extpower_prev)
* backboost
*/
host_command_pd_send_status(PD_CHARGE_NONE);
- } else if (!extpower && extpower_prev) {
+ } else {
/* AC disconnected */
if (!charge_is_disabled &&
charge_circuit_state == CHARGE_CIRCUIT_OK)
@@ -259,6 +259,7 @@ void extpower_task(void)
int extpower_prev = 0;
extpower_board_hacks(extpower, extpower_prev);
+ extpower_prev = extpower;
/* Enable backboost detection interrupt */
gpio_enable_interrupt(GPIO_BKBOOST_DET);