diff --git a/board/glados/board.c b/board/glados/board.c index c70b17b36f..3333b38b42 100644 --- a/board/glados/board.c +++ b/board/glados/board.c @@ -273,15 +273,9 @@ int board_set_active_charge_port(int charge_port) CPRINTS("New chg p%d", charge_port); if (charge_port == CHARGE_PORT_NONE) { - /* - * TODO: currently we only get VBUS knowledge when charge - * is enabled. so, when not charging, we need to enable - * both ports. but, this is dangerous if you have two - * chargers plugged in and you set charge override to -1 - * then it will enable both sides! - */ - gpio_set_level(GPIO_USB_C0_CHARGE_EN_L, 0); - gpio_set_level(GPIO_USB_C1_CHARGE_EN_L, 0); + /* Disable both ports */ + gpio_set_level(GPIO_USB_C0_CHARGE_EN_L, 1); + gpio_set_level(GPIO_USB_C1_CHARGE_EN_L, 1); } else { /* Make sure non-charging port is disabled */ gpio_set_level(charge_port ? GPIO_USB_C0_CHARGE_EN_L : diff --git a/board/glados/usb_pd_policy.c b/board/glados/usb_pd_policy.c index 3ff8a76c53..57154978fa 100644 --- a/board/glados/usb_pd_policy.c +++ b/board/glados/usb_pd_policy.c @@ -89,15 +89,9 @@ void pd_power_supply_reset(int port) /* Disable VBUS */ gpio_set_level(port ? GPIO_USB_C1_5V_EN : GPIO_USB_C0_5V_EN, 0); - /* - * TODO: Currently we can only detect VBUS when charge_en is - * asserted, so, if there is no active charge port, then enable - * charge_en. If the other port is the active charger, then leave - * this port disabled. - */ - if (charge_manager_get_active_charge_port() != !port) - gpio_set_level(port ? GPIO_USB_C1_CHARGE_EN_L : - GPIO_USB_C0_CHARGE_EN_L, 0); + + /* notify host of power info change */ + pd_send_host_event(PD_EVENT_POWER_CHANGE); } void pd_set_input_current_limit(int port, uint32_t max_ma, @@ -154,7 +148,7 @@ int pd_check_data_swap(int port, int data_role) void pd_execute_data_swap(int port, int data_role) { - /* TODO: need to open/close D+/D- switch based on role */ + /* Do nothing */ } void pd_check_pr_role(int port, int pr_role, int flags) diff --git a/board/kunimitsu/board.c b/board/kunimitsu/board.c index 5b825445ef..dcd66ada94 100644 --- a/board/kunimitsu/board.c +++ b/board/kunimitsu/board.c @@ -382,15 +382,9 @@ int board_set_active_charge_port(int charge_port) CPRINTS("New chg p%d", charge_port); if (charge_port == CHARGE_PORT_NONE) { - /* - * TODO: currently we only get VBUS knowledge when charge - * is enabled. so, when not charging, we need to enable - * both ports. but, this is dangerous if you have two - * chargers plugged in and you set charge override to -1 - * then it will enable both sides! - */ - gpio_set_level(GPIO_USB_C0_CHARGE_EN_L, 0); - gpio_set_level(GPIO_USB_C1_CHARGE_EN_L, 0); + /* Disable both ports */ + gpio_set_level(GPIO_USB_C0_CHARGE_EN_L, 1); + gpio_set_level(GPIO_USB_C1_CHARGE_EN_L, 1); } else { /* Make sure non-charging port is disabled */ gpio_set_level(charge_port ? GPIO_USB_C0_CHARGE_EN_L : diff --git a/board/kunimitsu/usb_pd_policy.c b/board/kunimitsu/usb_pd_policy.c index 3ff8a76c53..57154978fa 100644 --- a/board/kunimitsu/usb_pd_policy.c +++ b/board/kunimitsu/usb_pd_policy.c @@ -89,15 +89,9 @@ void pd_power_supply_reset(int port) /* Disable VBUS */ gpio_set_level(port ? GPIO_USB_C1_5V_EN : GPIO_USB_C0_5V_EN, 0); - /* - * TODO: Currently we can only detect VBUS when charge_en is - * asserted, so, if there is no active charge port, then enable - * charge_en. If the other port is the active charger, then leave - * this port disabled. - */ - if (charge_manager_get_active_charge_port() != !port) - gpio_set_level(port ? GPIO_USB_C1_CHARGE_EN_L : - GPIO_USB_C0_CHARGE_EN_L, 0); + + /* notify host of power info change */ + pd_send_host_event(PD_EVENT_POWER_CHANGE); } void pd_set_input_current_limit(int port, uint32_t max_ma, @@ -154,7 +148,7 @@ int pd_check_data_swap(int port, int data_role) void pd_execute_data_swap(int port, int data_role) { - /* TODO: need to open/close D+/D- switch based on role */ + /* Do nothing */ } void pd_check_pr_role(int port, int pr_role, int flags)