diff options
author | Paul Ma <magf@bitland.corp-partner.google.com> | 2019-09-30 16:24:58 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-10 12:53:25 +0000 |
commit | eea0da9e3d21b9b8bc6b95ef007fee4d2fdb0ba4 (patch) | |
tree | a2e17f7ddacaa6d2b80f93beef74721f42510b04 /board/akemi | |
parent | 1562d4f9303d163a15aa896ad55a4957804490d9 (diff) | |
download | chrome-ec-eea0da9e3d21b9b8bc6b95ef007fee4d2fdb0ba4.tar.gz |
akemi: Add battery information
Akemi support three batteries:
- LGC: L18L4PE0
- SUNWODA: L19D4PG2
- SMP: L19M4PG2
This CL add the support of them.
BUG=b:141621369, b:141660298
BRANCH=none
TEST=boot akemi board with battery, charging/discharging/cutoff
work as expected.
Change-Id: I8735f6a0bcd90abc4923d98b2d337ca41b9f12c7
Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1831717
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'board/akemi')
-rw-r--r-- | board/akemi/battery.c | 81 | ||||
-rw-r--r-- | board/akemi/board.h | 5 |
2 files changed, 55 insertions, 31 deletions
diff --git a/board/akemi/battery.c b/board/akemi/battery.c index b81fa795b9..d9587eae8d 100644 --- a/board/akemi/battery.c +++ b/board/akemi/battery.c @@ -32,62 +32,85 @@ * address, mask, and disconnect value need to be provided. */ const struct board_batt_params board_battery_info[] = { - /* SMP LIS Dell FMXMT Battery Information */ - [BATTERY_SMP_LIS] = { + [BATTERY_LGC] = { .fuel_gauge = { - .manuf_name = "SMP-LIS3.78", + .manuf_name = "LGC", .ship_mode = { - .reg_addr = 0x0, - .reg_data = { 0x10, 0x10 }, + .reg_addr = 0x34, + .reg_data = { 0x0000, 0x1000 }, }, .fet = { - .reg_addr = 0x0, - .reg_mask = 0x2000, - .disconnect_val = 0x2000, + .reg_addr = 0x34, + .reg_mask = 0x0100, + .disconnect_val = 0x0100, } }, .batt_info = { - .voltage_max = 8800, - .voltage_normal = 7660, /* mV */ - .voltage_min = 6000, /* mV */ - .precharge_current = 256, /* mA */ + .voltage_max = 8800, /* mV */ + .voltage_normal = 7700, /* 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 = 73, + }, + }, + [BATTERY_SUNWODA] = { + .fuel_gauge = { + .manuf_name = "SUNWODA", + .ship_mode = { + .reg_addr = 0x34, + .reg_data = { 0x0000, 0x1000 }, + }, + .fet = { + .reg_addr = 0x34, + .reg_mask = 0x0100, + .disconnect_val = 0x0100, + } + }, + .batt_info = { + .voltage_max = 8800, /* mV */ + .voltage_normal = 7680, /* mV */ + .voltage_min = 6000, /* mV */ + .precharge_current = 333, /* mA */ .start_charging_min_c = 0, - .start_charging_max_c = 60, + .start_charging_max_c = 50, .charging_min_c = 0, .charging_max_c = 60, - .discharging_min_c = 0, + .discharging_min_c = -20, .discharging_max_c = 60, }, }, - - /* SMP SDI Dell FMXMT Battery Information */ - [BATTERY_SMP_SDI] = { + [BATTERY_SMP] = { .fuel_gauge = { - .manuf_name = "SMP-SDI-3727", + .manuf_name = "SMP", .ship_mode = { - .reg_addr = 0x0, - .reg_data = { 0x10, 0x10 }, + .reg_addr = 0x34, + .reg_data = { 0x0000, 0x1000 }, }, .fet = { - .reg_addr = 0x0, - .reg_mask = 0x2000, - .disconnect_val = 0x2000, + .reg_addr = 0x34, + .reg_mask = 0x0100, + .disconnect_val = 0x0100, } }, .batt_info = { .voltage_max = 8800, - .voltage_normal = 7660, /* mV */ - .voltage_min = 6000, /* mV */ - .precharge_current = 256, /* mA */ + .voltage_normal = 7680, /* mV */ + .voltage_min = 6500, /* mV */ + .precharge_current = 337, /* mA */ .start_charging_min_c = 0, - .start_charging_max_c = 60, + .start_charging_max_c = 50, .charging_min_c = 0, .charging_max_c = 60, - .discharging_min_c = 0, + .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_SMP_SDI; +const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_LGC; diff --git a/board/akemi/board.h b/board/akemi/board.h index c95a1d5d7b..630416914d 100644 --- a/board/akemi/board.h +++ b/board/akemi/board.h @@ -147,8 +147,9 @@ enum temp_sensor_id { /* List of possible batteries */ enum battery_type { - BATTERY_SMP_LIS, - BATTERY_SMP_SDI, + BATTERY_LGC, + BATTERY_SUNWODA, + BATTERY_SMP, BATTERY_TYPE_COUNT, }; |