summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-08-10 13:10:13 -0600
committerCommit Bot <commit-bot@chromium.org>2021-08-11 08:38:54 +0000
commitb1acee1aaaac4ba63a83740ca7d1e2cf7e910843 (patch)
tree9adf244d99571d01807a8947a2c1ecab2883ff15
parent154a67d21fbbb0aabdb1520551014d57be6aa690 (diff)
downloadchrome-ec-b1acee1aaaac4ba63a83740ca7d1e2cf7e910843.tar.gz
zephyr: cleanup Zephyr v2.5 ifdefs
We no longer support version 2.5. Drop these obsolete ifdefs. BUG=b:195571108 BRANCH=none TEST=zmake testall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I85985108bcf175a2756a2f8096b0aa9e3c22fce5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3086368 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
-rw-r--r--zephyr/shim/chip/npcx/power_policy.c17
-rw-r--r--zephyr/shim/include/zephyr_hooks_shim.h13
-rw-r--r--zephyr/shim/src/gpio.c6
-rw-r--r--zephyr/shim/src/hooks.c12
4 files changed, 1 insertions, 47 deletions
diff --git a/zephyr/shim/chip/npcx/power_policy.c b/zephyr/shim/chip/npcx/power_policy.c
index 087a2ebad2..803ac51e9b 100644
--- a/zephyr/shim/chip/npcx/power_policy.c
+++ b/zephyr/shim/chip/npcx/power_policy.c
@@ -4,20 +4,13 @@
*/
#include <zephyr.h>
+#include <pm/pm.h>
#include <soc.h>
#include "console.h"
#include "cros_version.h"
#include "system.h"
-#if IS_ZEPHYR_VERSION(2, 6)
-#include <pm/pm.h>
-#elif IS_ZEPHYR_VERSION(2, 5)
-#include <power/power.h>
-#else
-#error "Unsupported Zephyr version"
-#endif
-
static const struct pm_state_info pm_min_residency[] =
PM_STATE_INFO_DT_ITEMS_LIST(DT_NODELABEL(cpu0));
@@ -39,11 +32,3 @@ struct pm_state_info pm_policy_next_state(int32_t ticks)
return (struct pm_state_info){ PM_STATE_ACTIVE, 0, 0 };
}
-
-#if IS_ZEPHYR_VERSION(2, 5)
-/* CROS PM device policy handler */
-bool pm_policy_low_power_devices(enum pm_state state)
-{
- return pm_is_sleep_state(state);
-}
-#endif
diff --git a/zephyr/shim/include/zephyr_hooks_shim.h b/zephyr/shim/include/zephyr_hooks_shim.h
index c53d05de9e..96dcf9d8f4 100644
--- a/zephyr/shim/include/zephyr_hooks_shim.h
+++ b/zephyr/shim/include/zephyr_hooks_shim.h
@@ -19,11 +19,7 @@
* The internal data structure stored for a deferred function.
*/
struct deferred_data {
-#if IS_ZEPHYR_VERSION(2, 6)
struct k_work_delayable *work;
-#else
- struct k_delayed_work *work;
-#endif
};
/**
@@ -31,21 +27,12 @@ struct deferred_data {
*/
int hook_call_deferred(const struct deferred_data *data, int us);
-#if IS_ZEPHYR_VERSION(2, 6)
#define DECLARE_DEFERRED(routine) \
K_WORK_DELAYABLE_DEFINE(routine##_work_data, \
(void (*)(struct k_work *))routine); \
__maybe_unused const struct deferred_data routine##_data = { \
.work = &routine##_work_data, \
}
-#else
-#define DECLARE_DEFERRED(routine) \
- K_DELAYED_WORK_DEFINE(routine##_work_data, \
- (void (*)(struct k_work *))routine); \
- __maybe_unused const struct deferred_data routine##_data = { \
- .work = &routine##_work_data, \
- }
-#endif
/**
* Internal linked-list structure used to store hook lists.
diff --git a/zephyr/shim/src/gpio.c b/zephyr/shim/src/gpio.c
index cc2baa0fe7..5348133ead 100644
--- a/zephyr/shim/src/gpio.c
+++ b/zephyr/shim/src/gpio.c
@@ -303,13 +303,7 @@ static int init_gpios(const struct device *unused)
~(GPIO_OUTPUT_INIT_LOW | GPIO_OUTPUT_INIT_HIGH);
}
-#if IS_ZEPHYR_VERSION(2, 6)
rv = gpio_pin_configure(data[i].dev, configs[i].pin, flags);
-#elif IS_ZEPHYR_VERSION(2, 5)
- rv = gpio_config(data[i].dev, configs[i].pin, flags);
-#else
-#error "Unsupported zephyr version"
-#endif
if (rv < 0) {
LOG_ERR("Config failed %s (%d)", configs[i].name, rv);
}
diff --git a/zephyr/shim/src/hooks.c b/zephyr/shim/src/hooks.c
index 2ec19304d3..8bbd7bed05 100644
--- a/zephyr/shim/src/hooks.c
+++ b/zephyr/shim/src/hooks.c
@@ -15,25 +15,13 @@
int hook_call_deferred(const struct deferred_data *data, int us)
{
-#if IS_ZEPHYR_VERSION(2, 6)
struct k_work_delayable *work = data->work;
-#else
- struct k_delayed_work *work = data->work;
-#endif
int rv = 0;
if (us == -1) {
-#if IS_ZEPHYR_VERSION(2, 6)
k_work_cancel_delayable(work);
-#else
- k_delayed_work_cancel(work);
-#endif
} else if (us >= 0) {
-#if IS_ZEPHYR_VERSION(2, 6)
rv = k_work_schedule(work, K_USEC(us));
-#else
- rv = k_delayed_work_submit(work, K_USEC(us));
-#endif
if (rv == -EINVAL) {
/* Already processing or completed. */
return 0;