diff options
-rw-r--r-- | board/pompom/board.c | 43 | ||||
-rw-r--r-- | board/pompom/board.h | 1 |
2 files changed, 13 insertions, 31 deletions
diff --git a/board/pompom/board.c b/board/pompom/board.c index b46e347f88..2f1de29013 100644 --- a/board/pompom/board.c +++ b/board/pompom/board.c @@ -269,8 +269,6 @@ DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); void board_hibernate(void) { - int i; - /* * Sensors are unpowered in hibernate. Apply PD to the * interrupt lines such that they don't float. @@ -290,8 +288,7 @@ void board_hibernate(void) * otherwise, ACOK won't go High and can't wake EC up. Check the * bug b/170324206 for details. */ - for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++) - ppc_vbus_sink_enable(i, 1); + ppc_vbus_sink_enable(USB_PD_PORT_C0, 1); } __override uint16_t board_get_ps8xxx_product_id(int port) @@ -323,9 +320,9 @@ void board_tcpc_init(void) * Initialize HPD to low; after sysjump SOC needs to see * HPD pulse to enable video path */ - for (int port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; ++port) - usb_mux_hpd_update(port, USB_PD_MUX_HPD_LVL_DEASSERTED | - USB_PD_MUX_HPD_IRQ_DEASSERTED); + usb_mux_hpd_update(USB_PD_PORT_C0, + USB_PD_MUX_HPD_LVL_DEASSERTED | + USB_PD_MUX_HPD_IRQ_DEASSERTED); } DECLARE_HOOK(HOOK_INIT, board_tcpc_init, HOOK_PRIO_INIT_I2C + 1); @@ -405,24 +402,20 @@ void board_overcurrent_event(int port, int is_overcurrented) int board_set_active_charge_port(int port) { - int is_real_port = (port >= 0 && port < CONFIG_USB_PD_PORT_MAX_COUNT); - int i; + int is_real_port = (port == USB_PD_PORT_C0); if (!is_real_port && port != CHARGE_PORT_NONE) return EC_ERROR_INVAL; if (port == CHARGE_PORT_NONE) { CPRINTS("Disabling all charging port"); - - /* Disable all ports. */ - for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++) { - /* - * Do not return early if one fails otherwise we can - * get into a boot loop assertion failure. - */ - if (board_vbus_sink_enable(i, 0)) - CPRINTS("Disabling p%d sink path failed.", i); - } + /* + * Do not return early if one fails otherwise we can + * get into a boot loop assertion failure. + */ + if (board_vbus_sink_enable(USB_PD_PORT_C0, 0)) + CPRINTS("Disabling p%d sink path failed.", + USB_PD_PORT_C0); return EC_SUCCESS; } @@ -435,18 +428,6 @@ int board_set_active_charge_port(int port) CPRINTS("New charge port: p%d", port); - /* - * Turn off the other ports' sink path FETs, before enabling the - * requested charge port. - */ - for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++) { - if (i == port) - continue; - - if (board_vbus_sink_enable(i, 0)) - CPRINTS("p%d: sink path disable failed.", i); - } - /* Enable requested charge port. */ if (board_vbus_sink_enable(port, 1)) { CPRINTS("p%d: sink path enable failed.", port); diff --git a/board/pompom/board.h b/board/pompom/board.h index 1282ecdb41..774b339273 100644 --- a/board/pompom/board.h +++ b/board/pompom/board.h @@ -32,6 +32,7 @@ #define CONFIG_USB_PD_TCPM_PS8805 #define CONFIG_USBC_PPC_SN5S330 #define CONFIG_USB_PD_PORT_MAX_COUNT 1 +#define USB_PD_PORT_C0 0 /* USB-A */ #define USB_PORT_COUNT 1 |