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 <vpalatin@chromium.org>

BRANCH=none
BUG=none
TEST=make buildall

Change-Id: Ia6f89f592632520b46478a7d7975e9e8d3a28b59
Reviewed-on: https://chromium-review.googlesource.com/202391
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Vincent Palatin
2014-06-02 14:14:35 -07:00
committed by chrome-internal-fetch
parent e6755ca4ac
commit bbee5e137e

View File

@@ -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)