diff options
-rw-r--r-- | board/host/board.h | 3 | ||||
-rw-r--r-- | common/charge_manager.c | 4 | ||||
-rw-r--r-- | include/charge_manager.h | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/board/host/board.h b/board/host/board.h index 2d7c492238..714d1346b0 100644 --- a/board/host/board.h +++ b/board/host/board.h @@ -54,9 +54,6 @@ enum { CHARGE_SUPPLIER_TEST_COUNT }; -/* Custom charge_manager priority table is defined in test code */ -extern const int supplier_priority[]; - /* Standard-current Rp */ #define PD_SRC_VNC PD_SRC_DEF_VNC_MV #define PD_SRC_RD_THRESHOLD PD_SRC_DEF_RD_THRESH_MV diff --git a/common/charge_manager.c b/common/charge_manager.c index 8095c63517..432c661a36 100644 --- a/common/charge_manager.c +++ b/common/charge_manager.c @@ -29,7 +29,7 @@ PD_T_SAFE_0V + 500 * MSEC) /* - * Charge supplier priority: lower number indicates higher priority. + * Default charge supplier priority * * - Always pick dedicated charge if present since that is the best product * decision. @@ -44,7 +44,7 @@ * - Last, pick one from the rest suppliers. Also note that some boards assume * wireless suppliers as low priority. */ -test_mockable const int supplier_priority[] = { +__attribute__((weak)) const int supplier_priority[] = { #if CONFIG_DEDICATED_CHARGE_PORT_COUNT > 0 [CHARGE_SUPPLIER_DEDICATED] = 0, #endif diff --git a/include/charge_manager.h b/include/charge_manager.h index cb32eb623d..938d323fbd 100644 --- a/include/charge_manager.h +++ b/include/charge_manager.h @@ -54,6 +54,12 @@ enum charge_supplier { CHARGE_SUPPLIER_COUNT }; +/* + * Charge supplier priority: lower number indicates higher priority. + * Default priority is in charge_manager.c. It can be overridden by boards. + */ +extern const int supplier_priority[]; + /* Charge tasks report available current and voltage */ struct charge_port_info { int current; |