summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorDavid Huang <david.huang@quanta.corp-partner.google.com>2023-04-13 11:41:15 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-05-02 08:15:01 +0000
commite881c1a04a3b9ed5774e247a59a9e3fc9fb02770 (patch)
tree09129bb372575b0267c756ef65ce51037ae101f3 /board
parent6db4ddbb1ca8ca3341d2e985aed7368f011af070 (diff)
downloadchrome-ec-e881c1a04a3b9ed5774e247a59a9e3fc9fb02770.tar.gz
hades: Support LGC battery
Add LGC battery: AP21A8T BUG=b:277981335 BRANCH=None TEST=make BOARD=hades Change-Id: I04b32558f11a2d78343006a3eb9cf909a454a568 Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4421693 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/hades/battery.c53
-rw-r--r--board/hades/board.h4
2 files changed, 15 insertions, 42 deletions
diff --git a/board/hades/battery.c b/board/hades/battery.c
index 0c94e2835d..8f1c2bb698 100644
--- a/board/hades/battery.c
+++ b/board/hades/battery.c
@@ -33,20 +33,22 @@
* address, mask, and disconnect value need to be provided.
*/
const struct board_batt_params board_battery_info[] = {
- /* DYNAPACK COSMAX Battery Information */
- [BATTERY_DYNAPACK_COSMX] = {
+ /* LGC AP21A8T Battery Information */
+ [BATTERY_LGC_AP21A8T] = {
/* RAJ240045 Fuel Gauge */
.fuel_gauge = {
- .manuf_name = "333-2C-4C-A",
+ .manuf_name = "LGC KT0040G014",
.ship_mode = {
- .reg_addr = 0x00,
- .reg_data = { 0x0010, 0x0010 },
+ .reg_addr = 0x3A,
+ .reg_data = { 0xC574, 0xC574 },
},
.fet = {
.mfgacc_support = 0,
.reg_addr = 0x43,
- .reg_mask = 0x0003,
+ .reg_mask = 0x0001,
.disconnect_val = 0x0,
+ .cfet_mask = 0x0002,
+ .cfet_off_val = 0x0000,
}
},
.batt_info = {
@@ -55,46 +57,17 @@ const struct board_batt_params board_battery_info[] = {
.voltage_min = 12000, /* mV */
.precharge_current = 256, /* mA */
.start_charging_min_c = 0,
- .start_charging_max_c = 45,
+ .start_charging_max_c = 50,
.charging_min_c = 0,
- .charging_max_c = 50,
- .discharging_min_c = -10,
- .discharging_max_c = 60,
- },
- },
- /* DYNAPACK HIGHPOWER Battery Information */
- [BATTERY_DYNAPACK_HIGHPOWER] = {
- /* RAJ240045 Fuel Gauge */
- .fuel_gauge = {
- .manuf_name = "333-2D-4C-A",
- .ship_mode = {
- .reg_addr = 0x00,
- .reg_data = { 0x0010, 0x0010 },
- },
- .fet = {
- .mfgacc_support = 0,
- .reg_addr = 0x43,
- .reg_mask = 0x0003,
- .disconnect_val = 0x0,
- }
- },
- .batt_info = {
- .voltage_max = 17600,
- .voltage_normal = 15400, /* mV */
- .voltage_min = 12000, /* mV */
- .precharge_current = 256, /* mA */
- .start_charging_min_c = 0,
- .start_charging_max_c = 45,
- .charging_min_c = 0,
- .charging_max_c = 50,
- .discharging_min_c = -10,
- .discharging_max_c = 60,
+ .charging_max_c = 60,
+ .discharging_min_c = -20,
+ .discharging_max_c = 75,
},
},
};
BUILD_ASSERT(ARRAY_SIZE(board_battery_info) == BATTERY_TYPE_COUNT);
-const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_DYNAPACK_COSMX;
+const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_LGC_AP21A8T;
enum battery_present battery_hw_present(void)
{
diff --git a/board/hades/board.h b/board/hades/board.h
index 14cd16bf2e..3c88c04d1d 100644
--- a/board/hades/board.h
+++ b/board/hades/board.h
@@ -177,8 +177,8 @@ enum temp_sensor_id {
};
enum battery_type {
- BATTERY_DYNAPACK_COSMX,
- BATTERY_DYNAPACK_HIGHPOWER,
+ BATTERY_LGC_AP21A8T,
+
BATTERY_TYPE_COUNT
};