summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
Diffstat (limited to 'board')
-rw-r--r--board/samus_pd/board.h1
-rw-r--r--board/samus_pd/usb_pd_config.h3
-rw-r--r--board/samus_pd/usb_pd_policy.c6
3 files changed, 10 insertions, 0 deletions
diff --git a/board/samus_pd/board.h b/board/samus_pd/board.h
index 627fc087c2..f2cd65ef96 100644
--- a/board/samus_pd/board.h
+++ b/board/samus_pd/board.h
@@ -61,6 +61,7 @@
#define CONFIG_USB_SWITCH_PI3USB9281_MUX_GPIO GPIO_USB_C_BC12_SEL
#define CONFIG_USBC_SS_MUX
#define CONFIG_USBC_VCONN
+#define CONFIG_USBC_VCONN_SWAP
#define CONFIG_VBOOT_HASH
#undef CONFIG_WATCHDOG_HELP
diff --git a/board/samus_pd/usb_pd_config.h b/board/samus_pd/usb_pd_config.h
index 9702714a56..a7df33e499 100644
--- a/board/samus_pd/usb_pd_config.h
+++ b/board/samus_pd/usb_pd_config.h
@@ -301,6 +301,9 @@ static inline int pd_snk_is_vbus_provided(int port)
#define PD_POWER_SUPPLY_TURN_ON_DELAY 30000 /* us */
#define PD_POWER_SUPPLY_TURN_OFF_DELAY 250000 /* us */
+/* delay to turn on/off vconn */
+#define PD_VCONN_SWAP_DELAY 5000 /* us */
+
/* Define typical operating power and max power */
#define PD_OPERATING_POWER_MW 15000
#define PD_MAX_POWER_MW 60000
diff --git a/board/samus_pd/usb_pd_policy.c b/board/samus_pd/usb_pd_policy.c
index 85e3244527..7e1302b018 100644
--- a/board/samus_pd/usb_pd_policy.c
+++ b/board/samus_pd/usb_pd_policy.c
@@ -151,6 +151,12 @@ int pd_check_data_swap(int port, int data_role)
return (data_role == PD_ROLE_UFP) ? 1 : 0;
}
+int pd_check_vconn_swap(int port)
+{
+ /* in S5, do not allow vconn swap since pp5000 rail is off */
+ return gpio_get_level(GPIO_PCH_SLP_S5_L);
+}
+
void pd_execute_data_swap(int port, int data_role)
{
/* Open USB switches when taking UFP role */