diff options
author | Simon Glass <sjg@chromium.org> | 2021-06-04 16:03:24 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-15 18:38:09 +0000 |
commit | f12b493bcad389e5c0cadcf6e84bf75524b95ba5 (patch) | |
tree | 4fee311473691deacdbb4beb3f112818c9f62e80 | |
parent | a4aa3cda0454537ec6b9d21db864631ef16a8fbb (diff) | |
download | chrome-ec-f12b493bcad389e5c0cadcf6e84bf75524b95ba5.tar.gz |
zephyr: Add support for the MT6360
Add a Kconfig for this driver so it can be used from zephyr.
BUG=b:189855648
BRANCH=none
TEST=with other CLs, build asurada for Zephyr
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I14434a52388b21d2f4200cea50c326ffb2788abe
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941884
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
-rw-r--r-- | zephyr/CMakeLists.txt | 2 | ||||
-rw-r--r-- | zephyr/Kconfig.usbc | 17 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 10 |
3 files changed, 29 insertions, 0 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 78f33d1f4f..a5a1a0097b 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -164,6 +164,8 @@ zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_BATTERY_SMART "${PLATFORM_EC}/driver/battery/smart.c") zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_BC12_DETECT_PI3USB9201 "${PLATFORM_EC}/driver/bc12/pi3usb9201.c") +zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_BC12_DETECT_MT6360 + "${PLATFORM_EC}/driver/bc12/mt6360.c") zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER_ISL9237 "${PLATFORM_EC}/driver/charger/isl923x.c") zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER_ISL9238 diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc index 1b4933c005..8d2cf31294 100644 --- a/zephyr/Kconfig.usbc +++ b/zephyr/Kconfig.usbc @@ -1071,6 +1071,23 @@ config PLATFORM_EC_BC12_DETECT_PI3USB9201 starts BC1.2 detection to detect the attached host type. It provides an I2C interface to report detection results. +config PLATFORM_EC_BC12_DETECT_MT6360 + bool "MediaTek MT6360P PMIC" + help + This PMIC includes a battery charger with an On-The-Go (OTG) output + range of 4.85 to 5.825V. It provides integrated ADCs for system + monitoring. The MT6360 also supports USB Power Delivery 3.0 with + Dual-Role, with host or client mode. It supports alternate mode as + well as VCONN with programmable over-current protection (OCP). + +config PLATFORM_EC_MT6360_BC12_GPIO + bool "USB-PHY connection is controlled by a GPIO" + depends on PLATFORM_EC_BC12_DETECT_MT6360 + help + If enabled, the MT6360 USB-PHY connection is controlled by + a GPIO: GPIO_BC12_DET_EN. Assert GPIO_BC12_DET_EN to detect a BC1.2 + device, and deassert GPIO_BC12_DET_EN to mux the USB-PHY back. + config PLATFORM_EC_BC12_SINGLE_DRIVER bool "Only support a single BC12 driver" default y diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index b67579b6c7..0f58ef68f7 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -756,6 +756,16 @@ #define CONFIG_BC12_DETECT_PI3USB9201 #endif +#undef CONFIG_BC12_DETECT_MT6360 +#ifdef CONFIG_PLATFORM_EC_BC12_DETECT_MT6360 +#define CONFIG_BC12_DETECT_MT6360 +#endif + +#undef CONFIG_MT6360_BC12_GPIO +#ifdef CONFIG_PLATFORM_EC_MT6360_BC12_GPIO +#define CONFIG_MT6360_BC12_GPIO +#endif + #undef CONFIG_USB_PD_DUAL_ROLE #ifdef CONFIG_PLATFORM_EC_USB_PD_DUAL_ROLE #define CONFIG_USB_PD_DUAL_ROLE |