diff options
author | Ting Shen <phoenixshen@google.com> | 2020-09-09 17:16:37 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-15 08:26:50 +0000 |
commit | 64013cb81d3f27908cfbca0d814008f32f7dae54 (patch) | |
tree | 7ceab5222f35b821ea3b2e16754e7037350e18fa /driver/bc12 | |
parent | 889b52a87e471615ba908246317ef6a502b70160 (diff) | |
download | chrome-ec-64013cb81d3f27908cfbca0d814008f32f7dae54.tar.gz |
asurada: rev1: update led control
Implemented manual led control according to b/167941026 comment#3.
BUG=b:167941026
TEST=ectool led left/right/power/battery amber/white
BRANCH=none
Signed-off-by: Ting Shen <phoenixshen@google.com>
Change-Id: Ic2bfbdc3e5c65420c96a807ba983d63a7fcebb63
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2400798
Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Tested-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'driver/bc12')
-rw-r--r-- | driver/bc12/mt6360.c | 7 | ||||
-rw-r--r-- | driver/bc12/mt6360.h | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/driver/bc12/mt6360.c b/driver/bc12/mt6360.c index 49de200f52..a5b5ceb487 100644 --- a/driver/bc12/mt6360.c +++ b/driver/bc12/mt6360.c @@ -399,6 +399,13 @@ int mt6360_ldo_get_voltage(enum mt6360_ldo_id ldo_id, int *voltage_mv) } /* RGB LED */ +void mt6360_led_init(void) +{ + /* Enable LED1 software mode */ + mt6360_set_bit(MT6360_REG_RGB_EN, MT6360_ISINK1_CHRIND_EN_SEL); +} +DECLARE_HOOK(HOOK_INIT, mt6360_led_init, HOOK_PRIO_DEFAULT); + int mt6360_led_enable(enum mt6360_led_id led_id, int enable) { if (!IN_RANGE(led_id, 0, MT6360_LED_COUNT)) diff --git a/driver/bc12/mt6360.h b/driver/bc12/mt6360.h index aa370b4e48..a51baee694 100644 --- a/driver/bc12/mt6360.h +++ b/driver/bc12/mt6360.h @@ -23,6 +23,7 @@ #define MT6360_REG_RGB_EN 0x80 #define MT6360_MASK_ISINK_EN(x) BIT(7 - (x)) +#define MT6360_ISINK1_CHRIND_EN_SEL BIT(3) #define MT6360_REG_RGB_ISINK(x) (0x81 + (x)) #define MT6360_MASK_CUR_SEL 0xF @@ -82,6 +83,8 @@ enum mt6360_led_id { MT6360_LED_COUNT, }; +#define MT6360_LED_BRIGHTNESS_MAX 15 + struct mt6360_config_t { int i2c_port; int i2c_addr_flags; |