summaryrefslogtreecommitdiff
path: root/board/kinox
diff options
context:
space:
mode:
authorLeila Lin <leilacy_lin@compal.corp-partner.google.com>2022-05-25 16:42:29 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-05-26 13:25:50 +0000
commit1d37bd0fe1618d9ac0b55d618fb272066a492584 (patch)
treeec1a92fb4b8ec4b9a12a238c42d98c56d834f686 /board/kinox
parent12a6b8e5252130020f1a2da266b1f87696cbabb4 (diff)
downloadchrome-ec-1d37bd0fe1618d9ac0b55d618fb272066a492584.tar.gz
Kinox: Add board_led_auto_control
Add board_led_auto_control for factory test to check led state while receive the auto control command. BUG=b:233552221 BRANCH=none TEST="ectool led power auto" can show correct led behavior Signed-off-by: Leila Lin <leilacy_lin@compal.corp-partner.google.com> Change-Id: I4ade8e9102528fa6f79b2bf73b7c756c72133fcf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3666956 Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Reviewed-by: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com> Tested-by: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com> Commit-Queue: Ricky Chang <rickytlchang@chromium.org>
Diffstat (limited to 'board/kinox')
-rw-r--r--board/kinox/led.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/board/kinox/led.c b/board/kinox/led.c
index 636804c7a6..00381fa7f4 100644
--- a/board/kinox/led.c
+++ b/board/kinox/led.c
@@ -182,6 +182,17 @@ static void led_resume(void)
}
DECLARE_HOOK(HOOK_CHIPSET_RESUME, led_resume, HOOK_PRIO_DEFAULT);
+void board_led_auto_control(void)
+{
+ /* Restore the previous signal */
+ if (chipset_in_state(CHIPSET_STATE_ON))
+ led_resume();
+ else if (chipset_in_state(CHIPSET_STATE_SUSPEND))
+ led_suspend_hook();
+ else if (chipset_in_state(CHIPSET_STATE_ANY_OFF))
+ led_shutdown_hook();
+}
+
void led_alert(int enable)
{
if (enable) {