diff options
-rw-r--r-- | include/host_command.h | 6 | ||||
-rw-r--r-- | zephyr/shim/include/zephyr_host_command.h | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/include/host_command.h b/include/host_command.h index 459ad2e4e5..5453f34eee 100644 --- a/include/host_command.h +++ b/include/host_command.h @@ -256,7 +256,7 @@ __error("This function should only be called from Zephyr OS code") #endif struct host_command *zephyr_find_host_command(int command); -#if defined(CONFIG_PLATFORM_EC_HOSTCMD) +#if defined(CONFIG_ZEPHYR) #include "zephyr_host_command.h" #elif defined(HAS_TASK_HOSTCMD) #define EXPAND(off, cmd) __host_cmd_(off, cmd) @@ -284,14 +284,14 @@ struct host_command *zephyr_find_host_command(int command); EXPANDSTR(EC_CMD_BOARD_SPECIFIC_BASE, command)))) \ = {routine, EC_PRIVATE_HOST_COMMAND_VALUE(command), \ version_mask} -#else +#else /* !CONFIG_ZEPHYR && !HAS_TASK_HOSTCMD */ #define DECLARE_HOST_COMMAND(command, routine, version_mask) \ enum ec_status (routine)(struct host_cmd_handler_args *args) \ __attribute__((unused)) #define DECLARE_PRIVATE_HOST_COMMAND(command, routine, version_mask) \ DECLARE_HOST_COMMAND(command, routine, version_mask) -#endif +#endif /* CONFIG_ZEPHYR */ /** * Politely ask the CPU to enable/disable its own throttling. diff --git a/zephyr/shim/include/zephyr_host_command.h b/zephyr/shim/include/zephyr_host_command.h index d8ee0c2c9b..377578311c 100644 --- a/zephyr/shim/include/zephyr_host_command.h +++ b/zephyr/shim/include/zephyr_host_command.h @@ -12,6 +12,8 @@ #include <init.h> +#ifdef CONFIG_PLATFORM_EC_HOSTCMD + /** Node in a list of host-command handlers */ struct zshim_host_command_node { struct host_command *cmd; @@ -50,3 +52,7 @@ void zshim_setup_host_command( return 0; \ } \ SYS_INIT(_setup_host_command_##line, APPLICATION, 1) +#else /* !CONFIG_PLATFORM_EC_HOSTCMD */ +#define DECLARE_HOST_COMMAND(command, routine, version_mask) \ + enum ec_status (routine)(struct host_cmd_handler_args *args) +#endif /* CONFIG_PLATFORM_EC_HOSTCMD */ |