summaryrefslogtreecommitdiff
path: root/zephyr/test/drivers/src/stubs.c
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2022-02-01 17:02:16 -0700
committerCommit Bot <commit-bot@chromium.org>2022-02-02 19:05:28 +0000
commit8b1cf840571d7a47b44ededa74c8ed1814deead1 (patch)
tree32a5fa64f1f0e1e8362978c0801ebe52abebb86b /zephyr/test/drivers/src/stubs.c
parent5bff631a9d22a0cee449b7f872bbfacb6d09a5c4 (diff)
downloadchrome-ec-8b1cf840571d7a47b44ededa74c8ed1814deead1.tar.gz
zephyr: Do not call power_set_state in testsstabilize-14496.B-main
Change tests to not call power_set_state() as it doesn't actually change the power state, since the chipset_task only reads the state once and then keeps the state in a local var. There are a few exceptions to this. Some tests run before chipset_task is started, those continue to use power_set_state(). Also the hibernate tests make some redundant calls to set state to G3 when it already is in that state, just to reset the last_shutdown_time. Otherwise the g3 time will be unpredictable. Fixed test_set_chipset_to_s0 to actually coax the chipset_task to go to S0. BRANCH=None BUG=b:214256453 TEST=zmake testall Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I04ea6f73fcf784f20e53049eb3276173efd2655f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3430309 Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Aaron Massey <aaronmassey@google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'zephyr/test/drivers/src/stubs.c')
-rw-r--r--zephyr/test/drivers/src/stubs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/zephyr/test/drivers/src/stubs.c b/zephyr/test/drivers/src/stubs.c
index 85d7e99d13..ca33bff089 100644
--- a/zephyr/test/drivers/src/stubs.c
+++ b/zephyr/test/drivers/src/stubs.c
@@ -385,6 +385,11 @@ DECLARE_HOOK(HOOK_INIT, stubs_interrupt_init, HOOK_PRIO_INIT_I2C + 1);
void board_set_switchcap_power(int enable)
{
gpio_set_level(GPIO_SWITCHCAP_ON, enable);
+ /* TODO(b/217554681): So, the ln9310 emul should probably be setting
+ * this instead of setting it here.
+ */
+ gpio_set_level(GPIO_SWITCHCAP_PG, enable);
+ gpio_set_level(GPIO_POWER_GOOD, enable);
}
int board_is_switchcap_enabled(void)