diff options
author | Todd Broch <tbroch@chromium.org> | 2015-01-16 12:40:15 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-01-28 11:13:58 +0000 |
commit | 17f68998fbac95976c271e7403ffffc6f9f1aeaf (patch) | |
tree | 37c7132aced900be55868b5df1ef4b0dd2c13242 /include/ec_commands.h | |
parent | 89479d1fc22d17721f0ab7b9547f20054c870da3 (diff) | |
download | chrome-ec-17f68998fbac95976c271e7403ffffc6f9f1aeaf.tar.gz |
pd: Allow multiple mode entry.
Current simplified implementation allows single mode entry. Specification
allows multiple mode entry and its advantageous for things like flashing RW
while staying in DisplayPort mode on video dongles.
CL adds capability on DFP to track as many alternate modes as supported by the
DFP. Initial mode entered is still the default supported mode ( 1st entry, 1st
opos). Policy manager can then use host command, EC_CMD_USB_PD_SET_AMODE, to
enter additional supported modes.
On the UFP (hoho, dingdong) a small modification to track multiple svid mode
entries was made.
Signed-off-by: Todd Broch <tbroch@chromium.org>
BRANCH=samus
BUG=chrome-os-partner:33946
TEST=manual, On hoho
1. Still successfully enter default mode DP
2. Using ectool's pdsetmode can successfully enter/exit multiple modes.
For example,
# port:1 svid:18d1 opos:1 cmd:1==enter
ectool --name cros_pd pdsetmode 1 0x18d1 1 1
Checking with pdgetmode shows both modes entered.
3. Works across hard & soft resets
4. Can flash via ectool --name cros_pd flashpd 4 <port> <RW image>
5. Still drives external display. With bootarg drm.debug=0x6 and following
command: 'tail -f /var/log/messages | grep "Received HPD" &'
I see HPD assert & deassert when switching between GFU and DP mode.
If both modes entered screen stays lit (after reboot) during write.
Change-Id: I7a21ebea377402eb1b0a0cf1d29df59694e301b1
Reviewed-on: https://chromium-review.googlesource.com/241790
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Diffstat (limited to 'include/ec_commands.h')
-rw-r--r-- | include/ec_commands.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index 926e317eee..58a698fb8d 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -2929,16 +2929,23 @@ struct ec_params_usb_pd_get_mode_request { struct ec_params_usb_pd_get_mode_response { uint16_t svid; /* SVID */ - uint8_t active; /* Active SVID */ - uint8_t opos; /* Object Position */ + uint16_t opos; /* Object Position */ uint32_t vdo[6]; /* Mode VDOs */ } __packed; #define EC_CMD_USB_PD_SET_AMODE 0x117 + +enum pd_mode_cmd { + PD_EXIT_MODE = 0, + PD_ENTER_MODE = 1, + /* Not a command. Do NOT remove. */ + PD_MODE_CMD_COUNT, +}; + struct ec_params_usb_pd_set_mode_request { - int opos; /* Object Position */ - int svid_idx; /* Index of svid to get */ + uint32_t cmd; /* enum pd_mode_cmd */ uint16_t svid; /* SVID to set */ + uint8_t opos; /* Object Position */ uint8_t port; /* port */ } __packed; |