summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2021-05-26 14:42:52 +0200
committerCommit Bot <commit-bot@chromium.org>2021-05-31 07:29:00 +0000
commite726bc35b41ae6be47f1e56ec9e4eb5ccb31ef60 (patch)
tree62e01bf5bf833313583ed68cd6856fb6ae50f949
parent31b464016da44992689b0fa1160b2703f0d946d0 (diff)
downloadchrome-ec-e726bc35b41ae6be47f1e56ec9e4eb5ccb31ef60.tar.gz
zephyr: lazor: enable Virtual Battery driver
Enable I2C_VIRTUAL_BATTERY config for lazor. This is one of a few steps to fix getting data about the battery by the host. Also, set I2C_PORT_VIRTUAL_BATTERY to I2C_PORT_BATTERY, but it might be changed in the future. BUG=b:188885798 BRANCH=none TEST=zmake testall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I12da1b57b6e2cf0b98822c71243ccd1667d73506 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2919907 Reviewed-by: Yuval Peress <peress@chromium.org>
-rw-r--r--zephyr/projects/trogdor/lazor/prj.conf1
-rw-r--r--zephyr/shim/include/config_chip.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/zephyr/projects/trogdor/lazor/prj.conf b/zephyr/projects/trogdor/lazor/prj.conf
index 1d43eaebbb..6d647e832f 100644
--- a/zephyr/projects/trogdor/lazor/prj.conf
+++ b/zephyr/projects/trogdor/lazor/prj.conf
@@ -62,6 +62,7 @@ CONFIG_ADC_SHELL=n
CONFIG_HAS_TASK_USB_CHG_P1=y
CONFIG_PLATFORM_EC_BATTERY=y
CONFIG_PLATFORM_EC_BATTERY_SMART=y
+CONFIG_PLATFORM_EC_I2C_VIRTUAL_BATTERY=y
CONFIG_PLATFORM_EC_BATTERY_FUEL_GAUGE=y
CONFIG_PLATFORM_EC_BATTERY_CUT_OFF=y
CONFIG_PLATFORM_EC_BATTERY_PRESENT_GPIO=y
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index f051863c6f..e545b52c26 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -155,8 +155,10 @@
#endif
#undef CONFIG_I2C_VIRTUAL_BATTERY
+#undef I2C_PORT_VIRTUAL_BATTERY
#ifdef CONFIG_PLATFORM_EC_I2C_VIRTUAL_BATTERY
#define CONFIG_I2C_VIRTUAL_BATTERY
+#define I2C_PORT_VIRTUAL_BATTERY I2C_PORT_BATTERY
#endif
#undef CONFIG_BATTERY_PRESENT_CUSTOM