diff options
author | ben chen <ben.chen2@quanta.corp-partner.google.com> | 2022-10-18 11:20:51 +0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-10-19 08:05:25 +0000 |
commit | 0dfb30f2201fde1137a172b6ad72d2fd8a372f1b (patch) | |
tree | 6e91c827bb335e508937d72eb90ebd35fee91750 /board/kuldax | |
parent | c58ec4493f1f92393aed671b96c6063646c068c7 (diff) | |
download | chrome-ec-0dfb30f2201fde1137a172b6ad72d2fd8a372f1b.tar.gz |
kuldax: Add board_led_auto_control
Check power state to change led status while
receive the auto contorl command.
BUG=b:254018663
BRANCH=none
TEST="ectool led power auto" can show correct
led behavior immediately.
Change-Id: I550e7a85ccda71b07d68a2960681905e5b68f820
Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3960513
Reviewed-by: Derek Huang <derekhuang@google.com>
Reviewed-by: TH Lin <t.h_lin@quanta.corp-partner.google.com>
Commit-Queue: Derek Huang <derekhuang@google.com>
Diffstat (limited to 'board/kuldax')
-rw-r--r-- | board/kuldax/led.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/board/kuldax/led.c b/board/kuldax/led.c index 8da760193b..39b79e2196 100644 --- a/board/kuldax/led.c +++ b/board/kuldax/led.c @@ -182,6 +182,16 @@ static void led_resume(void) } DECLARE_HOOK(HOOK_CHIPSET_RESUME, led_resume, HOOK_PRIO_DEFAULT); +void board_led_auto_control(void) +{ + 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) { |