diff options
-rw-r--r-- | board/asurada/board.c | 8 | ||||
-rw-r--r-- | board/asurada/board.h | 2 | ||||
-rw-r--r-- | board/asurada/usb_pd_policy.c | 12 |
3 files changed, 22 insertions, 0 deletions
diff --git a/board/asurada/board.c b/board/asurada/board.c index 712e11b210..3300e896f6 100644 --- a/board/asurada/board.c +++ b/board/asurada/board.c @@ -262,6 +262,14 @@ static int board_ps8743_mux_set(const struct usb_mux *me, /* Disable CE_DP pin, enable I2C control. */ reg |= PS8743_MODE_DP_REG_CONTROL; + /* + * DP specific config + * + * Enable/Disable IN_HPD on the DB. + */ + gpio_set_level(GPIO_USB_C1_DP_IN_HPD, + mux_state & USB_PD_MUX_DP_ENABLED); + return ps8743_write(me, PS8743_REG_MODE, reg); } diff --git a/board/asurada/board.h b/board/asurada/board.h index 2d9df904d9..9301ec3c10 100644 --- a/board/asurada/board.h +++ b/board/asurada/board.h @@ -78,6 +78,8 @@ #define CONFIG_USB_PD_DECODE_SOP #define CONFIG_USB_PD_DISCHARGE #define CONFIG_USB_PD_DISCHARGE_PPC +#define CONFIG_USB_PD_DP_HPD_GPIO +#define CONFIG_USB_PD_DP_HPD_GPIO_CUSTOM #define CONFIG_USB_PD_DUAL_ROLE #define CONFIG_USB_PD_ITE_ACTIVE_PORT_COUNT 2 #define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0 diff --git a/board/asurada/usb_pd_policy.c b/board/asurada/usb_pd_policy.c index ed10dd11db..741b3debc6 100644 --- a/board/asurada/usb_pd_policy.c +++ b/board/asurada/usb_pd_policy.c @@ -10,6 +10,18 @@ #error Asurada reference must define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT #endif +int svdm_get_hpd_gpio(int port) +{ + /* HPD is low active, inverse the result */ + return !gpio_get_level(GPIO_EC_DPBRDG_HPD_ODL); +} + +void svdm_set_hpd_gpio(int port, int en) +{ + /* HPD is low active, inverse the en */ + gpio_set_level(GPIO_EC_DPBRDG_HPD_ODL, !en); +} + int pd_snk_is_vbus_provided(int port) { return ppc_is_vbus_present(port); |