diff options
author | tian.tian <tian.tian@bitland.corp-partner.google.com> | 2018-10-23 18:07:14 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2018-10-25 09:30:27 +0000 |
commit | 0ac342320979830ccc6ca6f7ffd9cfc76b14f60f (patch) | |
tree | 844e1a8381aaf1007587a1400f1540c85ebe2961 | |
parent | e120dd644521ed5b81c906edf61836339eb69ee1 (diff) | |
download | chrome-ec-0ac342320979830ccc6ca6f7ffd9cfc76b14f60f.tar.gz |
hana:Add battery information
Add battery information for:
- SMP L18M3PG5
- LGC L18L3PG5
- Sunwoda L18D3PG5
BRANCH=oak
BUG=b:117618412,b:117532984
TEST=none
Change-Id: I4b359d6bb8dc6558daec215b086936b82e766ca0
Reviewed-on: https://chromium-review.googlesource.com/c/1296429
Reviewed-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Chao Ding <chao.ding@bitland.corp-partner.google.com>
Reviewed-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com>
Tested-by: Lu Zhang <lu.zhang@bitland.corp-partner.google.com>
Commit-Queue: Xiong Huang <xiong.huang@bitland.corp-partner.google.com>
-rw-r--r-- | board/elm/battery_hana.c | 80 |
1 files changed, 75 insertions, 5 deletions
diff --git a/board/elm/battery_hana.c b/board/elm/battery_hana.c index dd6cc40625..ad42eed944 100644 --- a/board/elm/battery_hana.c +++ b/board/elm/battery_hana.c @@ -17,6 +17,9 @@ enum battery_type { INIT = -1, SIMPLO = 0, SUNWODA, + SMP011, + LGC, + SUNWODA01, BATTERY_TYPE_COUNT, DEFAULT_BATTERY_TYPE = SIMPLO, }; @@ -51,10 +54,6 @@ static const struct battery_info info_simplo = { .discharging_max_c = 60, }; -static const struct ship_mode_info ship_mode_info_simplo = { - .ship_mode_reg = 0x34, - .ship_mode_data = { 0x0000, 0x1000 }, -}; static const struct battery_info info_sunwoda = { .voltage_max = 13050, @@ -76,13 +75,63 @@ static const struct ship_mode_info ship_mode_info_sunwoda = { .ship_mode_data = { 0x0010, 0x0010 }, }; +static const struct battery_info info_smp011 = { + .voltage_max = 13050, + .voltage_normal = 11250, + .voltage_min = 9000, + /* Pre-charge values. */ + .precharge_current = 186, /* 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 = 60, +}; + +static const struct ship_mode_info ship_mode_info_default = { + .ship_mode_reg = 0x34, + .ship_mode_data = { 0x0000, 0x1000 }, +}; + +static const struct battery_info info_lgc = { + .voltage_max = 13050, + .voltage_normal = 11400, + .voltage_min = 9000, + /* Pre-charge values. */ + .precharge_current = 181, /* 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, +}; + +static const struct battery_info info_sunwoda01 = { + .voltage_max = 13050, + .voltage_normal = 11250, + .voltage_min = 9000, + /* Pre-charge values. */ + .precharge_current = 200, /* mA */ + + .start_charging_min_c = 0, + .start_charging_max_c = 60, + .charging_min_c = 0, + .charging_max_c = 60, + .discharging_min_c = -20, + .discharging_max_c = 60, +}; + static const struct battery_device support_batteries[BATTERY_TYPE_COUNT] = { [SIMPLO] = { .manuf = "SMP", .device = "L15M3PB1", .design_mv = 11100, .battery_info = &info_simplo, - .ship_mode_info = &ship_mode_info_simplo, + .ship_mode_info = &ship_mode_info_default, }, [SUNWODA] = { .manuf = "sunwoda", @@ -91,6 +140,27 @@ static const struct battery_device support_batteries[BATTERY_TYPE_COUNT] = { .battery_info = &info_sunwoda, .ship_mode_info = &ship_mode_info_sunwoda, }, + [SMP011] = { + .manuf = "smp", + .device = "L18M3PG5", + .design_mv = 11250, + .battery_info = &info_smp011, + .ship_mode_info = &ship_mode_info_default, + }, + [LGC] = { + .manuf = "lgc", + .device = "L18L3PG5", + .design_mv = 11400, + .battery_info = &info_lgc, + .ship_mode_info = &ship_mode_info_default, + }, + [SUNWODA01] = { + .manuf = "sunwoda", + .device = "L18D3PG5", + .design_mv = 11250, + .battery_info = &info_sunwoda01, + .ship_mode_info = &ship_mode_info_default, + }, }; static inline const struct battery_device *get_battery_device(void) |