diff options
author | Yilun Lin <yllin@google.com> | 2019-06-12 11:35:03 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-06-14 04:26:15 +0000 |
commit | 5b77568bc9fc72a74debe2fdc058db060ff5fd1a (patch) | |
tree | a684072e06ce48b83435dd5f6665a3aa12cb2e7f /board | |
parent | e0f88ac5dd779a2edf32fb7f660be10287f0d510 (diff) | |
download | chrome-ec-5b77568bc9fc72a74debe2fdc058db060ff5fd1a.tar.gz |
kukui/led: Support led blinking at sysrq debug mode.
According to
chromium.googlesource.com/chromiumos/docs/+/master/debug_buttons.md,
we should support debug mode to blink LED while holding
Vol-Up + Vol-Down for ten seconds.
TEST=hold vol-up + vol-down for ten seconds, and see green led blinking.
BUG=b:134654616
BRANCH=master
Change-Id: Ic6cc2f382412a89366a145c0c309e71d98cd8cb7
Signed-off-by: Yilun Lin <yllin@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1654763
Tested-by: Yilun Lin <yllin@chromium.org>
Tested-by: Tony Lin <tonycwlin@google.com>
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Commit-Queue: Yilun Lin <yllin@chromium.org>
Auto-Submit: Yilun Lin <yllin@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/kukui/led.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/board/kukui/led.c b/board/kukui/led.c index 9de4ac0925..2f857f8029 100644 --- a/board/kukui/led.c +++ b/board/kukui/led.c @@ -112,3 +112,24 @@ static void led_second(void) led_reset_auto_control(); } DECLARE_HOOK(HOOK_SECOND, led_second, HOOK_PRIO_DEFAULT); + +__override void led_control(enum ec_led_id led_id, enum ec_led_state state) +{ + uint8_t br[EC_LED_COLOR_COUNT] = { 0 }; + + if ((led_id != EC_LED_ID_RECOVERY_HW_REINIT_LED) && + (led_id != EC_LED_ID_SYSRQ_DEBUG_LED)) + return; + + if (state == LED_STATE_RESET) { + led_reset_auto_control(); + led_auto_control(EC_LED_ID_BATTERY_LED, 1); + return; + } + + if (state) + br[EC_LED_COLOR_GREEN] = 1; + + led_auto_control(EC_LED_ID_BATTERY_LED, 0); + led_set_brightness(EC_LED_ID_BATTERY_LED, br); +} |