diff options
author | Yilun Lin <yllin@google.com> | 2018-07-12 17:00:17 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-07-12 11:35:42 -0700 |
commit | 37ff3e662aacfbe796ee4e93771d25acde56aa7f (patch) | |
tree | b4d1475797e3659f56eeeae28a18c44e3106095b /driver/charger/rt946x.c | |
parent | 4e0c9a26fe5024145d07c00790a93a892b34a12c (diff) | |
download | chrome-ec-37ff3e662aacfbe796ee4e93771d25acde56aa7f.tar.gz |
charger/mt6370: Fix led_set_color enables wrong LED.
The index of LED enable bit in the register is counting from
the MSB.
BRANCH=None
TEST=mt6370_led_set_color() on EVB, checks the LED flash accordingly.
BUG=b:80160408
Change-Id: I9c748b5f91a62746adaeab59899cd0222305e06b
Signed-off-by: Yilun Lin <yllin@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1134927
Commit-Ready: Yilun Lin <yllin@chromium.org>
Tested-by: Yilun Lin <yllin@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'driver/charger/rt946x.c')
-rw-r--r-- | driver/charger/rt946x.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/driver/charger/rt946x.c b/driver/charger/rt946x.c index d7dcbf82a6..a6cf203a34 100644 --- a/driver/charger/rt946x.c +++ b/driver/charger/rt946x.c @@ -1007,7 +1007,7 @@ int mt6370_led_set_color(enum mt6370_led_index index) if (index == MT6370_LED_ID_OFF) val = 0; else - val = 1 << (MT6370_SHIFT_RGB_ISNKDIM_BASE + index); + val = 1 << (MT6370_SHIFT_RGB_ISNKDIM_BASE - index); rt946x_update_bits(MT6370_REG_RGBEN, MT6370_MASK_RGB_ISNK_ALL_EN, val); return EC_SUCCESS; |