From 35fbc972e9dae2fb85cce6837868352ad39aa981 Mon Sep 17 00:00:00 2001 From: Shawn Nematbakhsh Date: Thu, 11 Jun 2015 15:38:24 -0700 Subject: charge_manager: Don't cutoff charger when no battery is attached We normally do not charge from non-dedicated chargers. The process of determining whether a charger is dedicated or not involves PD protocol communication, so it can take some time to reach a determination. If no battery is attached, the charger is likely our only source of power, so don't cut it off. BUG=chrome-os-partner:41258 TEST=Attach donette to glados system with no battery, verify that glados boots to EC console and doesn't reset or panic. BRANCH=None Change-Id: I7c9cfcbd37b37ef16010cf1f246d8fddba6f6283 Signed-off-by: Shawn Nematbakhsh Reviewed-on: https://chromium-review.googlesource.com/277074 Reviewed-by: Alec Berg --- test/charge_manager.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/charge_manager.c b/test/charge_manager.c index 87ae1c7ede..8bfa8e2646 100644 --- a/test/charge_manager.c +++ b/test/charge_manager.c @@ -5,6 +5,7 @@ * Test charge manager module. */ +#include "battery.h" #include "charge_manager.h" #include "common.h" #include "ec_commands.h" @@ -66,6 +67,11 @@ void pd_set_new_power_request(int port) new_power_request[port] = 1; } +enum battery_present battery_is_present(void) +{ + return BP_YES; +} + static void clear_new_power_requests(void) { int i; -- cgit v1.2.1