mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 02:35:28 +00:00
8e29d9c2e80688e9ebfa8358d2c01ecff261bc92
Add support for toggling between source and sink as dual-role port. When transitioning to S0, we turn toggling on, when transitioning to S3, we turn toggling off but remain in the same PD state, and when transitioning to S5, we turn toggling off and force the PD role to a sink. Note, when toggling is off, the source disconnected state is allowed to transition to sink disconnected, but not vice versa. This means that if you go into S3 as a source, it will remain a source until the device is unplugged, at which point it will transition to a sink until the next transition to S0. The spec specifies: tDRP: 50ms - 100ms, Period a DRP shall complete a DFP to UFP and back dcDRP: 30% - 70%, Percent of time that a DRP shall advertise DFP tDRPHold: 100ms - 150ms, time to hold VBUS on after a DRP detects a UFP tDRPLock: 100ms - 150ms, time to stay in DFP after detecting loss of UFP This CL uses 40ms for time as a UFP (sink), 30ms for time as a DFP (source), and 120ms for hold and lock times. Also, if advertising as a DFP (source) and VBUS is detected, this automatically switches to a UFP (sink). BUG=chrome-os-partner:28782 BRANCH=none TEST=test on samus, make sure we are toggling between source and sink when disconnected. make sure plugging in zinger switches state machine through to sink_ready and make sure plugging in a USB switches to source_discovery. tested on a fruitpie by scoping the CC line and verifying the timing (except the hold time which I can't easily test). tested that dual role toggling is off in s3 and s5. also verified that going into s3 as a source keeps the port as a source and going into s5 switches it to a sink. Change-Id: I478634861f694164301d71359da35142ee7ebf75 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/207154 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
For an overview of the Embedded Controller firmware, refer to http://www.chromium.org/chromium-os/2014-firmware-summit
Description
Languages
C
64.7%
Lasso
20.7%
ASL
3.6%
JavaScript
3.2%
C#
2.9%
Other
4.6%