From 58008e49b6ef5b75965fe4abc507597066860e64 Mon Sep 17 00:00:00 2001 From: Eric Yilun Lin Date: Fri, 7 Apr 2023 16:26:53 +0800 Subject: kingler: add usbc test This CL adds the initial USB-C tests on kingler BUG=b:272664811 TEST=twister -ci zephyr/test Change-Id: I14395ce84442f40e6fd05f7c14a2814fb24ebb9a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4483240 Reviewed-by: Ting Shen Tested-by: Eric Yilun Lin Auto-Submit: Eric Yilun Lin Commit-Queue: Ting Shen --- zephyr/test/kingler/src/fakes.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'zephyr/test/kingler/src/fakes.c') diff --git a/zephyr/test/kingler/src/fakes.c b/zephyr/test/kingler/src/fakes.c index 412e02fef9..6c67447e88 100644 --- a/zephyr/test/kingler/src/fakes.c +++ b/zephyr/test/kingler/src/fakes.c @@ -9,16 +9,24 @@ FAKE_VOID_FUNC(power_button_interrupt, enum gpio_signal); FAKE_VOID_FUNC(button_interrupt, enum gpio_signal); -FAKE_VOID_FUNC(lid_interrupt, enum gpio_signal); FAKE_VOID_FUNC(chipset_reset_request_interrupt, enum gpio_signal); FAKE_VOID_FUNC(power_signal_interrupt, enum gpio_signal); FAKE_VOID_FUNC(chipset_watchdog_interrupt, enum gpio_signal); FAKE_VOID_FUNC(extpower_interrupt, enum gpio_signal); -FAKE_VOID_FUNC(xhci_interrupt, enum gpio_signal); FAKE_VOID_FUNC(switch_interrupt, enum gpio_signal); +#ifndef CONFIG_TEST_KINGLER_USBC +FAKE_VOID_FUNC(xhci_interrupt, enum gpio_signal); +FAKE_VOID_FUNC(lid_interrupt, enum gpio_signal); +FAKE_VOID_FUNC(usb_a0_interrupt, enum gpio_signal); FAKE_VOID_FUNC(tcpc_alert_event, enum gpio_signal); FAKE_VOID_FUNC(ppc_interrupt, enum gpio_signal); FAKE_VOID_FUNC(bc12_interrupt, enum gpio_signal); +FAKE_VOID_FUNC(pd_power_supply_reset, int); +FAKE_VOID_FUNC(pd_set_power_supply_ready, int); +FAKE_VALUE_FUNC(int, board_set_active_charge_port, int); +FAKE_VALUE_FUNC(int, pd_snk_is_vbus_provided, int); +FAKE_VALUE_FUNC(int, pd_check_vconn_swap, int); +#endif FAKE_VOID_FUNC(chipset_warm_reset_interrupt, enum gpio_signal); #ifndef CONFIG_TEST_KINGLER_CCD FAKE_VOID_FUNC(ccd_interrupt, enum gpio_signal); -- cgit v1.2.1 From efe0fbc416966340abae6539df8b2ab5a7e5a219 Mon Sep 17 00:00:00 2001 From: lschyi Date: Mon, 15 May 2023 15:37:12 +0800 Subject: corsola: Fix reported USB-C ports for no DB design with DB detection on The definition of `CORSOLA_DB_NONE` was settled to no DB in the project in the previous CL "corsola: Update implementation for no daughter board ", and the USB-C counts is determined by dts settings in previous CL " corosla: Improve USB-C port configuration". This introduces a reported port number mismatch when the DB detection is enabled, and the desired detection result is no DB in the design. Extend the DB status enum with `CORSOLA_DB_NO_DETECTION` to properly describe the different DB status, and fix the reported USB-C port logic. BUG=b:282625153 TEST=`zmake build --clobber` Change-Id: Idd55381759677272e0bfc7b270647d759642ce01 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4530326 Reviewed-by: Ting Shen Tested-by: Sung-Chi Li Commit-Queue: Sung-Chi Li --- zephyr/test/kingler/src/fakes.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'zephyr/test/kingler/src/fakes.c') diff --git a/zephyr/test/kingler/src/fakes.c b/zephyr/test/kingler/src/fakes.c index 6c67447e88..c4a7cf0a6d 100644 --- a/zephyr/test/kingler/src/fakes.c +++ b/zephyr/test/kingler/src/fakes.c @@ -14,8 +14,11 @@ FAKE_VOID_FUNC(power_signal_interrupt, enum gpio_signal); FAKE_VOID_FUNC(chipset_watchdog_interrupt, enum gpio_signal); FAKE_VOID_FUNC(extpower_interrupt, enum gpio_signal); FAKE_VOID_FUNC(switch_interrupt, enum gpio_signal); -#ifndef CONFIG_TEST_KINGLER_USBC +#if !(defined(CONFIG_TEST_KINGLER_USBC) || \ + defined(CONFIG_TEST_DB_DETECTION_USB_COUNT)) FAKE_VOID_FUNC(xhci_interrupt, enum gpio_signal); +#endif +#ifndef CONFIG_TEST_KINGLER_USBC FAKE_VOID_FUNC(lid_interrupt, enum gpio_signal); FAKE_VOID_FUNC(usb_a0_interrupt, enum gpio_signal); FAKE_VOID_FUNC(tcpc_alert_event, enum gpio_signal); -- cgit v1.2.1