diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2018-06-28 13:14:09 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-07-13 21:02:47 -0700 |
commit | 069693acfb7fed4bd2035af81658daa1d4505ecd (patch) | |
tree | 237b872abcb3f0115c30e8d8fd5652bf79900447 | |
parent | d539328b3fc5d29afe591001ce78cc3a97682be8 (diff) | |
download | chrome-ec-069693acfb7fed4bd2035af81658daa1d4505ecd.tar.gz |
USB-PD: Advertise high current Rp after Vconn is applied
When a device such as HDMI dongle which has Ra/Rd is connected to a CCD
port, CC1 and CC2 voltages fall in the CCD range if we advertise 3A
(Rp=4.7kohm).
This patch makes TCPM first advertise default USB current, 900mA
(Rp=56kohm), then advertise 3A (or whatever the higher current the
board defines) after a sink device is attached and Vconn is turned on.
Once Vconn is turned on, CCx voltage will be out of the CCD range.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=b:110283597
BRANCH=none
TEST=Verify picture is shown on HP Z27n via Analogix port of Vayne when:
1. HDMI cable and Dingdong are connected first then DUT is connected
2. Dingdong and DUT are connected first then HDMI cable is connected
Repeat 1 and 2 with Parade (non-CCD) port connected to a charger.
Change-Id: I2131268abf7ea6414b8277f924e4cd48f6a98800
Reviewed-on: https://chromium-review.googlesource.com/1121339
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r-- | common/usb_pd_protocol.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index aba957c77f..42742888a2 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -452,16 +452,18 @@ static inline void set_state(int port, enum pd_states next_state) */ if (pd[port].power_role == PD_ROLE_SOURCE) { /* - * Rp is restored by pd_power_supply_reset if - * CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT is defined. + * If CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT is + * defined, Rp is reset as follows. + * If all ports are open, pd_power_supply_reset will + * change Rp to 3A for all ports. If the other port is + * occupied, it'll be given 3A and this port will be + * given 1.5A. + * In either case, this port is immediately reset to + * 1.5A by tcpm_select_rp_value. */ pd_power_supply_reset(port); -#if !defined(CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT) && \ - defined(CONFIG_USB_PD_REV30) - /* Restore Rp */ tcpm_select_rp_value(port, CONFIG_USB_PD_PULLUP); tcpm_set_cc(port, TYPEC_CC_RP); -#endif } #ifdef CONFIG_USB_PD_REV30 /* Adjust rev to highest level*/ @@ -2278,12 +2280,7 @@ void pd_task(void *u) /* Initialize PD protocol state variables for each port. */ pd[port].vdm_state = VDM_STATE_DONE; set_state(port, this_state); -#ifdef CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT - ASSERT(PD_ROLE_DEFAULT(port) == PD_ROLE_SINK); - tcpm_select_rp_value(port, CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT); -#else tcpm_select_rp_value(port, CONFIG_USB_PD_PULLUP); -#endif #ifdef CONFIG_USB_PD_DUAL_ROLE /* * If we're not in an explicit contract, set our terminations to match |