diff options
Diffstat (limited to 'board/yuna/battery.c')
-rw-r--r-- | board/yuna/battery.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/board/yuna/battery.c b/board/yuna/battery.c index 0ea8273bde..7c34073f28 100644 --- a/board/yuna/battery.c +++ b/board/yuna/battery.c @@ -14,7 +14,7 @@ #define SB_SHIP_MODE_DATA 0xc574 /* Values for 48Wh 4UAF495780-1-T1186/AC011353-PRR14G01 battery */ -static const struct battery_info info = { +static const struct battery_info info_4s1p = { .voltage_max = 17200, .voltage_normal = 15200, /* Average of max & min */ @@ -31,9 +31,30 @@ static const struct battery_info info = { .discharging_max_c = 40, }; +/* Values for 54Wh LIS3091ACPC(SYS6)/AC011401-PRR13G01 battery */ +static const struct battery_info info_3s1p = { + + .voltage_max = 12600, + .voltage_normal = 11100, /* Average of max & min */ + .voltage_min = 9000, + + /* Pre-charge values. */ + .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 = 0, + .discharging_max_c = 75, +}; + const struct battery_info *battery_get_info(void) { - return &info; + if (gpio_get_level(GPIO_BAT_ID)) + return &info_3s1p; + else + return &info_4s1p; } int board_cut_off_battery(void) |