summaryrefslogtreecommitdiff
path: root/common/usb_pd_protocol.c
diff options
context:
space:
mode:
authorAyushee <ayushee.shah@intel.com>2020-05-14 13:29:46 -0700
committerCommit Bot <commit-bot@chromium.org>2020-06-05 10:15:41 +0000
commit10a645d18be5ba77a11ba0a3743b0fe7e81c7a25 (patch)
treed07318bc76c8813032bb96c48a764f56711d6378 /common/usb_pd_protocol.c
parent5fceb8b92e1fc492036d57d1d0f9df81c6c3e2ff (diff)
downloadchrome-ec-10a645d18be5ba77a11ba0a3743b0fe7e81c7a25.tar.gz
usb_pd: Move USB4 functions to common file
Added a check for CONFIG_USB_PD_ALT_MODE_DFP in pd_send_enter_usb() and added separate configs for USB4 DRD and USB3.2 DRD BUG=b:148528713 BRANCH=none TEST=Able to enter USB4 mode with following passive cables - a. Rev 3 USB3.2 Gen 1, USB3.2 Gen 2 and USB4 Gen 3 b. Rev 2 USB3.1 Gen1/Gen2 Change-Id: I80c9b7569429bc54db08d78b5a6eee16780d6fe1 Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2051631 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Diffstat (limited to 'common/usb_pd_protocol.c')
-rw-r--r--common/usb_pd_protocol.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 81f796c246..032e559199 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -2810,7 +2810,7 @@ void pd_interrupt_handler_task(void *p)
static void pd_send_enter_usb(int port, int *timeout)
{
- uint32_t usb4_payload = get_enter_usb_msg_payload(port);
+ uint32_t usb4_payload;
uint16_t header;
int res;
@@ -2818,9 +2818,13 @@ static void pd_send_enter_usb(int port, int *timeout)
* TODO: Enable Enter USB for cables (SOP').
* This is needed for active cables
*/
- if (!IS_ENABLED(CONFIG_USBC_SS_MUX) || !IS_ENABLED(CONFIG_USB_PD_USB4))
+ if (!IS_ENABLED(CONFIG_USBC_SS_MUX) ||
+ !IS_ENABLED(CONFIG_USB_PD_USB4) ||
+ !IS_ENABLED(CONFIG_USB_PD_ALT_MODE_DFP))
return;
+ usb4_payload = get_enter_usb_msg_payload(port);
+
header = PD_HEADER(PD_DATA_ENTER_USB,
pd[port].power_role,
pd[port].data_role,