From 767e132d133b6f1216d630bd3b59e893a59bcffa Mon Sep 17 00:00:00 2001 From: Shawn Nematbakhsh Date: Thu, 19 Nov 2015 16:51:37 -0800 Subject: pd: Add support for multiple distinct TCPC alert signals If multiple TCPCs are present on a system then we may have multiple alert signals, each of which alerts us to the status of a different TCPC. Make boards with external non cros-ec TCPCs define tcpc_get_alert_status, which returns alert status based upon any alert GPIOs present, and then service only ports which are alerting. BUG=chromium:551683,chrome-os-partner:47851 TEST=Verify snoball PDCMD task sleeps appropriately when no devices are inserted, and verify ports go to PD_DISCOVERY state when we attach samus. Also verify that glados / glados_pd can still negotiate PD. BRANCH=None Change-Id: Iae6c4e1ef4d6685cb5bf7feef713505925a07c8c Signed-off-by: Shawn Nematbakhsh Reviewed-on: https://chromium-review.googlesource.com/313209 Commit-Ready: Shawn N Tested-by: Shawn N Reviewed-by: Alec Berg --- include/usb_pd_tcpm.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/usb_pd_tcpm.h') diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h index 6b1180cafd..4e1b04249e 100644 --- a/include/usb_pd_tcpm.h +++ b/include/usb_pd_tcpm.h @@ -56,6 +56,14 @@ struct tcpc_config_t { */ }; +/** + * Returns the PD_STATUS_TCPC_ALERT_* mask corresponding to the TCPC ports + * that are currently asserting ALERT. + * + * @return PD_STATUS_TCPC_ALERT_* mask. + */ +uint16_t tcpc_get_alert_status(void); + /** * Initialize TCPM driver and wait for TCPC readiness. * -- cgit v1.2.1