mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 02:35:28 +00:00
Cyan: add battery cutoff command
The battery of cyan only support specific shipmode command. BUG=chrome-os-partner:40464 BRANCH=cyan TEST=verify that "ectool batterycutoff" and "ectool batterycutoff at-shutdown" are workable. Change-Id: I48538d57eda77ae798b3b843252df297c2d8fa81 Signed-off-by: Henry Hsu <Henry.Hsu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/272414 Reviewed-by: Mohammed Habibulla <moch@google.com>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
6791ac7174
commit
349aaa43da
@@ -8,8 +8,8 @@
|
||||
#include "battery.h"
|
||||
#include "battery_smart.h"
|
||||
|
||||
/* Shutdown mode parameter to write to manufacturer access register */
|
||||
#define SB_SHUTDOWN_DATA 0x0010
|
||||
#define SB_SHIP_MODE_ADDR 0x3a
|
||||
#define SB_SHIP_MODE_DATA 0xc574
|
||||
|
||||
static const struct battery_info info = {
|
||||
.voltage_max = 12600,/* mV */
|
||||
@@ -31,13 +31,5 @@ const struct battery_info *battery_get_info(void)
|
||||
|
||||
int board_cut_off_battery(void)
|
||||
{
|
||||
int rv;
|
||||
|
||||
/* Ship mode command must be sent twice to take effect */
|
||||
rv = sb_write(SB_MANUFACTURER_ACCESS, SB_SHUTDOWN_DATA);
|
||||
|
||||
if (rv != EC_SUCCESS)
|
||||
return rv;
|
||||
|
||||
return sb_write(SB_MANUFACTURER_ACCESS, SB_SHUTDOWN_DATA);
|
||||
return sb_write(SB_SHIP_MODE_ADDR, SB_SHIP_MODE_DATA);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user