summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarthur.lin <arthur.lin@lcfc.corp-partner.google.com>2021-08-26 14:53:26 +0800
committerCommit Bot <commit-bot@chromium.org>2021-08-26 20:21:43 +0000
commita4e7d7caa9c1e31462ba2c126fec3d5f4fb4a314 (patch)
treefeffcc2070637675bd95c0b121e6ae523b74e01d
parenta4848a9b8d549664a8b246805019ce0e7a03e8b3 (diff)
downloadchrome-ec-a4e7d7caa9c1e31462ba2c126fec3d5f4fb4a314.tar.gz
gooey: 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=keeby BUG=None TEST=make buildall -j On Gooey, 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: Ic381faad843c03655f6dd1f7f5a4b2bbfecb3be6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3120769 Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/gooey/board.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/board/gooey/board.c b/board/gooey/board.c
index 401ce167ad..748dea0737 100644
--- a/board/gooey/board.c
+++ b/board/gooey/board.c
@@ -211,6 +211,12 @@ 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);