diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2022-06-07 18:29:45 +0000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-06-08 23:49:04 +0000 |
commit | 74215f789c53e835461de7499155be39a7530163 (patch) | |
tree | 8751ce6280c338bbc01043d5a50abbd1821defc0 | |
parent | 8a7f9bb026ff1468ab435b4b3b7d02314d2d2d73 (diff) | |
download | chrome-ec-74215f789c53e835461de7499155be39a7530163.tar.gz |
kblight: Initialize on AP startup
This patch makes keyboard backlight module initialize on chipset startup
instead of on reset. This will prevent LED drivers from being accessed
before they're powered.
BUG=b:233323599
BRANCH=None
TEST=Taniks
Change-Id: Ia57acdd57663c7bfa0dc3117cbc9ab6191d34c45
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3693054
Reviewed-by: Parth Malkan <parthmalkan@google.com>
Tested-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com>
-rw-r--r-- | common/keyboard_backlight.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/common/keyboard_backlight.c b/common/keyboard_backlight.c index 8cf400dc34..ef72e93fc8 100644 --- a/common/keyboard_backlight.c +++ b/common/keyboard_backlight.c @@ -113,7 +113,13 @@ static void keyboard_backlight_init(void) /* Don't leave kblight enable state undetermined */ kblight_enable(0); } +#ifdef HAS_TASK_CHIPSET +/* We're running on a system EC. Initialize kblight once per AP start-up. */ +DECLARE_HOOK(HOOK_CHIPSET_STARTUP, keyboard_backlight_init, HOOK_PRIO_DEFAULT); +#else +/* We're running on a KBMCU thus powered when AP starts. Do init on reset. */ DECLARE_HOOK(HOOK_INIT, keyboard_backlight_init, HOOK_PRIO_DEFAULT); +#endif #ifdef HAS_TASK_CHIPSET static void kblight_suspend(void) |