summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjerry2.huang <jerry2.huang@lcfc.corp-partner.google.com>2020-10-07 18:22:01 +0800
committerCommit Bot <commit-bot@chromium.org>2020-10-08 06:32:03 +0000
commit4a8bef2e93e435d7f3fd9591139250718d5a4026 (patch)
tree117c466771db9bcf9666b166ff60e5cec325f176
parent44f69459ded7bd93933a660c1f216f1ad0ae443e (diff)
downloadchrome-ec-4a8bef2e93e435d7f3fd9591139250718d5a4026.tar.gz
boten: enable stylus charging
boten has garage stylus, this patch enables stylus charging when stylus present. BUG=b:155615390 BRANCH=none TEST=make buildall -j Signed-off-by: jerry2.huang <jerry2.huang@lcfc.corp-partner.google.com> Change-Id: I601bb9c746774f3a410f83f322706ef4fb225830 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2455786 Reviewed-by: Justin TerAvest <teravest@chromium.org>
-rw-r--r--board/boten/board.c9
-rw-r--r--board/boten/gpio.inc2
2 files changed, 10 insertions, 1 deletions
diff --git a/board/boten/board.c b/board/boten/board.c
index bf7fdb17bf..edfff35f4e 100644
--- a/board/boten/board.c
+++ b/board/boten/board.c
@@ -62,6 +62,13 @@ static void c0_ccsbu_ovp_interrupt(enum gpio_signal s)
pd_handle_cc_overvoltage(0);
}
+static void pen_detect_interrupt(enum gpio_signal s)
+{
+ int pen_detect = !gpio_get_level(GPIO_PEN_DET_ODL);
+
+ gpio_set_level(GPIO_EN_PP5000_PEN, pen_detect);
+}
+
/* Must come after other header files and interrupt handler declarations */
#include "gpio_list.h"
@@ -146,6 +153,8 @@ void board_init(void)
/* Enable gpio interrupt for base accelgyro sensor */
gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L);
gpio_enable_interrupt(GPIO_HDMI_HPD_SUB_ODL);
+ /* Enable gpio interrupt for pen detect */
+ gpio_enable_interrupt(GPIO_PEN_DET_ODL);
gpio_set_level(GPIO_HDMI_EN_SUB_ODL, 0);
diff --git a/board/boten/gpio.inc b/board/boten/gpio.inc
index d355338bee..a159a38940 100644
--- a/board/boten/gpio.inc
+++ b/board/boten/gpio.inc
@@ -99,7 +99,7 @@ GPIO(EN_BL_OD, PIN(K, 4), GPIO_OUT_LOW)
GPIO(EC_ENTERING_RW, PIN(G, 0), GPIO_OUT_LOW)
GPIO(CCD_MODE_ODL, PIN(H, 5), GPIO_INPUT)
GPIO(EC_BATTERY_PRES_ODL, PIN(I, 4), GPIO_INPUT)
-GPIO(PEN_DET_ODL, PIN(J, 1), GPIO_INPUT | GPIO_PULL_UP)
+GPIO_INT(PEN_DET_ODL, PIN(J, 1), GPIO_INT_BOTH | GPIO_PULL_UP, pen_detect_interrupt)
GPIO(EN_PP5000_PEN, PIN(B, 5), GPIO_OUT_LOW)
GPIO(EN_KB_BL, PIN(J, 3), GPIO_OUT_LOW) /* Currently unused */
GPIO(ECH1_PACKET_MODE, PIN(H, 1), GPIO_OUT_LOW)