summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-07-19 00:49:28 +0800
committerChromeBot <chrome-bot@google.com>2013-08-01 18:15:44 -0700
commit075006c603eac8ce2b2998893811f85bac31587e (patch)
treed77d18e694816522165de65dba7404e657817b8e
parent8f3d02ef7f325fddb83d84cdbfd50a83bb31082e (diff)
downloadchrome-ec-075006c603eac8ce2b2998893811f85bac31587e.tar.gz
spring: Ignore battery assist mode when deciding LED color
Now we decide LED color only based on battery charge level. Remove the logic of checking battery assist mode. BUG=chrome-os-partner:20017 TEST=Build success BRANCH=Spring Change-Id: I9fc38f57c931d4a678154e097776d284eb39f6c1 Original-Change-Id: Ide770e96ead05ae96db54290627853132f7edcb3 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/62487 Reviewed-by: Todd Broch <tbroch@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64272 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--common/led_lp5562.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/common/led_lp5562.c b/common/led_lp5562.c
index de5abbd666..bf0c86321b 100644
--- a/common/led_lp5562.c
+++ b/common/led_lp5562.c
@@ -115,8 +115,6 @@ DECLARE_HOST_COMMAND(EC_CMD_LED_CONTROL,
static void battery_led_update(void)
{
- int current;
- int desired_current;
int rv;
int state_of_charge;
enum led_state_t state = LED_STATE_OFF;
@@ -155,30 +153,19 @@ static void battery_led_update(void)
case ST_IDLE:
state = LED_STATE_SOLID_GREEN;
break;
- case ST_DISCHARGING:
- /* Discharging with AC, must be battery assist */
- state = LED_STATE_SOLID_YELLOW;
- break;
case ST_IDLE0:
case ST_BAD_COND:
case ST_PRE_CHARGING:
state = LED_STATE_SOLID_YELLOW;
break;
+ case ST_DISCHARGING:
case ST_CHARGING:
- if (battery_current(&current) ||
- battery_desired_current(&desired_current) ||
- battery_state_of_charge(&state_of_charge)) {
+ if (battery_state_of_charge(&state_of_charge)) {
/* Cannot talk to the battery. Set LED to red. */
state = LED_STATE_SOLID_RED;
break;
}
- if (current < 0 && desired_current > 0) { /* Battery assist */
- state = LED_STATE_SOLID_YELLOW;
- break;
- }
-
- /* If battery doesn't want any current, it's considered full. */
if (state_of_charge < GREEN_LED_THRESHOLD)
state = LED_STATE_SOLID_YELLOW;
else