summaryrefslogtreecommitdiff
path: root/board/lazor
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-07-16 16:40:13 -0700
committerCommit Bot <commit-bot@chromium.org>2020-07-22 00:54:46 +0000
commit989b932ce14b6a15fb4191d33951419b0d01f17e (patch)
tree8bed8b5aab03624d5232245e5c579f60d2f14f2d /board/lazor
parent27ee378bb78a299a0983379be83eb6d55860b4ae (diff)
downloadchrome-ec-989b932ce14b6a15fb4191d33951419b0d01f17e.tar.gz
lazor: Add a new battery and enable battery revive disconnect
Add a new battery and define its ship_mode an fet registers. Enable the battery revive disconnect, that the PD Try.SRC feature will not be enabled if the battery discharge FET is not active. It helps the first time boot from battery cutoff. The battery needs more time to sample the board present. During that time the discharge FET is inactive. Enabling Try.SRC will cause the power lost and then reboot loop. We should not enable Try.SRC in this case. BRANCH=None BUG=b:159319530 TEST=Cut off the battery; the first time boot is successful. Change-Id: Icbf2a5b958da823af0b79facb9c1e806f37c712a Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2303432 Reviewed-by: Udaya Kiran Ammu <udaykiran@google.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'board/lazor')
-rw-r--r--board/lazor/battery.c31
-rw-r--r--board/lazor/board.h2
2 files changed, 33 insertions, 0 deletions
diff --git a/board/lazor/battery.c b/board/lazor/battery.c
index d0c1bcbf31..a39ccff7c0 100644
--- a/board/lazor/battery.c
+++ b/board/lazor/battery.c
@@ -43,6 +43,7 @@ const struct board_batt_params board_battery_info[] = {
.reg_data = { 0xC574, 0xC574 },
},
.fet = {
+ .mfgacc_support = 0,
.reg_addr = 0x0,
.reg_mask = 0x4000,
.disconnect_val = 0x0,
@@ -71,6 +72,7 @@ const struct board_batt_params board_battery_info[] = {
.reg_data = { 0xC574, 0xC574 },
},
.fet = {
+ .mfgacc_support = 0,
.reg_addr = 0x0,
.reg_mask = 0x4000,
.disconnect_val = 0x0,
@@ -89,6 +91,35 @@ const struct board_batt_params board_battery_info[] = {
.discharging_max_c = 75,
},
},
+ /* AP16L8J */
+ [BATTERY_AP16L8J] = {
+ .fuel_gauge = {
+ .manuf_name = "LGC KT0020G010",
+ .device_name = "AP16L8J",
+ .ship_mode = {
+ .reg_addr = 0x3A,
+ .reg_data = { 0xC574, 0xC574 },
+ },
+ .fet = {
+ .mfgacc_support = 1,
+ .reg_addr = 0x23,
+ .reg_mask = 0x1,
+ .disconnect_val = 0x0,
+ }
+ },
+ .batt_info = {
+ .voltage_max = 8700,
+ .voltage_normal = 7500, /* mV */
+ .voltage_min = 6000, /* mV */
+ .precharge_current = 256, /* mA */
+ .start_charging_min_c = 0,
+ .start_charging_max_c = 50,
+ .charging_min_c = 0,
+ .charging_max_c = 60,
+ .discharging_min_c = -20,
+ .discharging_max_c = 75,
+ },
+ },
};
BUILD_ASSERT(ARRAY_SIZE(board_battery_info) == BATTERY_TYPE_COUNT);
diff --git a/board/lazor/board.h b/board/lazor/board.h
index a7b6747493..555a547fd1 100644
--- a/board/lazor/board.h
+++ b/board/lazor/board.h
@@ -24,6 +24,7 @@
/* Battery */
#define CONFIG_BATTERY_DEVICE_CHEMISTRY "LION"
+#define CONFIG_BATTERY_REVIVE_DISCONNECT
#define CONFIG_BATTERY_FUEL_GAUGE
/* BC 1.2 Charger */
@@ -94,6 +95,7 @@ enum pwm_channel {
enum battery_type {
BATTERY_AP16L5J,
BATTERY_AP16L5J_009,
+ BATTERY_AP16L8J,
BATTERY_TYPE_COUNT,
};