summaryrefslogtreecommitdiff
path: root/common/battery.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/battery.c')
-rw-r--r--common/battery.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/common/battery.c b/common/battery.c
index 25df2e17a3..19ad2e49b8 100644
--- a/common/battery.c
+++ b/common/battery.c
@@ -10,6 +10,7 @@
#include "common.h"
#include "console.h"
#include "gpio.h"
+#include "host_command.h"
#include "timer.h"
#include "util.h"
#include "watchdog.h"
@@ -248,3 +249,22 @@ DECLARE_CONSOLE_COMMAND(battery, command_battery,
"<repeat_count> <sleep_ms>",
"Print battery info",
NULL);
+
+
+#ifdef CONFIG_BATTERY_CUT_OFF
+int battery_command_cut_off(struct host_cmd_handler_args *args)
+{
+ return board_cut_off_battery();
+}
+DECLARE_HOST_COMMAND(EC_CMD_BATTERY_CUT_OFF, battery_command_cut_off,
+ EC_VER_MASK(0));
+
+static int command_cutoff(int argc, char **argv)
+{
+ return board_cut_off_battery();
+}
+DECLARE_CONSOLE_COMMAND(cutoff, command_cutoff,
+ "",
+ "Cut off the battery output",
+ NULL);
+#endif /* CONFIG_BATTERY_CUT_OFF */