summaryrefslogtreecommitdiff
path: root/include/ec_commands.h
diff options
context:
space:
mode:
authorDave Parker <dparker@chromium.org>2013-07-01 14:52:27 -0700
committerChromeBot <chrome-bot@google.com>2013-07-19 10:58:18 -0700
commit7f1c49ab4be3c662a488d2c4e9acceef2c904465 (patch)
tree7a577cde20121529c213b3905f9dfb9fd28eade6 /include/ec_commands.h
parent5691ac816805781a27b5da84cab9c600b77b9dcb (diff)
downloadchrome-ec-7f1c49ab4be3c662a488d2c4e9acceef2c904465.tar.gz
Add ectool discharge command to Falco and Peppy.
Expands and renames ectool 'chargeforceidle' command to 'chargecontrol'. Board-specific calls are needed to enable and disable the discharge while on AC power state. BUG=chrome-os-partner:20506 BRANCH=falco,peppy TEST=Run ectool chargecontrol command with each option (normal, idle, discharge) on Falco and Peppy. Verifiy battery is discharging in discharge mode via EC console 'battery' command. Change-Id: I7ac2b18b4f143bf6abc1e0bb878ad21a99f52100 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/60689 Reviewed-by: Vic Yang <victoryang@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include/ec_commands.h')
-rw-r--r--include/ec_commands.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index f725b0b784..b9df4898b5 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -1396,11 +1396,20 @@ struct ec_params_i2c_write {
/*****************************************************************************/
/* Charge state commands. Only available when flash write protect unlocked. */
-/* Force charge state machine to stop in idle mode */
-#define EC_CMD_CHARGE_FORCE_IDLE 0x96
+/* Force charge state machine to stop charging the battery or force it to
+ * discharge the battery.
+ */
+#define EC_CMD_CHARGE_CONTROL 0x96
+#define EC_VER_CHARGE_CONTROL 1
-struct ec_params_force_idle {
- uint8_t enabled;
+enum ec_charge_control_mode {
+ CHARGE_CONTROL_NORMAL = 0,
+ CHARGE_CONTROL_IDLE,
+ CHARGE_CONTROL_DISCHARGE,
+};
+
+struct ec_params_charge_control {
+ uint32_t mode; /* enum charge_control_mode */
} __packed;
/*****************************************************************************/