diff options
author | Todd Broch <tbroch@chromium.org> | 2014-10-28 18:04:01 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-31 06:29:34 +0000 |
commit | ce9ae08b6889e7d7032ba66821e4c73dae20fb78 (patch) | |
tree | f4d37db7152bab2ba549a0805e237bdb5a97f2cf /board/dingdong | |
parent | aac88442d7bbc76ec5116fdb3019af09cc522938 (diff) | |
download | chrome-ec-ce9ae08b6889e7d7032ba66821e4c73dae20fb78.tar.gz |
pd: dingdong/hoho: Include product VDO in discovery identity.
Per table 6-24 of USB PD spec an alternate mode adapter (AMA) should
include both product & AMA VDOs.
BRANCH=samus
BUG=chrome-os-partner:31192,chrome-os-partner:31193
TEST=manual,
Connect hoho/dingdong to fpie/samus and see product VDO proceed the
AMA VDO in DFP_U console output:
Product VDO -----------------------------v
|------|
SVDM/5 [1] ff008041 340018d1 00000000 50100001 1100000b
Note, hoho's PID == 0x5010
And dingdong (0x5011)
SVDM/5 [1] ff008041 340018d1 00000000 50110001 1100000b
Also see bcdDevice field in descriptor match above data.
$ lsusb -v -d 18d1: | egrep -i "idproduct|bcddev"
idProduct 0x5011
bcdDevice 0.01
Change-Id: I4d898816a45c68c7ff75a54fd348fc11be408ae0
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/226125
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/dingdong')
-rw-r--r-- | board/dingdong/board.h | 1 | ||||
-rw-r--r-- | board/dingdong/usb_pd_policy.c | 12 |
2 files changed, 9 insertions, 4 deletions
diff --git a/board/dingdong/board.h b/board/dingdong/board.h index 814df199bc..de68de93e8 100644 --- a/board/dingdong/board.h +++ b/board/dingdong/board.h @@ -35,6 +35,7 @@ /* USB configuration */ #define CONFIG_USB_PID 0x5011 +#define CONFIG_USB_BCD_DEV 0x0001 /* v 0.01 */ /* * Allow dangerous commands all the time, since we don't have a write protect diff --git a/board/dingdong/usb_pd_policy.c b/board/dingdong/usb_pd_policy.c index 5894427ca8..d531f7428b 100644 --- a/board/dingdong/usb_pd_policy.c +++ b/board/dingdong/usb_pd_policy.c @@ -14,6 +14,7 @@ #include "timer.h" #include "util.h" #include "usb.h" +#include "usb_bb.h" #include "usb_pd.h" #include "version.h" @@ -105,6 +106,8 @@ const uint32_t vdo_idh = VDO_IDH(0, /* data caps as USB host */ 1, /* supports alt modes */ USB_VID_GOOGLE); +const uint32_t vdo_product = VDO_PRODUCT(CONFIG_USB_PID, CONFIG_USB_BCD_DEV); + const uint32_t vdo_ama = VDO_AMA(CONFIG_USB_PD_IDENTITY_HW_VERS, CONFIG_USB_PD_IDENTITY_SW_VERS, 0, 0, 0, 0, /* SS[TR][12] */ @@ -118,8 +121,9 @@ static int svdm_response_identity(int port, uint32_t *payload) payload[VDO_I(IDH)] = vdo_idh; /* TODO(tbroch): Do we plan to obtain TID (test ID) for hoho */ payload[VDO_I(CSTAT)] = VDO_CSTAT(0); + payload[VDO_I(PRODUCT)] = vdo_product; payload[VDO_I(AMA)] = vdo_ama; - return 4; + return VDO_I(AMA) + 1; } static int svdm_response_svids(int port, uint32_t *payload) @@ -128,9 +132,9 @@ static int svdm_response_svids(int port, uint32_t *payload) return 2; } -/* Will only ever be a single mode for this UFP_D device as it has no USB - * support (2.0 or 3.0) making it only PIN_E configureable nor does it have any - * source functionality. +/* + * Will only ever be a single mode for this UFP_D device as it has no real USB + * support making it only PIN_E configureable */ #define MODE_CNT 1 #define OPOS 1 |