summaryrefslogtreecommitdiff
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 06:45:58 +0000
commite4f3a69ffce71f81dccac6b40e8314681af98b46 (patch)
treed84bf6b752bd0555d4ff13c423ac13e6307afc0a
parent86b52c3f6f4a916ba069f22650a5898ad848b858 (diff)
downloadchrome-ec-e4f3a69ffce71f81dccac6b40e8314681af98b46.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> (cherry picked from commit 8b5963199b0a7da1274b8ce6296745e01ebba079) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2644792 Auto-Submit: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com>
-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 e054ba5c57..52d7391974 100644
--- a/driver/bc12/max14637.c
+++ b/driver/bc12/max14637.c
@@ -140,6 +140,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);