diff options
-rw-r--r-- | zephyr/shim/chip/npcx/power_policy.c | 17 | ||||
-rw-r--r-- | zephyr/shim/include/zephyr_hooks_shim.h | 13 | ||||
-rw-r--r-- | zephyr/shim/src/gpio.c | 6 | ||||
-rw-r--r-- | zephyr/shim/src/hooks.c | 12 |
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; |