Skip to content

Commit 5e3eab1

Browse files
authored
Merge pull request #368 from FrameworkComputer/hx20.fix_powerup_with_cutoff_battery
Hx20.fix powerup with cutoff battery
2 parents 94697d0 + 2375767 commit 5e3eab1

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

board/hx20/board.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -582,19 +582,7 @@ void board_hibernate_late(void)
582582
/* put host chipset into reset */
583583
gpio_set_level(GPIO_SYS_RESET_L, 0);
584584

585-
/* Turn off LEDs in hibernate */
586-
/*
587-
gpio_set_level(GPIO_CHARGE_LED_1, 0);
588-
gpio_set_level(GPIO_CHARGE_LED_2, 0);
589-
*/
590-
591-
/*
592-
* Set PD wake low so that it toggles high to generate a wake
593-
* event once we leave hibernate.
594-
*/
595-
/*
596-
gpio_set_level(GPIO_USB_PD_WAKE, 0);
597-
*/
585+
board_power_off_deferred();
598586
}
599587

600588
/* according to Panel team suggest, delay 60ms to meet spec */

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)