From e486b388a73f1e19f3142774d0b3ee166e8f41ff Mon Sep 17 00:00:00 2001 From: Keith Short Date: Wed, 12 Jan 2022 11:35:40 -0700 Subject: zephyr: Update power policy for API change Upstream Zephyr modified the prototype for pm_policy_get_next_state(). Update both the npcx and ite implementations to match the new API. BUG=none BRANCH=none TEST=zmake testall TEST=On Volteer (NPCX), verify entry into deep sleep after suspending the AP. Cq-Depend: chromium:3380765 Change-Id: I4e0e2f59ade77aa052841fa4c1866b05c081ea0c Signed-off-by: Keith Short Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3384476 Reviewed-by: Denis Brockus --- zephyr/shim/chip/it8xxx2/power_policy.c | 6 +++--- zephyr/shim/chip/npcx/power_policy.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/zephyr/shim/chip/it8xxx2/power_policy.c b/zephyr/shim/chip/it8xxx2/power_policy.c index 62e2a14ab8..42f857836c 100644 --- a/zephyr/shim/chip/it8xxx2/power_policy.c +++ b/zephyr/shim/chip/it8xxx2/power_policy.c @@ -14,7 +14,7 @@ static const struct pm_state_info pm_states[] = PM_STATE_INFO_LIST_FROM_DT_CPU(DT_NODELABEL(cpu0)); /* CROS PM policy handler */ -struct pm_state_info pm_policy_next_state(uint8_t cpu, int32_t ticks) +const struct pm_state_info *pm_policy_next_state(uint8_t cpu, int32_t ticks) { ARG_UNUSED(cpu); @@ -33,9 +33,9 @@ struct pm_state_info pm_policy_next_state(uint8_t cpu, int32_t ticks) continue; } - return pm_states[i]; + return &pm_states[i]; } } - return (struct pm_state_info){PM_STATE_ACTIVE, 0, 0}; + return NULL; } diff --git a/zephyr/shim/chip/npcx/power_policy.c b/zephyr/shim/chip/npcx/power_policy.c index 5c6b4dc309..2953777965 100644 --- a/zephyr/shim/chip/npcx/power_policy.c +++ b/zephyr/shim/chip/npcx/power_policy.c @@ -16,7 +16,7 @@ static const struct pm_state_info residency_info[] = PM_STATE_INFO_LIST_FROM_DT_CPU(DT_NODELABEL(cpu0)); /* CROS PM policy handler */ -struct pm_state_info pm_policy_next_state(uint8_t cpu, int32_t ticks) +const struct pm_state_info *pm_policy_next_state(uint8_t cpu, int32_t ticks) { ARG_UNUSED(cpu); @@ -31,10 +31,10 @@ struct pm_state_info pm_policy_next_state(uint8_t cpu, int32_t ticks) ticks >= k_us_to_ticks_ceil32( residency_info[i] .min_residency_us)) { - return residency_info[i]; + return &residency_info[i]; } } } - return (struct pm_state_info){ PM_STATE_ACTIVE, 0, 0 }; + return NULL; } -- cgit v1.2.1