diff options
author | arthur.lin <arthur.lin@lcfc.corp-partner.google.com> | 2021-08-13 15:51:50 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-13 17:46:12 +0000 |
commit | a20abd22d42672e253c0378fcf4e159273234cbd (patch) | |
tree | 91ff70a32932b0a388614ba97d3b002ffae1bfda | |
parent | d6c1636bb32c73a2b0f024db8a220def90043426 (diff) | |
download | chrome-ec-a20abd22d42672e253c0378fcf4e159273234cbd.tar.gz |
boten: Check pen detection on init
The Pen detection is detecting by interrupt. However, it will
miss the event on init if stylus already into garage. This patch
adds checking pen detection on init.
BRANCH=dedede
BUG=b:196258408
TEST=make buildall -j
On Boten, Resume from battery cutoff or EC hibernate.
Make sure stylus is charging.
Signed-off-by: arthur.lin <arthur.lin@lcfc.corp-partner.google.com>
Change-Id: Ie74f4c391d658c7b9fd886267b62d21a99de77df
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3093652
Reviewed-by: Diana Z <dzigterman@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r-- | board/boten/board.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/board/boten/board.c b/board/boten/board.c index 6bddbc86a7..b6301834bf 100644 --- a/board/boten/board.c +++ b/board/boten/board.c @@ -226,6 +226,13 @@ void board_init(void) /* Enable gpio interrupt for pen detect */ gpio_enable_interrupt(GPIO_PEN_DET_ODL); + /* Make sure pen detection is triggered or not at sysjump */ + if (!gpio_get_level(GPIO_PEN_DET_ODL)) + gpio_set_level(GPIO_EN_PP5000_PEN, 1); + + if (gpio_get_level(GPIO_PEN_DET_ODL)) + gpio_set_level(GPIO_PEN_DET_PCH, 1); + /* Set LEDs luminance */ pwm_set_duty(PWM_CH_LED_RED, 70); pwm_set_duty(PWM_CH_LED_GREEN, 70); |