diff options
author | Furquan Shaikh <furquan@chromium.org> | 2017-04-26 22:47:36 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-05-02 17:45:16 -0700 |
commit | 2bb9aec01aded925b726f7b18a66cdad181ac8db (patch) | |
tree | 45f9846c6ad8839d346967fe6450964fa435b9cb /include | |
parent | 5bc66e29950cb57cc545f571d5111cbce1fec0da (diff) | |
download | chrome-ec-2bb9aec01aded925b726f7b18a66cdad181ac8db.tar.gz |
common/led_common: Add API for controlling LED state
1. Provide led_control API that can be used by different drivers to
control the state of LED (0=off, 1=on, 2=reset)
2. Add a new LED ID for recovery HW_REINIT indication.
BUG=b:37682514
BRANCH=None
TEST=make -j buildall
Change-Id: I27334bde2b879046746456a610208f3fc2dd68b4
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/487840
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/ec_commands.h | 2 | ||||
-rw-r--r-- | include/led_common.h | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index b837c6dc75..92d25945e4 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -1720,6 +1720,8 @@ enum ec_led_id { EC_LED_ID_LEFT_LED, /* LED to indicate right side */ EC_LED_ID_RIGHT_LED, + /* LED to indicate recovery mode with HW_REINIT */ + EC_LED_ID_RECOVERY_HW_REINIT_LED, EC_LED_ID_COUNT }; diff --git a/include/led_common.h b/include/led_common.h index 964ad3bf02..e86ed5b39c 100644 --- a/include/led_common.h +++ b/include/led_common.h @@ -67,4 +67,20 @@ int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness); * */ void led_enable(int enable); + +enum ec_led_state { + LED_STATE_OFF = 0, + LED_STATE_ON = 1, + LED_STATE_RESET = 2, +}; + +/** + * Control state of LED. + * + * @param led_id ID of LED to control + * @param state 0=off, 1=on, 2=reset to default + * + */ +void led_control(enum ec_led_id id, enum ec_led_state state); + #endif /* __CROS_EC_LED_COMMON_H */ |