diff options
Diffstat (limited to 'board')
-rw-r--r-- | board/dirinboz/battery.c | 210 | ||||
-rw-r--r-- | board/dirinboz/board.h | 9 |
2 files changed, 154 insertions, 65 deletions
diff --git a/board/dirinboz/battery.c b/board/dirinboz/battery.c index b5cccdd9cf..f53143aa65 100644 --- a/board/dirinboz/battery.c +++ b/board/dirinboz/battery.c @@ -10,7 +10,7 @@ #include "util.h" /* - * Battery info for all Zork battery types. Note that the fields + * Battery info for all Dirinboz battery types. Note that the fields * start_charging_min/max and charging_min/max are not used for the charger. * The effective temperature limits are given by discharging_min/max_c. * @@ -32,93 +32,179 @@ * address, mask, and disconnect value need to be provided. */ const struct board_batt_params board_battery_info[] = { - /* SMP L19M3PG1 */ - [BATTERY_SMP] = { + /* Simplo Coslight Battery Information */ + [BATTERY_SIMPLO_COS] = { .fuel_gauge = { - .manuf_name = "SMP", - .device_name = "L19M3PG1", + .manuf_name = "333-1C-DA-A", .ship_mode = { - .reg_addr = 0x34, - .reg_data = { 0x0000, 0x1000 }, + .reg_addr = 0x00, + .reg_data = { 0x0010, 0x0010 }, }, .fet = { - .reg_addr = 0x34, - .reg_mask = 0x0100, - .disconnect_val = 0x0100, - } + .mfgacc_support = 1, + .reg_addr = 0x0, + .reg_mask = 0x0006, + .disconnect_val = 0x0, + }, }, .batt_info = { - .voltage_max = 13200, /* mV */ - .voltage_normal = 11520, /* mV */ - .voltage_min = 9000, /* mV */ - .precharge_current = 200, /* mA */ - .start_charging_min_c = 0, - .start_charging_max_c = 60, - .charging_min_c = 0, - .charging_max_c = 50, - .discharging_min_c = -20, - .discharging_max_c = 73, + .voltage_max = 8800, /* mV */ + .voltage_normal = 7700, + .voltage_min = 6000, + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 45, + .charging_min_c = 0, + .charging_max_c = 45, + .discharging_min_c = -10, + .discharging_max_c = 60, }, }, - /* LGC L19L3PG1 */ - [BATTERY_LGC] = { + /* Simplo HIGHPOWER Battery Information */ + [BATTERY_SIMPLO_HIGHPOWER] = { .fuel_gauge = { - .manuf_name = "LGC", - .device_name = "L19L3PG1", + .manuf_name = "333-1D-DA-A", .ship_mode = { - .reg_addr = 0x34, - .reg_data = { 0x0000, 0x1000 }, + .reg_addr = 0x00, + .reg_data = { 0x0010, 0x0010 }, }, .fet = { - .reg_addr = 0x34, - .reg_mask = 0x0100, - .disconnect_val = 0x0100, - } + .mfgacc_support = 1, + .reg_addr = 0x0, + .reg_mask = 0x0006, + .disconnect_val = 0x0, + }, }, .batt_info = { - .voltage_max = 13200, /* mV */ - .voltage_normal = 11550, /* mV */ - .voltage_min = 9000, /* mV */ - .precharge_current = 200, /* mA */ - .start_charging_min_c = 0, - .start_charging_max_c = 60, - .charging_min_c = 0, - .charging_max_c = 50, - .discharging_min_c = -20, - .discharging_max_c = 73, + .voltage_max = 8800, /* mV */ + .voltage_normal = 7700, + .voltage_min = 6000, + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 45, + .charging_min_c = 0, + .charging_max_c = 45, + .discharging_min_c = -10, + .discharging_max_c = 60, }, }, - /* Celxpert L19C3PG1 */ - [BATTERY_CEL] = { + /* Samsung SDI Battery Information */ + [BATTERY_SAMSUNG_SDI] = { .fuel_gauge = { - .manuf_name = "Celxpert", - .device_name = "L19C3PG1", + .manuf_name = "333-54-DA-A", .ship_mode = { - .reg_addr = 0x34, - .reg_data = { 0x0000, 0x1000 }, + .reg_addr = 0x00, + .reg_data = { 0x0010, 0x0010 }, }, .fet = { - .reg_addr = 0x34, - .reg_mask = 0x0100, - .disconnect_val = 0x0100, - } + .mfgacc_support = 1, + .reg_addr = 0x0, + .reg_mask = 0x0006, + .disconnect_val = 0x0, + }, + }, + .batt_info = { + .voltage_max = 8800, /* mV */ + .voltage_normal = 7700, + .voltage_min = 6000, + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 45, + .charging_min_c = 0, + .charging_max_c = 45, + .discharging_min_c = -10, + .discharging_max_c = 60, + }, + }, + + /* DynaPack ATL Battery Information */ + [BATTERY_DANAPACK_ATL] = { + .fuel_gauge = { + .manuf_name = "333-27-DA-A", + .ship_mode = { + .reg_addr = 0x00, + .reg_data = { 0x0010, 0x0010 }, + }, + .fet = { + .mfgacc_support = 1, + .reg_addr = 0x0, + .reg_mask = 0x0006, + .disconnect_val = 0x0, + }, + }, + .batt_info = { + .voltage_max = 8800, /* mV */ + .voltage_normal = 7700, + .voltage_min = 6000, + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 45, + .charging_min_c = 0, + .charging_max_c = 45, + .discharging_min_c = -10, + .discharging_max_c = 60, + }, + }, + + /* DynaPack Coslight Battery Information */ + [BATTERY_DANAPACK_COS] = { + .fuel_gauge = { + .manuf_name = "333-2C-DA-A", + .ship_mode = { + .reg_addr = 0x00, + .reg_data = { 0x0010, 0x0010 }, + }, + .fet = { + .mfgacc_support = 1, + .reg_addr = 0x0, + .reg_mask = 0x0006, + .disconnect_val = 0x0, + }, + }, + .batt_info = { + .voltage_max = 8800, /* mV */ + .voltage_normal = 7700, + .voltage_min = 6000, + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 45, + .charging_min_c = 0, + .charging_max_c = 45, + .discharging_min_c = -10, + .discharging_max_c = 60, + }, + }, + + [BATTERY_COSMX] = { + .fuel_gauge = { + .manuf_name = "333-AC-DA-A", + .ship_mode = { + .reg_addr = 0x00, + .reg_data = { 0x0010, 0x0010 }, + }, + .fet = { + .mfgacc_support = 1, + .reg_addr = 0x0, + .reg_mask = 0x0006, + .disconnect_val = 0x0, + }, }, .batt_info = { - .voltage_max = 13200, /* mV */ - .voltage_normal = 11520, /* mV */ - .voltage_min = 9000, /* mV */ - .precharge_current = 200, /* mA */ - .start_charging_min_c = 0, - .start_charging_max_c = 60, - .charging_min_c = 0, - .charging_max_c = 50, - .discharging_min_c = -20, - .discharging_max_c = 70, + .voltage_max = 8800, /* mV */ + .voltage_normal = 7700, + .voltage_min = 6000, + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 45, + .charging_min_c = 0, + .charging_max_c = 45, + .discharging_min_c = -10, + .discharging_max_c = 60, }, }, }; BUILD_ASSERT(ARRAY_SIZE(board_battery_info) == BATTERY_TYPE_COUNT); -const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_SMP; +const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_SIMPLO_COS; diff --git a/board/dirinboz/board.h b/board/dirinboz/board.h index b935115ba4..25af2d988d 100644 --- a/board/dirinboz/board.h +++ b/board/dirinboz/board.h @@ -83,9 +83,12 @@ enum adc_channel { }; enum battery_type { - BATTERY_SMP, - BATTERY_LGC, - BATTERY_CEL, + BATTERY_SIMPLO_COS, + BATTERY_SIMPLO_HIGHPOWER, + BATTERY_SAMSUNG_SDI, + BATTERY_DANAPACK_ATL, + BATTERY_DANAPACK_COS, + BATTERY_COSMX, BATTERY_TYPE_COUNT, }; |