mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-12 19:04:59 +00:00
PD: Leave Vbus ON if Vconn and Vbus Requested is set to 0 in the AMA VDO
While troubleshooting why a generic $19.99 Multiport (USB, HDMI, Type-C) Type-C dongle didn't work on Scarlet, I noticed that Vconn Req and Vbus Req were both set to zero in the AMA VDO. For a better user experience, default to Vbus ON if both Vconn and Vbus Req are both zero. BUG=b:78286905 BRANCH=NONE TEST=manual Tested the generic dongle with USB-Keyboard, TypeC power adapter, and HP monitor. Change-Id: I170eef1372c3621334de2c457bd4533eea744cc0 Signed-off-by: Sam Hurst <shurst@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1019611 Commit-Ready: Sam Hurst <shurst@google.com> Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
@@ -294,16 +294,16 @@ static void dfp_consume_identity(int port, int cnt, uint32_t *payload)
|
||||
memcpy(&pe[port].identity, payload + 1, identity_size);
|
||||
switch (ptype) {
|
||||
case IDH_PTYPE_AMA:
|
||||
/* TODO(tbroch) do I disable VBUS here if power contract
|
||||
* requested it
|
||||
*/
|
||||
if (!PD_VDO_AMA_VBUS_REQ(payload[VDO_I(AMA)]))
|
||||
pd_power_supply_reset(port);
|
||||
|
||||
/* Leave vbus ON if the following macro is false */
|
||||
#if defined(CONFIG_USB_PD_DUAL_ROLE) && defined(CONFIG_USBC_VCONN_SWAP)
|
||||
/* Adapter is requesting vconn, try to supply it */
|
||||
if (PD_VDO_AMA_VCONN_REQ(payload[VDO_I(AMA)]))
|
||||
pd_try_vconn_src(port);
|
||||
|
||||
/* Only disable vbus if vconn was requested */
|
||||
if (PD_VDO_AMA_VCONN_REQ(payload[VDO_I(AMA)]) &&
|
||||
!PD_VDO_AMA_VBUS_REQ(payload[VDO_I(AMA)]))
|
||||
pd_power_supply_reset(port);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user