summaryrefslogtreecommitdiff
path: root/zephyr/test
diff options
context:
space:
mode:
authorAbe Levkoy <alevkoy@chromium.org>2021-09-01 11:44:02 -0600
committerCommit Bot <commit-bot@chromium.org>2021-09-15 16:23:13 +0000
commitada651ec4ce1a8f1807f5f54e1596050a430c3d5 (patch)
tree42c3e26eb10fb5dfa3fc871b93fedaf99a01d628 /zephyr/test
parent0a19f385df253dc642b4dc9cb81d90e4fde0d99d (diff)
downloadchrome-ec-ada651ec4ce1a8f1807f5f54e1596050a430c3d5.tar.gz
zephyr: Conform BC1.2 test to device tree
Do not override the number of USB-C ports. Enable the port 1 PD task, so that port 1 behaves as expected during the test. BUG=b:197747859 TEST=zmake configure --test zephyr/test/drivers BRANCH=none Cq-Depend: chromium:3159528 Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I3e170c4fd295de7812b1678185a0cd892faf4203 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3138216 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/test')
-rw-r--r--zephyr/test/drivers/prj.conf4
-rw-r--r--zephyr/test/drivers/src/bc12.c11
2 files changed, 5 insertions, 10 deletions
diff --git a/zephyr/test/drivers/prj.conf b/zephyr/test/drivers/prj.conf
index ff7f93b918..c54ff445b0 100644
--- a/zephyr/test/drivers/prj.conf
+++ b/zephyr/test/drivers/prj.conf
@@ -26,6 +26,10 @@ CONFIG_EMUL_BB_RETIMER=y
CONFIG_PLATFORM_EC_POWERSEQ=y
+CONFIG_HAS_TASK_USB_CHG_P0=y
+CONFIG_HAS_TASK_USB_CHG_P1=y
+CONFIG_HAS_TASK_PD_C1=y
+
CONFIG_PLATFORM_EC_BATTERY_PRESENT_GPIO=y
CONFIG_PLATFORM_EC_EXTPOWER_GPIO=y
diff --git a/zephyr/test/drivers/src/bc12.c b/zephyr/test/drivers/src/bc12.c
index 2c72100778..4251448f2c 100644
--- a/zephyr/test/drivers/src/bc12.c
+++ b/zephyr/test/drivers/src/bc12.c
@@ -95,16 +95,6 @@ static const struct bc12_status bc12_chg_limits[] = {
#define GPIO_ACOK_OD_PATH DT_PATH(named_gpios, acok_od)
#define GPIO_ACOK_OD_PORT DT_GPIO_PIN(GPIO_ACOK_OD_PATH, gpios)
-/*
- * The driver test app seems to have USBC_PORT_COUNT=2 but missing the task for
- * port 1, so change port count to 1 here.
- * TODO: fix the app so count and tasks agree.
- */
-__override uint8_t board_get_usb_pd_port_count(void)
-{
- return 1;
-}
-
static void test_bc12_pi3usb9201_host_mode(void)
{
struct i2c_emul *emul = pi3usb9201_emul_get(PI3USB9201_ORD);
@@ -262,6 +252,7 @@ static void test_bc12_pi3usb9201(void)
* role to disconnected.
*/
task_set_event(TASK_ID_USB_CHG_P0, USB_CHG_EVENT_CC_OPEN);
+ task_set_event(TASK_ID_USB_CHG_P1, USB_CHG_EVENT_CC_OPEN);
msleep(1);
/*
* Expect the pi3usb9201 driver to configure power down mode and mask