summaryrefslogtreecommitdiff
path: root/board/samus
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-10-14 13:28:39 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-15 18:22:10 +0000
commitc1e908fcac8a91872ff5ec40120bbe65fa41851c (patch)
tree06a24fdeead0236f024599ee0103e1b8c5e64b83 /board/samus
parentfca5deab2f7070b757ec0386ad9fe3661cbb0079 (diff)
downloadchrome-ec-c1e908fcac8a91872ff5ec40120bbe65fa41851c.tar.gz
samus: display battery status on lightbar on AC change
Display battery percentage on the lightbar whenever AC status changes. BUG=chrome-os-partner:32894 BRANCH=samus TEST=Plug and unplug AC in S0 and in G3 and make sure that lightbar displays battery percentage each time Change-Id: I281c9242d185da06b0c778de12e4f6340779a840 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/223362 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'board/samus')
-rw-r--r--board/samus/board.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/board/samus/board.c b/board/samus/board.c
index ff443b96f8..5580f5d658 100644
--- a/board/samus/board.c
+++ b/board/samus/board.c
@@ -26,6 +26,7 @@
#include "jtag.h"
#include "keyboard_scan.h"
#include "lid_switch.h"
+#include "lightbar.h"
#include "motion_sense.h"
#include "peci.h"
#include "power.h"
@@ -236,6 +237,15 @@ enum battery_present battery_is_present(void)
#endif
/**
+ * Show battery status on lightbar when AC status changes
+ */
+void show_battery_status(void)
+{
+ lightbar_sequence(LIGHTBAR_TAP);
+}
+DECLARE_HOOK(HOOK_AC_CHANGE, show_battery_status, HOOK_PRIO_DEFAULT);
+
+/**
* Discharge battery when on AC power for factory test.
*/
int board_discharge_on_ac(int enable)