diff options
Diffstat (limited to 'board/puff')
-rw-r--r-- | board/puff/board.c | 14 | ||||
-rw-r--r-- | board/puff/board.h | 5 |
2 files changed, 9 insertions, 10 deletions
diff --git a/board/puff/board.c b/board/puff/board.c index 4a6bb667b3..479e90f7fa 100644 --- a/board/puff/board.c +++ b/board/puff/board.c @@ -77,17 +77,15 @@ uint16_t tcpc_get_alert_status(void) return status; } +/* Called when the charge manager has switched to a new port. */ void board_set_charge_limit(int port, int supplier, int charge_ma, int max_ma, int charge_mv) { - charge_set_input_current_limit(MAX(charge_ma, - CONFIG_CHARGER_INPUT_CURRENT), - charge_mv); -} - -int charge_set_input_current_limit(int ma, int mv) -{ - return EC_SUCCESS; + /* Blink alert if insufficient power per system_can_boot_ap(). */ + int insufficient_power = + (charge_ma * charge_mv) < + (CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON * 1000); + led_alert(insufficient_power); } #include "port-sm.c" diff --git a/board/puff/board.h b/board/puff/board.h index d8db1d112e..e07622c762 100644 --- a/board/puff/board.h +++ b/board/puff/board.h @@ -141,7 +141,7 @@ #define PD_POWER_SUPPLY_TURN_OFF_DELAY 250000 /* us */ #define PD_VCONN_SWAP_DELAY 5000 /* us */ -#define PD_OPERATING_POWER_MW 30000 +#define PD_OPERATING_POWER_MW CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON #define PD_MAX_POWER_MW 100000 #define PD_MAX_CURRENT_MA 5000 #define PD_MAX_VOLTAGE_MV 20000 @@ -158,8 +158,9 @@ /* Charger */ #define CONFIG_CHARGE_MANAGER +/* Less than this much blocks AP power-on. */ +#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON 30000 #undef CONFIG_CHARGE_MANAGER_SAFE_MODE -#define CONFIG_CHARGER_INPUT_CURRENT 512 /* Allow low-current USB charging */ /* USB type C */ /* TODO: (b/147255678) Use TCPMv2 */ |