diff options
author | reno.wang <reno.wang@lcfc.corp-partner.google.com> | 2021-03-06 04:19:44 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-03 04:46:32 +0000 |
commit | 86a4ca10a8c74b175417ae3a38aff4e4097ed97c (patch) | |
tree | 702bbaf6a568cf0a20eff00c6985ad9d3f31b9ba /board/lindar/board.c | |
parent | d22b997a5317e4b1f921fb203b306b8586943c87 (diff) | |
download | chrome-ec-86a4ca10a8c74b175417ae3a38aff4e4097ed97c.tar.gz |
Lindar: Lindar's lightbar support in S0ix/S3
1. Lid is closed, lightbar keep off
2. Lid is opened, its behavior follow below.
AC+Battery < 20%, lightbar solid 2 amber led on.
AC+Battery < 40%, lightbar solid 4 amber led on.
AC+Battery < 60%, lightbar solid 6 amber led on.
AC+Battery < 80%, lightbar solid 8 amber led on.
AC+Battery < 97%, lightbar solid 10 amber led on.
AC+Battery >= 97%, lightbar solid 10 green led on.
Battery only >= 15%, lightbar keep off.
Battery low < 15%, lightbar blink amber color, 1s on, 5s off.
3. Some SKU un-support lightbar, and shouldn't run lightbar task.
4. Lightbar is powered by PP3300_A, and shouldn't run it in S4/S5/G3.
5. Add debounce time for lightbar state change.
BUG=b:174133147
BRANCH=volteer
TEST=make buildall, test lightbar behavior in S0ix/S3.
Signed-off-by: reno.wang <reno.wang@lcfc.corp-partner.google.com>
Change-Id: Ibbdc17627f7b2d1b2abbbad23b6c06024455e66b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2739008
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'board/lindar/board.c')
-rw-r--r-- | board/lindar/board.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/board/lindar/board.c b/board/lindar/board.c index c65421b08b..57d9fdeb14 100644 --- a/board/lindar/board.c +++ b/board/lindar/board.c @@ -91,6 +91,18 @@ static void board_init(void) } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); +int board_is_i2c_port_powered(int port) +{ + if (port != I2C_PORT_LIGHTBAR) + return 1; + + /* + * Lightbar rails are off in S5/G3 + * Refer CL-2739008. + */ + return chipset_in_state(CHIPSET_STATE_ANY_OFF) ? 0 : 1; +} + int board_is_lid_angle_tablet_mode(void) { return ec_cfg_has_tabletmode(); |