summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2020-06-30 12:44:57 -0600
committerCommit Bot <commit-bot@chromium.org>2020-07-09 14:19:13 +0000
commitbd4116995dc02b644d8ea7da840a79b69c94adac (patch)
treebfbae00b982f5acc96e123d7d75b875e672cdcf5 /include
parent5330a08fb0ccd325e02472722bbb355f2b56508d (diff)
downloadchrome-ec-bd4116995dc02b644d8ea7da840a79b69c94adac.tar.gz
usbc: ensure we are suspending USB-C ports on shutdown
After CL:2208221, the check for the PD_CMD task no longer trigger, so we end up not calling suspend on our TCPC ports. We want to continue to suspend, which will apply CC open in TCPMv2 for a cooperative shutdown Also, correct override keyword usage for board_get_usb_pd_port_count since I had to touch those definitions to make IS_ENABLE work BRANCH=none BUG=b:160243292 TEST=See that software sync reboot, applies CC open (and browns out system) Change-Id: I00bf08c7d347441d77834e2c5122a09ca2316280 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2276318 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/config.h4
-rw-r--r--include/usb_pd.h20
2 files changed, 14 insertions, 10 deletions
diff --git a/include/config.h b/include/config.h
index 2d13bb550c..851f5d9e64 100644
--- a/include/config.h
+++ b/include/config.h
@@ -5117,6 +5117,10 @@
#undef CONFIG_HOSTCMD_PD
#endif
+#if defined(HAS_TASK_PDCMD) && defined(HAS_TASK_PD_C0_INT)
+#error Should not use PDCMD task with PD INT tasks
+#endif
+
/* Certain console cmds are irrelevant without parent modules. */
#ifndef CONFIG_BATTERY
#undef CONFIG_CMD_PWR_AVG
diff --git a/include/usb_pd.h b/include/usb_pd.h
index 4c968699c0..b2707f5f2b 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -2667,22 +2667,22 @@ int pd_set_frs_enable(int port, int enable);
*/
__override_proto uint8_t get_dp_pin_mode(int port);
-#ifdef CONFIG_USB_PD_PORT_MAX_COUNT
-#ifdef CONFIG_USB_POWER_DELIVERY
/**
* Get board specific usb pd port count
*
* @return <= CONFIG_USB_PD_PORT_MAX_COUNT if configured in board file,
* else return CONFIG_USB_PD_PORT_MAX_COUNT
*/
-uint8_t board_get_usb_pd_port_count(void);
-#else
-static inline uint8_t board_get_usb_pd_port_count(void)
-{
- return CONFIG_USB_PD_PORT_MAX_COUNT;
-}
-#endif /* CONFIG_USB_POWER_DELIVERY */
-#endif /* CONFIG_USB_PD_PORT_MAX_COUNT */
+__override_proto uint8_t board_get_usb_pd_port_count(void);
+
+
+/**
+ * Resets external PD chips including TCPCs and MCUs.
+ *
+ * Boards must provide this when PDCMD (PD MCUs case) or PD INT (TCPC case)
+ * tasks are present.
+ */
+void board_reset_pd_mcu(void);
/**
* Return true if specified PD port is debug accessory.