diff options
author | Todd Broch <tbroch@chromium.org> | 2014-11-20 17:24:27 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-01-16 07:16:13 +0000 |
commit | abecc13a87fe445bb52194bc105cd70093bc8739 (patch) | |
tree | e78eaa663ef779694ef0551b6f400f90467c7c05 /include | |
parent | 16655133eeb1c77fafa2bc19a064c5b07e74aadc (diff) | |
download | chrome-ec-abecc13a87fe445bb52194bc105cd70093bc8739.tar.gz |
Add USB-PD mode commands.
These commands (pdgetmode & pdsetmode) will provide host with ability
to identify USB-PD alternate mode devices SVIDs and supported modes.
It will also allow host to set mode on devices which support multiple
alternate modes.
Signed-off-by: Todd Broch <tbroch@chromium.org>
BRANCH=samus
BUG=chrome-os-partner:33946
TEST=manual
Plug hoho/dingdong into samus at port <port>
ectool --name cros_pd pdgetmode <port>
*SVID:0xff01 *0x00001085 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
SVID:0x18d1 0x00000001 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
ectool --name cros_pd pdsetmode <port> 0x18d1 1
ectool --name cros_pd pdgetmode <port>
SVID:0xff01 0x00001085 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
*SVID:0x18d1 *0x00000001 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
ectool --name cros_pd infopddev <port>
Port:1 DevId:4.1 Hash: 0x042cc79c 0x30cc12e3 0xe27a36e5 0x3f7eba5f 0x053c91d1
Port:1 ptype:5 vid:0x18d1 pid:0x5010
Also from samus_pd console see proper result for 'typec <port>'
typec 1
Port C1: CC1 178 mV CC2 427 mV (polarity:CC2)
No Superspeed connection
Also visually inspect packets via twinkie.
Change-Id: I4e442bcb39ec1ff3cb6efff196a660819077ad76
Reviewed-on: https://chromium-review.googlesource.com/231834
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/ec_commands.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index 357c1de432..1c4efdfdcc 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -2920,6 +2920,28 @@ struct ec_response_pd_log { #define PS_FAULT_OVP 3 #define PS_FAULT_DISCH 4 +/* Get/Set USB-PD Alternate mode info */ +#define EC_CMD_USB_PD_GET_AMODE 0x116 +struct ec_params_usb_pd_get_mode_request { + uint16_t svid_idx; /* SVID index to get */ + uint8_t port; /* port */ +} __packed; + +struct ec_params_usb_pd_get_mode_response { + uint16_t svid; /* SVID */ + uint8_t active; /* Active SVID */ + uint8_t idx; /* Index of active mode VDO. Ignored if !active */ + uint32_t vdo[6]; /* Mode VDOs */ +} __packed; + +#define EC_CMD_USB_PD_SET_AMODE 0x117 +struct ec_params_usb_pd_set_mode_request { + int opos; /* Object Position */ + int svid_idx; /* Index of svid to get */ + uint16_t svid; /* SVID to set */ + uint8_t port; /* port */ +} __packed; + #endif /* !__ACPI__ */ /*****************************************************************************/ |