diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2018-05-10 12:38:06 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-05-11 12:10:44 -0700 |
commit | 344e8220b51261e17381af77bc2248ea83233ef0 (patch) | |
tree | ba6888ca481bfc899abcb842bc776099804349af /driver/led/lm3509.c | |
parent | 94b4c511a6a5f185bce14d30731f165c4c48d752 (diff) | |
download | chrome-ec-344e8220b51261e17381af77bc2248ea83233ef0.tar.gz |
lm3509: Avoid setting brightness to 100% on power-up
This patch makes lm3509 avoid setting the LED brightness to 100% on
power-up. It removes brighness control from lm3509_power entirely.
The brightness is controlled by the OS.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=b:78360907
BRANCH=none
TEST=Verify keyboard backlight turn on off on Nami as expected. No
flashing on start-up or resume is observed.
Change-Id: Ife82c83501d57aeb540acb1cccb95597fd1d19a0
Reviewed-on: https://chromium-review.googlesource.com/1054408
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'driver/led/lm3509.c')
-rw-r--r-- | driver/led/lm3509.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/driver/led/lm3509.c b/driver/led/lm3509.c index 4f5a911da4..11cacc6251 100644 --- a/driver/led/lm3509.c +++ b/driver/led/lm3509.c @@ -47,29 +47,9 @@ static int brightness_to_bmain(int percent) static int lm3509_power(int enable) { - int ret = 0; - uint8_t gp = 0, bmain = 0; - - if (enable) { - /* - * [2]= set both main and secondary current same - * both control by BMAIN. - * [1]= enable secondary current sink. - * [0]= enable main current sink. - */ - gp = 0x07; - /* - * Brightness register - * 0x00= 0% - * 0x1F= 100% - */ - bmain = ARRAY_SIZE(lm3509_brightness) - 1; - } - - ret |= lm3509_write(LM3509_REG_GP, gp); - ret |= lm3509_write(LM3509_REG_BMAIN, bmain); - - return ret; + /* Enable both MAIN and SUB in unison mode. + * Don't alter brightness here. It's not driver's business. */ + return lm3509_write(LM3509_REG_GP, enable ? 0x7 : 0); } static int lm3509_set_brightness(int percent) |