mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-07 16:11:43 +00:00
Falco: Implement battery cut off comamnd for factory
BUG=chrome-os-partner:20723 BRANCH=falco TEST=Manual. On a DUT with a battery run "ectool batterycutoff" and power down if still connected to AC. Unplug AC. The EC should be unpowered. Verify the only way to boot the system is to plug AC back in. Change-Id: I7a4cef1f69efe673370a450385f6fa91722d2b50 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/61294 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
*/
|
||||
|
||||
#include "battery_pack.h"
|
||||
#include "host_command.h"
|
||||
#include "smart_battery.h"
|
||||
|
||||
#define SB_SHIP_MODE_DATA 0x0010
|
||||
|
||||
/* FIXME: We need REAL values for all this stuff */
|
||||
static const struct battery_info info = {
|
||||
@@ -46,3 +50,17 @@ void battery_vendor_params(struct batt_params *batt)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int battery_command_cut_off(struct host_cmd_handler_args *args)
|
||||
{
|
||||
int rv;
|
||||
|
||||
/* Ship mode command must be sent twice. */
|
||||
rv = sb_write(SB_MANUFACTURER_ACCESS, SB_SHIP_MODE_DATA);
|
||||
if (rv != EC_SUCCESS)
|
||||
return rv;
|
||||
rv = sb_write(SB_MANUFACTURER_ACCESS, SB_SHIP_MODE_DATA);
|
||||
return rv;
|
||||
}
|
||||
DECLARE_HOST_COMMAND(EC_CMD_BATTERY_CUT_OFF, battery_command_cut_off,
|
||||
EC_VER_MASK(0));
|
||||
|
||||
Reference in New Issue
Block a user