diff options
author | Koro Chen <koro.chen@mediatek.com> | 2016-03-04 15:57:07 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-03-07 10:03:39 -0800 |
commit | 86d94fa3b579f5e6e5119153de932ccc9ba31cd1 (patch) | |
tree | 6b891a7b83ec6332bf68c3577abc8b4ddff85fcb | |
parent | 1e20c1f88d187aabe03f5f80db8a189dafb14ac5 (diff) | |
download | chrome-ec-86d94fa3b579f5e6e5119153de932ccc9ba31cd1.tar.gz |
oak: Fix rev5 battery LED
rev5 battery LED control was misplaced in wrong function.
Move it back to oak_led_set_battery().
BRANCH=none
BUG=chrome-os-partner:49375
TEST=ectool led battery [green red off] are correct
Change-Id: I83bc24c7ea7695be2a638e97b7db6e0c38840a16
Signed-off-by: Koro Chen <koro.chen@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/330509
Reviewed-by: Rong Chang <rongchang@chromium.org>
-rw-r--r-- | board/oak/led.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/board/oak/led.c b/board/oak/led.c index 44d7a657d8..bc0e9dde45 100644 --- a/board/oak/led.c +++ b/board/oak/led.c @@ -136,18 +136,6 @@ static void oak_led_set_power(int board_version) } break; default: - /* PWR LED behavior: - * Power on: Green - * Suspend: Green in breeze mode ( 1 sec on/ 3 sec off) - * Power off: OFF - */ - if (chipset_in_state(CHIPSET_STATE_ANY_OFF)) - bat_led_set(BAT_LED_GREEN, 0); - else if (chipset_in_state(CHIPSET_STATE_ON)) - bat_led_set(BAT_LED_GREEN, 1); - else if (chipset_in_state(CHIPSET_STATE_SUSPEND)) - bat_led_set(BAT_LED_GREEN, - (power_second & 3) ? 0 : 1); break; } } @@ -201,6 +189,23 @@ static void oak_led_set_battery(int board_version) } break; /* End of case OAK_REV3 & OAK_REV4 */ default: + /* + * Put power control here since we are using the "battery" LED. + * This allows LED autocontrol to be turned off by cmd during factory test. + * + * PWR LED behavior: + * Power on: Green + * Suspend: Green in breeze mode ( 1 sec on/ 3 sec off) + * Power off: OFF + */ + if (chipset_in_state(CHIPSET_STATE_ANY_OFF)) + bat_led_set(BAT_LED_GREEN, 0); + else if (chipset_in_state(CHIPSET_STATE_ON)) + bat_led_set(BAT_LED_GREEN, 1); + else if (chipset_in_state(CHIPSET_STATE_SUSPEND)) + bat_led_set(BAT_LED_GREEN, + (battery_second & 3) ? 0 : 1); + /* BAT LED behavior: * Fully charged / idle: Off * Under charging: Orange |