summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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