From 3dd6e71828b12b786a7cf84fe1bf9b01a3856eee Mon Sep 17 00:00:00 2001 From: Shawn Nematbakhsh Date: Tue, 5 May 2015 17:35:46 -0700 Subject: power: Move EC_CMD_GSV_PAUSE_IN_S5 handler to common code The same code exists in four (soon to be five!) different power sequencing drivers, so move it up to common. BUG=None TEST=Manual on Samus. Run "pause_in_s5 on" on EC console, verify that system stops in S5 on shutdown. Run "pause_in_s5 off" on EC console, verify that system again goes to G3 on shutdown. BRANCH=None Signed-off-by: Shawn Nematbakhsh Change-Id: Iaf05ef7ce017be4f9d173e83e985a7a879ba278c Reviewed-on: https://chromium-review.googlesource.com/269566 Reviewed-by: Randall Spangler --- board/samus/power_sequence.c | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) (limited to 'board/samus/power_sequence.c') diff --git a/board/samus/power_sequence.c b/board/samus/power_sequence.c index daca4ae4ef..83bf1e91f9 100644 --- a/board/samus/power_sequence.c +++ b/board/samus/power_sequence.c @@ -13,7 +13,6 @@ #include "extpower.h" #include "gpio.h" #include "hooks.h" -#include "host_command.h" #include "lid_switch.h" #include "power.h" #include "registers.h" @@ -62,7 +61,6 @@ IN_ALL_PM_SLP_DEASSERTED) static int throttle_cpu; /* Throttle CPU? */ -static int pause_in_s5; /* Pause in S5 when shutting down? */ static uint32_t pp5000_in_g3; /* Turn PP5000 on in G3? */ void chipset_force_shutdown(void) @@ -474,7 +472,7 @@ enum power_state power_handle_state(enum power_state state) gpio_set_level(GPIO_TOUCHSCREEN_RESET_L, 0); gpio_set_level(GPIO_LIGHTBAR_RESET_L, 0); - return pause_in_s5 ? POWER_S5 : POWER_S5G3; + return power_get_pause_in_s5() ? POWER_S5 : POWER_S5G3; case POWER_S5G3: /* Deassert DPWROK */ @@ -559,34 +557,3 @@ int lb_power(int enabled) return ret; } #endif - -static int host_command_gsv(struct host_cmd_handler_args *args) -{ - const struct ec_params_get_set_value *p = args->params; - struct ec_response_get_set_value *r = args->response; - - if (p->flags & EC_GSV_SET) - pause_in_s5 = p->value; - - r->value = pause_in_s5; - - args->response_size = sizeof(*r); - return EC_RES_SUCCESS; -} -DECLARE_HOST_COMMAND(EC_CMD_GSV_PAUSE_IN_S5, - host_command_gsv, - EC_VER_MASK(0)); - -static int console_command_gsv(int argc, char **argv) -{ - if (argc > 1 && !parse_bool(argv[1], &pause_in_s5)) - return EC_ERROR_INVAL; - - ccprintf("pause_in_s5 = %s\n", pause_in_s5 ? "on" : "off"); - - return EC_SUCCESS; -} -DECLARE_CONSOLE_COMMAND(pause_in_s5, console_command_gsv, - "[on|off]", - "Should the AP pause in S5 during shutdown?", - NULL); -- cgit v1.2.1