Skip to content

Commit 370e42d

Browse files
committed
set battery present only if valid SOC
Fix issue where the system would not power on if the battery was below the low safety cutoff threshold, as we would detect the battery and mark it as present, however the battery cutoff fet would still keep the battery disabled as it was in precharge. This would prevent the system from powering on. Signed-off-by: Kieran Levin <[email protected]>
1 parent e27425f commit 370e42d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

board/hx20/cypress5525.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,8 @@ void cypd_update_power(void)
357357
}
358358

359359
if (extpower_is_present() ||
360-
charger_current_battery_params()->flags & BATT_FLAG_RESPONSIVE)
360+
(charger_current_battery_params()->flags & BATT_FLAG_RESPONSIVE &&
361+
charger_current_battery_params()->state_of_charge > 0))
361362
system_power_present = 1;
362363
else
363364
system_power_present = 0;
@@ -368,7 +369,8 @@ int cypd_update_power_status(void)
368369
int i;
369370
int rv = EC_SUCCESS;
370371
int power_stat = 0;
371-
if (charger_current_battery_params()->flags & BATT_FLAG_RESPONSIVE) {
372+
if (charger_current_battery_params()->flags & BATT_FLAG_RESPONSIVE &&
373+
charger_current_battery_params()->state_of_charge > 0) {
372374
power_stat |= BIT(3);
373375
}
374376
if (extpower_is_present()) {

0 commit comments

Comments
 (0)