From bbee5e137ee44e7bca9fa0cc8cc4ed16b068071f Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Mon, 2 Jun 2014 14:14:35 -0700 Subject: pd: set BMC bit In the current version of USB-PD standard, the packet header should have bit 15 set to 1 to tell the other side that we are supporting Biphase Mark Coding (aka BMC). For now, just set it, do not check it as most of our devices are setting it yet. Signed-off-by: Vincent Palatin BRANCH=none BUG=none TEST=make buildall Change-Id: Ia6f89f592632520b46478a7d7975e9e8d3a28b59 Reviewed-on: https://chromium-review.googlesource.com/202391 Reviewed-by: Alec Berg Commit-Queue: Vincent Palatin Tested-by: Vincent Palatin --- common/usb_pd_protocol.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 00f072e253..c42ed176a2 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -60,6 +60,9 @@ enum { /* Protocol revision */ #define PD_REV10 0 +/* BMC-supported bit : we are using the baseband variant of the protocol */ +#define PD_BMC_SUPPORTED (1 << 15) + /* Port role */ #define PD_ROLE_SINK 0 #define PD_ROLE_SOURCE 1 @@ -67,7 +70,8 @@ enum { /* build message header */ #define PD_HEADER(type, role, id, cnt) \ ((type) | (PD_REV10 << 6) | \ - ((role) << 8) | ((id) << 9) | ((cnt) << 12)) + ((role) << 8) | ((id) << 9) | ((cnt) << 12) | \ + PD_BMC_SUPPORTED) #define PD_HEADER_CNT(header) (((header) >> 12) & 7) #define PD_HEADER_TYPE(header) ((header) & 0xF) -- cgit v1.2.1