summaryrefslogtreecommitdiff
path: root/board/asurada
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2020-04-27 16:29:46 +0800
committerCommit Bot <commit-bot@chromium.org>2020-06-10 09:29:08 +0000
commit3f4a4390a7d65bc51bb30af4ddb48db5033ee0ec (patch)
tree543bb498aa664a9283f7acc507c7124d74bfc3bf /board/asurada
parentd59b5cae9eaf73c2bc14a30eaf080d98c5e634fa (diff)
downloadchrome-ec-3f4a4390a7d65bc51bb30af4ddb48db5033ee0ec.tar.gz
asurada: enable DP HPD
BRANCH=master BUG=b:154565980 TEST=Asurada has DP out on C0 and C1. Change-Id: If71a29b4b7fb1c2ca966d707f142b4350edc8125 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2167129 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'board/asurada')
-rw-r--r--board/asurada/board.c8
-rw-r--r--board/asurada/board.h2
-rw-r--r--board/asurada/usb_pd_policy.c12
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);