From c487e18a3f203dc8793e884730eb66b2706deb26 Mon Sep 17 00:00:00 2001 From: james_chao Date: Wed, 12 Apr 2017 22:58:33 +0800 Subject: led_policy_std: turn off power led when system shutdown The led is control by HOOK_SECOND, but if dut press ALT+VOL_UP+H, enter hibernate mode when system in s0, there is no one second to turn off the power led, so the power led is still on when system enter hibernate. BUG=b:36328757 BRANCH=gru TEST=press ALT+VOL UP+H, the power led turn off and system enter hibernate mode. Change-Id: I72d18876aa5468131bae7ad42203982d123db8ba Signed-off-by: james_chao Reviewed-on: https://chromium-review.googlesource.com/476850 Commit-Ready: Aseda Aboagye Tested-by: Aseda Aboagye Reviewed-by: Aseda Aboagye --- common/led_policy_std.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/led_policy_std.c b/common/led_policy_std.c index 416d8495ed..631d905754 100644 --- a/common/led_policy_std.c +++ b/common/led_policy_std.c @@ -124,6 +124,14 @@ int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness) return EC_SUCCESS; } +#ifdef HAS_TASK_CHIPSET +static void std_led_shutdown(void) +{ + pwr_led_set_color(LED_OFF); +} +DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, std_led_shutdown, HOOK_PRIO_DEFAULT); +#endif + static void std_led_set_power(void) { static int power_second; -- cgit v1.2.1