From 3501ccffdb28306ec77003c96df3b898fd7a9545 Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Mon, 27 May 2013 17:09:05 +0800 Subject: [PATCH] spring: Prevent showing green LED when we are actually charging When we use about the same amount of power as what the charger provides, we sometimes show green LED. We should avoid this when the battery is not full. BUG=chrome-os-partner:19746 TEST=Manual BRANCH=spring Change-Id: Id31762aefe22535de64f63a023c35995a3725ef8 Signed-off-by: Vic Yang Reviewed-on: https://gerrit.chromium.org/gerrit/56724 Reviewed-by: Vincent Palatin --- common/lp5562_battery_led.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/lp5562_battery_led.c b/common/lp5562_battery_led.c index 165bbc9eca..24da647b5e 100644 --- a/common/lp5562_battery_led.c +++ b/common/lp5562_battery_led.c @@ -260,7 +260,8 @@ static void battery_led_update(void) break; } - if (current && desired_current) + /* If battery doesn't want any current, it's considered full. */ + if (desired_current) state = LED_STATE_SOLID_YELLOW; else state = LED_STATE_SOLID_GREEN;