summaryrefslogtreecommitdiff
path: root/zephyr/subsys/ap_pwrseq/x86_non_dsx_common_pwrseq_host_command.c
blob: 7bacbcd8cd011f9e46ff4fb3f5402c3c944f4f8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* Copyright 2022 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 <x86_non_dsx_common_pwrseq_sm_handler.h>

/* Host commands */
static enum ec_status
host_command_reboot_ap_on_g3(struct host_cmd_handler_args *args)
{
	const struct ec_params_reboot_ap_on_g3_v1 *cmd = args->params;

	/* Store request for processing at g3 */
	request_exit_hardoff(true);

	switch (args->version) {
	case 0:
		break;
	case 1:
		/* Store user specified delay to wait in G3 state */
		set_reboot_ap_at_g3_delay_seconds(cmd->reboot_ap_at_g3_delay);
		break;
	default:
		return EC_RES_INVALID_PARAM;
	}

	return EC_RES_SUCCESS;
}
DECLARE_HOST_COMMAND(EC_CMD_REBOOT_AP_ON_G3,
		     host_command_reboot_ap_on_g3,
		     EC_VER_MASK(0) | EC_VER_MASK(1));

/* End of host commands */