summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Peress <peress@google.com>2021-09-29 22:09:10 -0600
committerCommit Bot <commit-bot@chromium.org>2021-10-01 17:45:16 +0000
commitcf2017d7ccc9ebd50206c477b08a51d1c6bc4433 (patch)
treeb9ba0ccaec06bc9ea3d48c2db29de8483c4ff3fd
parenta94daa8412b6e936c96d68bb3e5c607fde9b0972 (diff)
downloadchrome-ec-cf2017d7ccc9ebd50206c477b08a51d1c6bc4433.tar.gz
zephyr: test: Add ISL923X charger
Enable the isl923x charger driver and include it in the stubs.c BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I75f1ae93dbd7489a2d43b8b88edf96ed5ea993b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3195200 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--zephyr/test/drivers/prj.conf1
-rw-r--r--zephyr/test/drivers/src/stubs.c15
2 files changed, 16 insertions, 0 deletions
diff --git a/zephyr/test/drivers/prj.conf b/zephyr/test/drivers/prj.conf
index 99a275f9e2..a3bceeb58c 100644
--- a/zephyr/test/drivers/prj.conf
+++ b/zephyr/test/drivers/prj.conf
@@ -51,6 +51,7 @@ CONFIG_PLATFORM_EC_BATTERY=y
CONFIG_PLATFORM_EC_BATTERY_SMART=y
CONFIG_PLATFORM_EC_CHARGER_SENSE_RESISTOR=10
CONFIG_PLATFORM_EC_CHARGER_SENSE_RESISTOR_AC=10
+CONFIG_PLATFORM_EC_CHARGER_ISL9238=y
CONFIG_PLATFORM_EC_CHARGER_ISL9241=y
CONFIG_PLATFORM_EC_USB_PD_VBUS_MEASURE_CHARGER=y
CONFIG_PLATFORM_EC_BATTERY_FUEL_GAUGE=y
diff --git a/zephyr/test/drivers/src/stubs.c b/zephyr/test/drivers/src/stubs.c
index 6dab320b9a..dc9dc5fd4b 100644
--- a/zephyr/test/drivers/src/stubs.c
+++ b/zephyr/test/drivers/src/stubs.c
@@ -8,6 +8,7 @@
#include "bc12/pi3usb9201_public.h"
#include "charge_ramp.h"
#include "charger.h"
+#include "charger/isl923x_public.h"
#include "charger/isl9241_public.h"
#include "config.h"
#include "i2c/i2c.h"
@@ -44,13 +45,27 @@ BUILD_ASSERT(ARRAY_SIZE(pi3usb9201_bc12_chips) == USBC_PORT_COUNT);
/* Charger Chip Configuration */
const struct charger_config_t chg_chips[] = {
+#ifdef CONFIG_PLATFORM_EC_CHARGER_ISL9241
{
.i2c_port = I2C_PORT_CHARGER,
.i2c_addr_flags = ISL9241_ADDR_FLAGS,
.drv = &isl9241_drv,
},
+#endif
+#ifdef CONFIG_PLATFORM_EC_CHARGER_ISL9238
+ {
+ .i2c_port = I2C_PORT_CHARGER,
+ .i2c_addr_flags = ISL923X_ADDR_FLAGS,
+ .drv = &isl923x_drv,
+ },
+#endif
};
+uint8_t board_get_charger_chip_count(void)
+{
+ return ARRAY_SIZE(chg_chips);
+}
+
const struct board_batt_params board_battery_info[] = {
/* LGC\011 L17L3PB0 Battery Information */
/*