From 37b65d5c8c9400049d17a9349ad0b55f42b8203b Mon Sep 17 00:00:00 2001 From: Alec Berg Date: Thu, 30 Jul 2015 14:19:46 -0700 Subject: pd: don't enable try.src when battery is not present or too low Don't enable try.src when battery is not present or <1% because try.src will temporarily cut off power to system. BUG=chrome-os-partner:43413 BRANCH=samus TEST=tested on samus using "battfake" ec command. when battery <1%, verified that try.src is disabled and when battery >=1% and the AP is on (dual-role toggling is on), then try.src is enabled. verified boot without battery succeeds on samus and glados. Change-Id: I64816bb7c9669bfeca61687bcd9a48da32e67945 Signed-off-by: Alec Berg Reviewed-on: https://chromium-review.googlesource.com/289854 Reviewed-by: Scott Collyer Reviewed-by: Vincent Palatin --- board/samus_pd/board.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'board/samus_pd') diff --git a/board/samus_pd/board.c b/board/samus_pd/board.c index dcf40cdd99..e1941cabbe 100644 --- a/board/samus_pd/board.c +++ b/board/samus_pd/board.c @@ -624,8 +624,11 @@ void board_set_charge_limit(int charge_ma) static void board_update_battery_soc(int soc) { - batt_soc = soc; - board_update_charge_limit(desired_charge_rate_ma); + if (batt_soc != soc) { + batt_soc = soc; + board_update_charge_limit(desired_charge_rate_ma); + hook_notify(HOOK_BATTERY_SOC_CHANGE); + } } /* Send host event up to AP */ -- cgit v1.2.1