summaryrefslogtreecommitdiff
path: root/driver/bc12
diff options
context:
space:
mode:
authoryu-an.chen <yu-an.chen@quanta.corp-partner.google.com>2021-01-13 13:39:59 +0800
committerCommit Bot <commit-bot@chromium.org>2021-01-25 05:33:57 +0000
commit8b5963199b0a7da1274b8ce6296745e01ebba079 (patch)
treeb436e490c7da041f588750eac991676c68a9ddb5 /driver/bc12
parent7ac3b8771f961d0e9bda31e68f37ad7b0ca9af6c (diff)
downloadchrome-ec-8b5963199b0a7da1274b8ce6296745e01ebba079.tar.gz
max14637: Switch should not be kept open when PD adapter is disconnected
Root Cause: D+ and D- of PD adapter are shorted so chip would detect PD adapter as the DCP. As a result, chip would set USB 2 switch open based on product spec. Later on once USB 2.0 storage is attached, DUT can't recognize it because USB 2.0 data path is blocked by chip now before introducing this CL. Solution: Whenever adapter or USB client device is disconnected from a port of DUT, we re-trigger the bc12_detect() so chip will be off then on for detecting the status again. In this case, the D+/D- are NC so chip will detect it as the SDP and keep this status afterward. When USB 2.0 storage is connected later, bc12_detect will not be called again due to DUT is in source role. At this moment, USB switch is closed so USB 2.0 path is good. And there is no BC12 detecting cycle happened so we will not hit issue resolved in CL:*2364342 as well. When adapter is connected again, bc12_detect will be triggered for detecting DCP / SDP / CDP. BUG=b:177265749 BRANCH=octopus TEST=make buildall -j 8 TEST=check lsblk , usb2 device is exist after reproduce step Signed-off-by: yu-an.chen@quanta.corp-partner.google.com Change-Id: I769e9f97daf86992259d8da0bbb38a1068bd8a5a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2626791 Tested-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Reviewed-by: Marco Chen <marcochen@chromium.org> Commit-Queue: Marco Chen <marcochen@chromium.org>
Diffstat (limited to 'driver/bc12')
-rw-r--r--driver/bc12/max14637.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/driver/bc12/max14637.c b/driver/bc12/max14637.c
index de0971132d..a2bbfd4fb7 100644
--- a/driver/bc12/max14637.c
+++ b/driver/bc12/max14637.c
@@ -144,6 +144,7 @@ static void detect_or_power_down_ic(const int port)
} else {
/* Let charge manager know there's no more charge available. */
charge_manager_update_charge(CHARGE_SUPPLIER_OTHER, port, NULL);
+ bc12_detect(port);
#if defined(CONFIG_POWER_PP5000_CONTROL) && defined(HAS_TASK_CHIPSET)
/* Issue a request to turn off the rail. */
power_5v_enable(task_get_current(), 0);