diff options
author | Peter Marheine <pmarheine@chromium.org> | 2020-01-20 12:34:04 +1100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-21 01:21:11 +0000 |
commit | 15edeaabe90c554d83faa4ff0c9143c66248e0e4 (patch) | |
tree | ce056b567a4c3d0880e97ed125038b6ab0515cce /board/puff | |
parent | 1afa04df3f399d5885ada9a9fbaec0f208f47bad (diff) | |
download | chrome-ec-15edeaabe90c554d83faa4ff0c9143c66248e0e4.tar.gz |
puff: blink LED when insufficient power to boot (<30W)
Also ensure we set the required power to the intended value, and remove
useless charger-related items.
BUG=b:146515963
TEST=LED blinks and does not boot when given 7.5W on USB-C.
BRANCH=None
Change-Id: I34df8f1cbf6648ef2007fc34c620ae1d2021f7a8
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2009526
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 */ |