summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-03-18 10:43:13 -0600
committerCommit Bot <commit-bot@chromium.org>2021-03-22 07:32:44 +0000
commitb46071331a2b3ce342f40aa2e575a01134fc1320 (patch)
tree227b2fddfedcbff4ffc6232554bf42d1b2f43455
parent40380658717904d61483e02f50ce590734872aba (diff)
downloadchrome-ec-b46071331a2b3ce342f40aa2e575a01134fc1320.tar.gz
zephyr: add support for ln9310 driver
Add Kconfig option for enabling the LN9310 switched capacitor converted used on Lazor. This is a dependency of the SC7180 power sequencing for Lazor (other trogdor boards will have differing switched capacitor drivers). BUG=b:183054226 BRANCH=none TEST=compile with LN9310 driver on lazor (follow-up CL) Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I1138885e4a5e162f9a5e623f6ffe0e1e41d12523 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2774365 Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--zephyr/CMakeLists.txt2
-rw-r--r--zephyr/Kconfig9
-rw-r--r--zephyr/shim/include/config_chip.h5
3 files changed, 16 insertions, 0 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt
index a3912e02e4..5078537dc1 100644
--- a/zephyr/CMakeLists.txt
+++ b/zephyr/CMakeLists.txt
@@ -265,6 +265,8 @@ zephyr_sources_ifdef(CONFIG_PLATFORM_EC_SHA256_SW
"${PLATFORM_EC}/common/sha256.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_SWITCH
"${PLATFORM_EC}/common/switch.c")
+zephyr_sources_ifdef(CONFIG_PLATFORM_EC_SWITCHCAP_LN9310
+ "${PLATFORM_EC}/driver/ln9310.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_SPI_FLASH_REGS
"${PLATFORM_EC}/common/spi_flash_reg.c")
diff --git a/zephyr/Kconfig b/zephyr/Kconfig
index 8145d7feb6..114b03cc54 100644
--- a/zephyr/Kconfig
+++ b/zephyr/Kconfig
@@ -803,6 +803,15 @@ config PLATFORM_EC_SWITCH
This also enables the "mmapinfo" console command to report the current
state of all switches.
+config PLATFORM_EC_SWITCHCAP_LN9310
+ bool "LN9310 switchcap driver"
+ depends on PLATFORM_EC_I2C
+ help
+ Enable support for the LION Semiconductor LN9310 switched
+ capacitor converter. This will export definitions for
+ ln9310_init, ln9310_interrupt, and ln9310_power_good, which
+ project-specific code should call appropriately.
+
config PLATFORM_EC_THROTTLE_AP
bool "CPU throttling"
default y if PLATFORM_EC_POWERSEQ
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 5b5792314e..e193d80b5b 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -1145,6 +1145,11 @@ enum battery_type {
#define CONFIG_SWITCH
#endif
+#undef CONFIG_LN9310
+#ifdef CONFIG_PLATFORM_EC_SWITCHCAP_LN9310
+#define CONFIG_LN9310
+#endif
+
#undef CONFIG_BOARD_VERSION_CBI
#ifdef CONFIG_PLATFORM_EC_BOARD_VERSION_CBI
#define CONFIG_BOARD_VERSION_CBI