mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-04 22:11:41 +00:00
Implement battery cut-off host command for Peppy.
BUG=chrome-os-partner:20720 BRANCH=peppy TEST=Run 'ectool batterycutoff' on the DUT, shut it down, and unplug AC power. Verify the only way to turn it on is by plugging the AC power back in. Change-Id: Ia6a93249843b72f4396d083cfe15a263d0a1836d Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/61047 Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
This commit is contained in:
@@ -6,6 +6,11 @@
|
||||
*/
|
||||
|
||||
#include "battery_pack.h"
|
||||
#include "host_command.h"
|
||||
#include "smart_battery.h"
|
||||
|
||||
#define SB_SHIP_MODE_ADDR 0x3a
|
||||
#define SB_SHIP_MODE_DATA 0xc574
|
||||
|
||||
/* Values for 54Wh 3UPF656790-1-T1001 battery */
|
||||
static const struct battery_info info = {
|
||||
@@ -50,3 +55,10 @@ void battery_vendor_params(struct batt_params *batt)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int battery_command_cut_off(struct host_cmd_handler_args *args)
|
||||
{
|
||||
return sb_write(SB_SHIP_MODE_ADDR, SB_SHIP_MODE_DATA);
|
||||
}
|
||||
DECLARE_HOST_COMMAND(EC_CMD_BATTERY_CUT_OFF, battery_command_cut_off,
|
||||
EC_VER_MASK(0));
|
||||
|
||||
Reference in New Issue
Block a user