summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-01-07 12:49:07 -0700
committerCommit Bot <commit-bot@chromium.org>2021-01-09 05:11:05 +0000
commit195d2d925def5f98e088b8b5ee2b1d61e3dc7040 (patch)
treea15a55a995a25bc864e462c2796056d523a77526
parentf366e0c5db6621684dd042a104d83162731cba04 (diff)
downloadchrome-ec-195d2d925def5f98e088b8b5ee2b1d61e3dc7040.tar.gz
zephyr: Enable the pi3usb9201
Enable this driver and USB charging. So far this builds but does not work. BUG=b:175434113 BRANCH=none TEST=make BOARD=volteer -j30 build volteer on zephyr Change-Id: I3dd15d70a720f32d7ed31f26aafe522ff1f560f0 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2615621 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--zephyr/CMakeLists.txt2
-rw-r--r--zephyr/Kconfig.usbc18
-rw-r--r--zephyr/shim/include/config_chip.h10
3 files changed, 28 insertions, 2 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt
index 147375f0dc..f199cc9132 100644
--- a/zephyr/CMakeLists.txt
+++ b/zephyr/CMakeLists.txt
@@ -53,6 +53,8 @@ zephyr_sources_ifdef(CONFIG_PLATFORM_EC_BATTERY_FUEL_GAUGE
"${PLATFORM_EC}/common/battery_fuel_gauge.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_BATTERY_SMART
"${PLATFORM_EC}/driver/battery/smart.c")
+zephyr_sources_ifdef(CONFIG_PLATFORM_EC_BC12_DETECT_PI3USB9201
+ "${PLATFORM_EC}/driver/bc12/pi3usb9201.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER_ISL9241
"${PLATFORM_EC}/driver/charger/isl9241.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CHARGE_MANAGER
diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc
index 410156e2e3..05340c4dcf 100644
--- a/zephyr/Kconfig.usbc
+++ b/zephyr/Kconfig.usbc
@@ -426,12 +426,26 @@ endif # PLATFORM_EC_USBC_PPC
config PLATFORM_EC_USB_CHARGER
bool "Support charging from a USB-C port"
- # default y (next CL, once we can compile the code)
- # select HAS_TASK_USB_CHG_P0 (next CL, once we can compile the code)
+ default y
+ select HAS_TASK_USB_CHG_P0
help
This enables common BC1.2 (Battery-Charging Specification Rev1.2)
charger-detection routines. With this is possible to negotiate a
power contract with an attached battery charger and use this to
charge the device's battery.
+if PLATFORM_EC_USB_CHARGER
+
+config PLATFORM_EC_BC12_DETECT_PI3USB9201
+ bool "Enable support for Pericom PI3USB9201"
+ help
+ This is a Dual-Role USB Charging-Type Detector. It can operate in
+ host or client mode. It supports Battery Charging Specification, rev
+ 1.2 (BC1.2) with Standard/Charging/Dedicated downstream port
+ (SDP/CDP/DCP) advertisement when in host mode. In client mode it
+ starts BC1.2 detection to detect the attached host type. It provides
+ an I2C interface to report detection results.
+
+endif # PLATFORM_EC_USB_CHARGER
+
endif # PLATFORM_EC_USBC
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index bdede518a3..0a07b87640 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -283,6 +283,16 @@ enum battery_type {
#define CONFIG_USB_PD_VBUS_MEASURE_ADC_EACH_PORT
#endif /* VBUS-voltage measurement */
+#undef CONFIG_USB_CHARGER
+#ifdef CONFIG_PLATFORM_EC_USB_CHARGER
+#define CONFIG_USB_CHARGER
+#endif
+
+#undef CONFIG_BC12_DETECT_PI3USB9201
+#ifdef CONFIG_PLATFORM_EC_BC12_DETECT_PI3USB9201
+#define CONFIG_BC12_DETECT_PI3USB9201
+#endif
+
#undef CONFIG_EC_USB_PD_DUAL_ROLE
#ifdef CONFIG_PLATFORM_EC_USB_PD_DUAL_ROLE
#define CONFIG_EC_USB_PD_DUAL_ROLE