EC: Most cros-ec devices don't charge from dual role ports without the Unconstrained Power/Externally Powered bit set by default. |
|||
Issue descriptionIt seems that most cros-ec devices don't charge from dual role ports by default. The case that I saw was a battery pack that speaks PD which had a single Type-C port which you could either charge the battery or supply power from. The battery pack has a button on it that switches the roles. I was testing on a kevin, but I saw this behaviour on caroline as well. I wrote a script to parse the src caps. When the battery pack switches to a source, these three caps are sent. aaboagye@lithium:~$ ~/scripts/caps.py 0x2601912c 0x0002d12c 0x0003c0f0 0x2601912c Fixed Supply DRP USB comms capable DR data Peak cur: 0mA 5000 mV max cur: 3000mA -------------------------------------------------------------------------------- 0x2d12c Fixed Supply Peak cur: 0mA 9000 mV max cur: 3000mA -------------------------------------------------------------------------------- 0x3c0f0 Fixed Supply Peak cur: 0mA 12000 mV max cur: 2400mA # We end up picking the vSafe5V cap and transition to SNK_READY state, but we don't charge from the port. The src caps are sent again with a couple additional ones. aaboagye@lithium:~$ ~/scripts/caps.py 0x0004b0d2 0x64096 0x26019005 0x4b0d2 Fixed Supply Peak cur: 0mA 15000 mV max cur: 2100mA -------------------------------------------------------------------------------- 0x64096 Fixed Supply Peak cur: 0mA 20000 mV max cur: 1500mA -------------------------------------------------------------------------------- # Again, we request the vSafe5V cap, transition to SNK_READY, but still don't charge. Then the battery sends us one last cap. 0x26019005 Fixed Supply DRP USB comms capable DR data Peak cur: 0mA 5000 mV max cur: 50mA We report a mismatch and just remain in this not charging state indefinitely. I believe the reason we end up not charging is because charge manager rejects this port because it's not a dedicated charger. (I think the externally powered bit isn't set in the src caps) See: https://chromium.googlesource.com/chromiumos/platform/ec/+/ba4a67558ae76c1fe3b864eb18a5c6da6fbba666/common/charge_manager.c#472. As a test, I tried using the chgoverride command to force charging from the port and it worked just fine. I also tried defining CONFIG_CHARGE_MANAGER_DRP_CHARGING and that worked as well.
,
Jul 17 2017
I have this RAVPower battery pack, and I talked to Aseda about this in the microkitchen. The issue with it is that it's not setting the Externaly Powered (now Unconstrained Power) bit, so our policy is not to charge from it by default. I would bet that it would work if you go to the chrome://power settings and select it explicitly. I have this Anker battery pack, which does correctly set that bit, and it charges reliable when I plug it into our Chromebooks: https://bugs.chromium.org/p/chromium/issues/detail?id=744673#c1
,
Jul 17 2017
Thanks, that sounds right. "The Unconstrained Power bit Shall be set ... when the device’s primary function is to charge external devices." - That sounds like the primary function of this device.
,
Jul 17 2017
Here's the Anker DRP power bank that does set the bit, that Chromebooks charge from by default: https://www.amazon.com/dp/B01MZ61PRW
,
Jul 18 2017
Thanks for the explanation. Updating summary to more accurately reflect the issue. Closing as is working as intended. |
|||
►
Sign in to add a comment |
|||
Comment 1 by sha...@chromium.org
, Jul 17 2017