summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2019-07-29 16:36:41 +0800
committerCommit Bot <commit-bot@chromium.org>2019-09-09 06:50:36 +0000
commit1524c164f52acc8cdab918b782c21e2120dcc5f6 (patch)
treeef702f80757cf97f6a1c12bc65d2f6a069b5739a /board
parent60c0372ba770590333f164c4066ee068c6a4f93d (diff)
downloadchrome-ec-1524c164f52acc8cdab918b782c21e2120dcc5f6.tar.gz
jacuzzi: enable DP
enable dp on jacuzzi, and add back the dp implementation before CL:1660524 for all new devices including jacuzzi. usb_pd_policy now supports two different configs: - kukui/krane, rev <= 4: no mux (CONFIG_USB_MUX_VIRTUAL defined) - all new devices: have a real mux BUG=b:135895590,b:135079572 TEST=attach a usb hub and moniter to the dut, verify that dp/dp+mux mode and both polarities can detected correctly BRANCH=master Change-Id: I3e4757c97d555a4afb48076fc4785305c96b0a7f Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1723892 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/jacuzzi/board.c14
-rw-r--r--board/kodama/board.c11
-rw-r--r--board/kukui/board.h1
3 files changed, 16 insertions, 10 deletions
diff --git a/board/jacuzzi/board.c b/board/jacuzzi/board.c
index 6f2450b09d..3d23faea5f 100644
--- a/board/jacuzzi/board.c
+++ b/board/jacuzzi/board.c
@@ -107,15 +107,11 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
static void board_hpd_status(int port, int hpd_lvl, int hpd_irq)
{
- /* Invert HPD level since GPIOs are active low. */
- hpd_lvl = !hpd_lvl;
-
- gpio_set_level(GPIO_USB_C0_HPD_OD, hpd_lvl);
- if (hpd_irq) {
- gpio_set_level(GPIO_USB_C0_HPD_OD, 1);
- msleep(1);
- gpio_set_level(GPIO_USB_C0_HPD_OD, hpd_lvl);
- }
+ /*
+ * svdm_dp_attention() did most of the work, we only need to notify
+ * host here.
+ */
+ host_set_single_event(EC_HOST_EVENT_USB_MUX);
}
struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
diff --git a/board/kodama/board.c b/board/kodama/board.c
index 1e778410cb..88f9042d4c 100644
--- a/board/kodama/board.c
+++ b/board/kodama/board.c
@@ -91,11 +91,20 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
},
};
+static void board_hpd_status(int port, int hpd_lvl, int hpd_irq)
+{
+ /*
+ * svdm_dp_attention() did most of the work, we only need to notify
+ * host here.
+ */
+ host_set_single_event(EC_HOST_EVENT_USB_MUX);
+}
+
struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
{
.port_addr = IT5205_I2C_ADDR1_FLAGS,
.driver = &it5205_usb_mux_driver,
- .hpd_update = &virtual_hpd_update,
+ .hpd_update = &board_hpd_status,
},
};
diff --git a/board/kukui/board.h b/board/kukui/board.h
index c7d2da1ed9..b86b9d92bf 100644
--- a/board/kukui/board.h
+++ b/board/kukui/board.h
@@ -24,6 +24,7 @@
#include "baseboard.h"
#define CONFIG_USB_MUX_IT5205
+#define CONFIG_USB_MUX_VIRTUAL
#define CONFIG_VOLUME_BUTTONS
/* Battery */