summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Marheine <pmarheine@chromium.org>2021-12-29 12:28:17 +1100
committerCommit Bot <commit-bot@chromium.org>2021-12-30 00:43:24 +0000
commitf4658ca0e26beeaa22b5667463ce820ca0ddf49b (patch)
tree15c838675e88b697bf9b92464de65375b004ca9d
parentf7028c8e8597b98327febc4a6855889576545bad (diff)
downloadchrome-ec-f4658ca0e26beeaa22b5667463ce820ca0ddf49b.tar.gz
zephyr: add kconfig support for RAA489000 charger
This has a dependency on the configuration for sense resistors because if those values are not configured then it instead causes a confusing compile-time error in a generated source file that exposes config values as symbols in the output object files. BUG=b:211693800 TEST=zmake testall; CONFIG_PLATFORM_EC_CHARGER_RAA489000 can be enabled BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: Ide012a5c1615efa00eb01196d48b3bf25e222521 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3359173 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--zephyr/CMakeLists.txt2
-rw-r--r--zephyr/Kconfig.battery10
-rw-r--r--zephyr/shim/include/config_chip.h5
3 files changed, 17 insertions, 0 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt
index 36525f678a..709d4fafb0 100644
--- a/zephyr/CMakeLists.txt
+++ b/zephyr/CMakeLists.txt
@@ -174,6 +174,8 @@ zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER_ISL9238
"${PLATFORM_EC}/driver/charger/isl923x.c")
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER_ISL9238C
"${PLATFORM_EC}/driver/charger/isl923x.c")
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER_RAA489000
+ "${PLATFORM_EC}/driver/charger/isl923x.c")
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER_ISL9241
"${PLATFORM_EC}/driver/charger/isl9241.c")
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER_BQ25710
diff --git a/zephyr/Kconfig.battery b/zephyr/Kconfig.battery
index 91cff1b4ca..642ebe3b66 100644
--- a/zephyr/Kconfig.battery
+++ b/zephyr/Kconfig.battery
@@ -209,6 +209,16 @@ config PLATFORM_EC_CHARGER_BQ25720
wide range of input power sources are supported such as high
voltage USB-C power delivery.
+config PLATFORM_EC_CHARGER_RAA489000
+ bool "Use the RAA489000 charger"
+ depends on PLATFORM_EC_I2C
+ depends on PLATFORM_EC_CHARGER_SENSE_RESISTOR > 0
+ depends on PLATFORM_EC_CHARGER_SENSE_RESISTOR_AC > 0
+ select PLATFORM_EC_CHARGER_NARROW_VDC
+ help
+ Enables the driver for the Renesas RAA489000 battery charger
+ with integrated USB-C TCPC.
+
config PLATFORM_EC_CHARGER_DISCHARGE_ON_AC
bool "Board supports discharge mode"
help
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 37ae49d741..b24cc80ddb 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -283,6 +283,11 @@
#define CONFIG_CHARGER_ISL9238C
#endif
+#undef CONFIG_CHARGER_RAA489000
+#ifdef CONFIG_PLATFORM_EC_CHARGER_RAA489000
+#define CONFIG_CHARGER_RAA489000
+#endif
+
#undef CONFIG_CHARGER_MAINTAIN_VBAT
#ifdef CONFIG_PLATFORM_EC_CHARGER_MAINTAIN_VBAT
#define CONFIG_CHARGER_MAINTAIN_VBAT