summaryrefslogtreecommitdiff
path: root/board/reef/battery.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/reef/battery.c')
-rw-r--r--board/reef/battery.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/board/reef/battery.c b/board/reef/battery.c
index f2e630fe7b..09f22a1816 100644
--- a/board/reef/battery.c
+++ b/board/reef/battery.c
@@ -531,54 +531,6 @@ int board_cut_off_battery(void)
ship_mode_inf->ship_mode_data);
}
-enum battery_disconnect_state battery_get_disconnect_state(void)
-{
- uint8_t data[6];
- int rv;
-
- /*
- * Take note if we find that the battery isn't in disconnect state,
- * and always return NOT_DISCONNECTED without probing the battery.
- * This assumes the battery will not go to disconnect state during
- * runtime.
- */
- static int not_disconnected;
-
- if (not_disconnected)
- return BATTERY_NOT_DISCONNECTED;
-
- if (extpower_is_present()) {
- /* Check if battery charging + discharging is disabled. */
- rv = sb_read_mfgacc(PARAM_OPERATION_STATUS,
- SB_ALT_MANUFACTURER_ACCESS, data, sizeof(data));
- if (rv)
- return BATTERY_DISCONNECT_ERROR;
- if (~data[3] & (BATTERY_DISCHARGING_DISABLED |
- BATTERY_CHARGING_DISABLED)) {
- not_disconnected = 1;
- return BATTERY_NOT_DISCONNECTED;
- }
-
- /*
- * Battery is neither charging nor discharging. Verify that
- * we didn't enter this state due to a safety fault.
- */
- rv = sb_read_mfgacc(PARAM_SAFETY_STATUS,
- SB_ALT_MANUFACTURER_ACCESS, data, sizeof(data));
- if (rv || data[2] || data[3] || data[4] || data[5])
- return BATTERY_DISCONNECT_ERROR;
-
- /*
- * Battery is present and also the status is initialized and
- * no safety fault, battery is disconnected.
- */
- if (battery_is_present() == BP_YES)
- return BATTERY_DISCONNECTED;
- }
- not_disconnected = 1;
- return BATTERY_NOT_DISCONNECTED;
-}
-
static int charger_should_discharge_on_ac(struct charge_state_data *curr)
{
/* can not discharge on AC without battery */