From e21f3401e136ba1ed25272356aa5d446d083a5ad Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Mon, 14 Mar 2016 16:36:45 -0700 Subject: chell: Indicate when charging in suspend Currently when in suspend the LED blinks white no matter what the state of the battery or charging is. This is very confusing for users who expect to be able to plug in a charger with the system in suspend and see that it starts to charge. Past platforms from this OEM have had two LEDs so this has not been an issue. BUG=chrome-os-partner:49151 BRANCH=glados TEST=put chell in suspend, plug in charger to see amber LED and then remove the charger and see that it blinks white again. Change-Id: I60e849d7b8b717fb568d7d5d64046621c1c34157 Signed-off-by: Duncan Laurie Reviewed-on: https://chromium-review.googlesource.com/332625 Reviewed-by: Shawn N --- board/chell/led.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'board/chell') diff --git a/board/chell/led.c b/board/chell/led.c index 0f92de1c75..c117e53a3e 100644 --- a/board/chell/led.c +++ b/board/chell/led.c @@ -93,8 +93,13 @@ static void board_led_set_battery(void) if (!previous_state_suspend) power_ticks = 0; - /* Blink once every one second. */ - bat_led_set_color((power_ticks & 0x4) ? LED_WHITE : LED_OFF); + if (charge_get_state() == PWR_STATE_CHARGE) + /* Always indicate when charging, even in suspend. */ + bat_led_set_color(LED_AMBER); + else + /* Blink once every one second. */ + bat_led_set_color((power_ticks & 0x4) ? + LED_WHITE : LED_OFF); previous_state_suspend = 1; return; -- cgit v1.2.1