diff options
Diffstat (limited to 'include/keyboard_backlight.h')
-rw-r--r-- | include/keyboard_backlight.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/keyboard_backlight.h b/include/keyboard_backlight.h index 194bec66f4..cf68805235 100644 --- a/include/keyboard_backlight.h +++ b/include/keyboard_backlight.h @@ -1,4 +1,4 @@ -/* Copyright 2018 The Chromium OS Authors. All rights reserved. +/* Copyright 2018 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -94,4 +94,16 @@ int kblight_register(const struct kblight_drv *drv); extern const struct kblight_drv kblight_pwm; +#ifdef TEST_BUILD +/** + * @brief Get internal backlight enabled state. The value reported by + * kblight_get_enabled() can be outdated due to a deferred function call + * being required to update it. Using this function in tests improves + * reliability and reduces the need to sleep. + * + * @return uint8_t 0 if disabled, 1 otherwise. + */ +uint8_t kblight_get_current_enable(void); +#endif /* TEST_BUILD */ + #endif /* __CROS_EC_KEYBOARD_BACKLIGHT_H */ |