summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYilun Lin <yllin@google.com>2019-05-27 17:46:50 +0800
committerCommit Bot <commit-bot@chromium.org>2019-06-17 04:57:56 +0000
commit205c777b9f74667a6580d4c4d232417b92637eca (patch)
treedb8502fc4dba9a7a4eea85c0df167ec652e3adad /include
parent35afaa622676de0b72b727e9ed602bf0820934e7 (diff)
downloadchrome-ec-205c777b9f74667a6580d4c4d232417b92637eca.tar.gz
krane: Enable BC12 detection with gpio controlled.
Support CONFIG_BC12_DETECT_POWER_ROLE_TRIGGER. Krane's BC12 detection is controlled by GPIO_BC12_DET_EN by disconnecting USB-PHY, that is: - Assert GPIO_BC12_DET_EN, then USB-PHY is disconnected - Deassert GPIO_BC12_DET_EN, then USB-PHY is connected. The current usb_chg_task will make USB devices not be enumerated, since GPIO_BC12_DET_EN is deasserted only when VBUS attached and BC12 device identified. However, peripherals won't trigger BC12 detection so GPIO_BC12_DET_EN always asserted. To fix this problem, we trigger BC12 detection only when a port is attached and hook USB_PD_CONNECTED to toggle BC12 detection. We have to - Assert GPIO_BC12_DET_EN on SRC device plugged to recognize BC12 charger. - After BC12 device detected, we have to disable BC12 to connect USB-PHY back for enumerating USB devices. - Deassert GPIO_BC12_DET_EN on SNK device plugged to enumerate USB devices. TEST=Test with https://crrev.com/c/1408751/1, and see it is able to recognize Apple 2.4A charger and 5V2A DCP charger. TEST=Boot w/ USB hub plugged (w/ and w/o external BC1.2 charger on the hub) and see USB devices are enumerated. BUG=b:122866184 BRANCH=None Change-Id: I5b3362305361c0c950288fc83072e9bc79082c08 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1575050 Tested-by: Yilun Lin <yllin@chromium.org> Auto-Submit: Yilun Lin <yllin@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Yilun Lin <yllin@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/config.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h
index 15482a9687..08b9977dbf 100644
--- a/include/config.h
+++ b/include/config.h
@@ -776,6 +776,14 @@
#undef CONFIG_CHARGER_MT6370_BACKLIGHT
/*
+ * MT6370 BC1.2 USB-PHY control.
+ * If defined, USB-PHY connection is controlled by GPIO_BC12_DET_EN.
+ * Assert GPIO_BC12_DET_EN to detect BC1.2 device, and deassert
+ * GPIO_BC12_DET_EN to mux USB-PHY back.
+ */
+#undef CONFIG_CHARGER_MT6370_BC12_GPIO
+
+/*
* Enable/disable system power monitor PSYS function: this enables output
* from charger chip to SoC.
*/