diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2019-02-04 10:30:54 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-02-09 03:14:26 -0800 |
commit | a012cf8d31667b213f6bd49dd4447b5a3061be79 (patch) | |
tree | e3c06c8e52c9ee734e7cdb7736714a454ee1d660 /driver/charger/rt946x.h | |
parent | 6ea830328941f24fc01213030c8ab8865ac4a2f1 (diff) | |
download | chrome-ec-a012cf8d31667b213f6bd49dd4447b5a3061be79.tar.gz |
RT946x: Make mt6370_led_set_color accept composite colors
Currently, mt6370_led_set_color can handle only simple colors. That
is, if a green LED is turned on, other LEDs are forced to be off.
To allow composite colors (e.g. red+green), this change makes
mt6370_led_set_color control LEDs independently. For example, to mix
green and red, it can be called as
mt6370_led_set_color(LED_MASK_GREEN | LED_MASK_RED);
This is consistent with other RT946x LED APIs in the sense that they
also control each LED independently.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=b/123613083
BRANCH=none
TEST=Verify LED behavior doesn't change on Kukui by console command
Change-Id: Idb80a124462b30adca6af86621aed136be8caa99
Reviewed-on: https://chromium-review.googlesource.com/1452617
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'driver/charger/rt946x.h')
-rw-r--r-- | driver/charger/rt946x.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/driver/charger/rt946x.h b/driver/charger/rt946x.h index 21ce65536b..9f1d682901 100644 --- a/driver/charger/rt946x.h +++ b/driver/charger/rt946x.h @@ -566,8 +566,14 @@ enum mt6370_led_pwm_freq { /* Set LED brightness */ int mt6370_led_set_brightness(enum mt6370_led_index index, uint8_t brightness); -/* Set LED Color */ -int mt6370_led_set_color(enum mt6370_led_index index); +/** + * Set LED Color + * + * mask: Bitmap indicating 1=on 0=off for each LED. 000 = all off. + * Combination of MT6370_MASK_RGB_ISNK1/2/3DIM_EN. + * return: EC_SUCCESS or EC_ERROR_* on error. + */ +int mt6370_led_set_color(uint8_t mask); /* Set LED dim mode, available modes: REGISTER, PWM, BREATH. */ int mt6370_led_set_dim_mode(enum mt6370_led_index index, |