summaryrefslogtreecommitdiff
path: root/common/base_state.c
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-11-04 12:11:58 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-05 04:22:34 +0000
commit252457d4b21f46889eebad61d4c0a65331919cec (patch)
tree01856c4d31d710b20e85a74c8d7b5836e35c3b98 /common/base_state.c
parent08f5a1e6fc2c9467230444ac9b582dcf4d9f0068 (diff)
downloadchrome-ec-release-R98-14388.B-ish.tar.gz
In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'common/base_state.c')
-rw-r--r--common/base_state.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/common/base_state.c b/common/base_state.c
deleted file mode 100644
index 43e201cab9..0000000000
--- a/common/base_state.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Copyright 2018 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "base_state.h"
-#include "console.h"
-#include "host_command.h"
-#include "hooks.h"
-
-#define CPRINTS(format, args...) cprints(CC_MOTION_LID, format, ## args)
-
-#ifdef CONFIG_BASE_ATTACHED_SWITCH
-/* 1: base attached, 0: otherwise */
-static int base_state;
-
-int base_get_state(void)
-{
- return base_state;
-}
-
-void base_set_state(int state)
-{
- if (base_state == !!state)
- return;
-
- base_state = !!state;
- CPRINTS("base state: %stached", state ? "at" : "de");
- hook_notify(HOOK_BASE_ATTACHED_CHANGE);
-
- /* Notify host of mode change. This likely will wake it up. */
- host_set_single_event(EC_HOST_EVENT_MODE_CHANGE);
-}
-#endif
-
-static int command_setbasestate(int argc, char **argv)
-{
- if (argc != 2)
- return EC_ERROR_PARAM_COUNT;
- if (argv[1][0] == 'a')
- base_force_state(EC_SET_BASE_STATE_ATTACH);
- else if (argv[1][0] == 'd')
- base_force_state(EC_SET_BASE_STATE_DETACH);
- else if (argv[1][0] == 'r')
- base_force_state(EC_SET_BASE_STATE_RESET);
- else
- return EC_ERROR_PARAM1;
-
- return EC_SUCCESS;
-
-}
-DECLARE_CONSOLE_COMMAND(basestate, command_setbasestate,
- "[attach | detach | reset]",
- "Manually force base state to attached, detached or reset.");
-
-static enum ec_status hostcmd_setbasestate(struct host_cmd_handler_args *args)
-{
- const struct ec_params_set_base_state *params = args->params;
-
- if (params->cmd > EC_SET_BASE_STATE_RESET)
- return EC_RES_INVALID_PARAM;
-
- base_force_state(params->cmd);
-
- return EC_SUCCESS;
-}
-DECLARE_HOST_COMMAND(EC_CMD_SET_BASE_STATE, hostcmd_setbasestate,
- EC_VER_MASK(0));