diff options
author | Michał Barnaś <mb@semihalf.com> | 2021-10-06 16:13:13 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-10-15 17:11:46 +0000 |
commit | 0398923c16ee19fd31e1a43ace6d2c29a026c854 (patch) | |
tree | c210da96d538ce27e98810b4731cc537f6685766 /include | |
parent | aebcdcde3839c41ba0a68d34e32bf7dd49fe08e9 (diff) | |
download | chrome-ec-0398923c16ee19fd31e1a43ace6d2c29a026c854.tar.gz |
zephyr: add support for virtual battery
Add Kconfigs to enable virtual battery and set virtual battery address.
Change named-i2c from I2C_PORT_VIRTUAL to I2C_PORT_VIRTUAL_BATTERY.
BRANCH=main
BUG=b:185480578
TEST=When virtual battery is enabled, compilation fails if no
virtual battery port is defined in device tree.
TEST=Enable virtual battery and verify that its handlers
are called properly.
Change-Id: Ic88da28dc443beb89a32868d201072f39abb3a86
Signed-off-by: Michał Barnaś <mb@semihalf.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3207991
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/virtual_battery.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/virtual_battery.h b/include/virtual_battery.h index 4e7ca31d05..a5cac1140c 100644 --- a/include/virtual_battery.h +++ b/include/virtual_battery.h @@ -6,7 +6,8 @@ #ifndef __CROS_EC_VIRTUAL_BATTERY_H #define __CROS_EC_VIRTUAL_BATTERY_H -#if defined(CONFIG_I2C_VIRTUAL_BATTERY) && defined(CONFIG_BATTERY_SMART) +#if defined(CONFIG_I2C_VIRTUAL_BATTERY) && defined(CONFIG_BATTERY_SMART) \ + && !defined(VIRTUAL_BATTERY_ADDR_FLAGS) #define VIRTUAL_BATTERY_ADDR_FLAGS BATTERY_ADDR_FLAGS #endif |