diff options
author | Sameer Nanda <snanda@chromium.org> | 2015-01-23 13:51:47 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-01-24 01:46:07 +0000 |
commit | d5a61288137b26c3fa4e52e0eb0ff621ffb36807 (patch) | |
tree | 30d483bda51f0902d79f33a19f0cd3f0a3cbea7d | |
parent | 55e9d8a0c19c8864065d7d09e2ada0e7c27cf414 (diff) | |
download | chrome-ec-d5a61288137b26c3fa4e52e0eb0ff621ffb36807.tar.gz |
samus: Cap the max LED current to 23mA
Samus panels are spec'ed at 23mA max LED current. Limit the max
current to that.
BRANCH=samus
BUG=chrome-os-partner:35816
TEST=The following command should read back the value of 0x4 after
system boot, resume as well as after panel off/on sequence:
ectool --dev=0 i2cread 8 0 0x58 0x11
Signed-off-by: Sameer Nanda <snanda@chromium.org>
Change-Id: I8f94a8bdc987ca5169ca3b6f8236ab7263ee4ef2
Reviewed-on: https://chromium-review.googlesource.com/242971
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Tested-by: Sameer Nanda <snanda@chromium.org>
Commit-Queue: Sameer Nanda <snanda@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
-rw-r--r-- | board/samus/panel.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/board/samus/panel.c b/board/samus/panel.c index dacb0bcf3e..b0cb77a6d5 100644 --- a/board/samus/panel.c +++ b/board/samus/panel.c @@ -19,6 +19,15 @@ #define LP8555_REG_CONFIG 0x10 #define LP8555_REG_CONFIG_MODE_MASK 0x03 #define LP8555_REG_CONFIG_MODE_PWM 0x00 +#define LP8555_REG_CURRENT 0x11 +#define LP8555_REG_CURRENT_MAXCURR_5MA 0x00 +#define LP8555_REG_CURRENT_MAXCURR_10MA 0x01 +#define LP8555_REG_CURRENT_MAXCURR_15MA 0x02 +#define LP8555_REG_CURRENT_MAXCURR_20MA 0x03 +#define LP8555_REG_CURRENT_MAXCURR_23MA 0x04 +#define LP8555_REG_CURRENT_MAXCURR_25MA 0x05 +#define LP8555_REG_CURRENT_MAXCURR_30MA 0x06 +#define LP8555_REG_CURRENT_MAXCURR_50MA 0x07 /** * Enable PWM mode in backlight controller and turn it on. @@ -35,6 +44,10 @@ static void lp8555_enable_pwm_mode(void) i2c_write8(I2C_PORT_BACKLIGHT, I2C_ADDR_BACKLIGHT, LP8555_REG_CONFIG, reg); + /* Set max LED current to 23mA. */ + i2c_write8(I2C_PORT_BACKLIGHT, I2C_ADDR_BACKLIGHT, + LP8555_REG_CURRENT, LP8555_REG_CURRENT_MAXCURR_23MA); + /* Power on. */ i2c_read8(I2C_PORT_BACKLIGHT, I2C_ADDR_BACKLIGHT, LP8555_REG_COMMAND, ®); |