diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-03-14 12:39:00 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-03-14 15:44:14 -0700 |
commit | 75acd4065ab720cdb72c165aa2d3b3e48852267a (patch) | |
tree | 75d5a6da1d374cab94f2786e91891c377ffdbd66 /include/power_led.h | |
parent | 10d845eb10e4a7030815c687b13bbd09e905edb8 (diff) | |
download | chrome-ec-75acd4065ab720cdb72c165aa2d3b3e48852267a.tar.gz |
Clean up power LED state machine on link
The power LED now has its own tick-based handler which knows how to
blink the LED and resend the desired LED state to work around the
flaky 1-wire connection.
Removes a bunch of LED state code from charge_state.c.
No user-visible impact. Does not need to go into link branch.
BUG=chromium-os:18256
BRANCH=none
TEST=manual
1) Discharge battery to <97%
2) Plug in AC. LED=yellow
3) 'ectool chargeforceidle 1' from root shell. LED=blinking green/off.
4) 'ectool chargeforceidle 0' from root shell. LED=yellow.
5) Wait for battery >= 97% (or 'battfake 98' from EC console). LED=green.
6) Unplug battery. LED=red (may take 10 sec).
7) Replug battery. LED=green.
Change-Id: I999ee3e1abe269bb3f737bbc75e0b872316605ce
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45469
Reviewed-by: Vic Yang <victoryang@chromium.org>
Diffstat (limited to 'include/power_led.h')
-rw-r--r-- | include/power_led.h | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/include/power_led.h b/include/power_led.h index 2fd7322095..20b3f7793f 100644 --- a/include/power_led.h +++ b/include/power_led.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -10,33 +10,6 @@ #include "common.h" -/* Interface for LM4-based boards */ - -enum powerled_color { - POWERLED_OFF = 0, - POWERLED_RED, - POWERLED_YELLOW, - POWERLED_GREEN, - POWERLED_COLOR_COUNT /* Number of colors, not a color itself */ -}; - -#ifdef CONFIG_POWER_LED - -/** - * Set the power adapter LED - * - * @param color Color to set LED - * - * @return EC_SUCCESS, or non-zero if error. - */ -int powerled_set(enum powerled_color color); - -#else - -static inline int powerled_set(enum powerled_color color) { return 0; } - -#endif - /* Interface for STM32-based boards */ enum powerled_state { |