diff options
author | Ridden_Liu <ridden_liu@compal.corp-partner.google.com> | 2021-12-16 15:27:14 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-12-21 16:19:20 +0000 |
commit | a10d6f2d3c3824a5c95c8b79f2a038d976850dc8 (patch) | |
tree | 4551de4a703a536f672a7e34c79acfa737db4f43 /board/corori2 | |
parent | bc7eed5755f7f24fff51f5818bc5582934d217a7 (diff) | |
download | chrome-ec-a10d6f2d3c3824a5c95c8b79f2a038d976850dc8.tar.gz |
Corori2: add source of battery
Corori2 supports new battery.
BUG=b:208724532/b:196506846
BRANCH=dedede
TEST=make -j BOARD=corori2/charge&discharge/cutoff/wake
Signed-off-by: Ridden_Liu <ridden_liu@compal.corp-partner.google.com>
Change-Id: I9a1a49461880bebc0624e463d80e0474cc1bc174
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3344097
Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/corori2')
-rw-r--r-- | board/corori2/battery.c | 72 | ||||
-rw-r--r-- | board/corori2/board.h | 3 |
2 files changed, 55 insertions, 20 deletions
diff --git a/board/corori2/battery.c b/board/corori2/battery.c index 12ec2c42aa..1263e4cef0 100644 --- a/board/corori2/battery.c +++ b/board/corori2/battery.c @@ -5,9 +5,11 @@ * Battery pack vendor provided charging profile */ +#include "battery.h" #include "battery_fuel_gauge.h" #include "charge_state.h" #include "common.h" +#include "util.h" /* * Battery info for all waddledoo battery types. Note that the fields @@ -32,35 +34,67 @@ * address, mask, and disconnect value need to be provided. */ const struct board_batt_params board_battery_info[] = { - /* POW-TECH Battery Information */ - [BATTERY_POWER_TECH] = { + /* C21N2018 Battery Information*/ + [BATTERY_C21N2018] = { .fuel_gauge = { - .manuf_name = "POW-TECH", + .manuf_name = "AS3GXXD3KA", + .device_name = "C110160", .ship_mode = { + .reg_addr = 0x00, + .reg_data = { 0x0010, 0x0010 }, + }, + .fet = { .reg_addr = 0x0, - .reg_data = { 0x10, 0x10 }, + .reg_mask = 0x2000, + .disconnect_val = 0x2000, + .cfet_mask = 0x4000, + .cfet_off_val = 0x4000, + }, + }, + .batt_info = { + .voltage_max = 8800, + .voltage_normal = 7890, + .voltage_min = 6000, + .precharge_current = 256, + .start_charging_min_c = 0, + .start_charging_max_c = 45, + .charging_min_c = 0, + .charging_max_c = 60, + .discharging_min_c = -20, + .discharging_max_c = 60, + }, + }, + /* C21N2018 second Battery Information*/ + [BATTERY_C21N2018_2ND] = { + .fuel_gauge = { + .manuf_name = "AS3FXXD3KA", + .device_name = "C110160", + .ship_mode = { + .reg_addr = 0x00, + .reg_data = { 0x0010, 0x0010 }, }, .fet = { - .reg_addr = 0x00, - .reg_mask = 0x2000, + .reg_addr = 0x0, + .reg_mask = 0x2000, .disconnect_val = 0x2000, - } + .cfet_mask = 0x4000, + .cfet_off_val = 0x4000, + }, }, .batt_info = { - .voltage_max = 8800, /* mV */ - .voltage_normal = 7700, - .voltage_min = 6000, - .precharge_current = 160, /* mA */ - .start_charging_min_c = 0, - .start_charging_max_c = 45, - .charging_min_c = 0, - .charging_max_c = 45, - .discharging_min_c = -20, - .discharging_max_c = 60, + .voltage_max = 8800, + .voltage_normal = 7890, + .voltage_min = 6000, + .precharge_current = 256, + .start_charging_min_c = 0, + .start_charging_max_c = 45, + .charging_min_c = 0, + .charging_max_c = 60, + .discharging_min_c = -20, + .discharging_max_c = 60, }, - }, }; BUILD_ASSERT(ARRAY_SIZE(board_battery_info) == BATTERY_TYPE_COUNT); -const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_POWER_TECH; +const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_C21N2018; diff --git a/board/corori2/board.h b/board/corori2/board.h index b5381bd4ab..35bfd0d3da 100644 --- a/board/corori2/board.h +++ b/board/corori2/board.h @@ -194,7 +194,8 @@ enum pwm_channel { /* List of possible batteries */ enum battery_type { - BATTERY_POWER_TECH, + BATTERY_C21N2018, + BATTERY_C21N2018_2ND, BATTERY_TYPE_COUNT, }; |