summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2022-01-12 11:35:40 -0700
committerCommit Bot <commit-bot@chromium.org>2022-01-12 21:11:11 +0000
commite486b388a73f1e19f3142774d0b3ee166e8f41ff (patch)
tree3a40da72557c19333bb1e1cb7b6d1c7c1a455ffa
parent24fd126ada05966fdb4a6100a0d6cca453317ad5 (diff)
downloadchrome-ec-e486b388a73f1e19f3142774d0b3ee166e8f41ff.tar.gz
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 <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3384476 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
-rw-r--r--zephyr/shim/chip/it8xxx2/power_policy.c6
-rw-r--r--zephyr/shim/chip/npcx/power_policy.c6
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;
}