summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2019-10-02 16:34:32 +0800
committerCommit Bot <commit-bot@chromium.org>2019-10-03 07:09:55 +0000
commited8fc57175bce247f84476b972d781301001b7bf (patch)
tree0b1ef659cf6aeed3079019d1ca700f003e372c3e /board
parent43e89bafd85ac2c101a2bc68d08d39a1cef19734 (diff)
downloadchrome-ec-ed8fc57175bce247f84476b972d781301001b7bf.tar.gz
jacuzzi: enable bc12 interrupt
BUG=b:141600087 TEST=make sure usb charge task receives USB_CHG_EVENT_BC12 event, and ec console prints "sts = 0x2, lim = 2400 mA, supplier = 6" BRANCH=master Change-Id: I3f654edc38792a71b33975db5de0577bc52e8f35 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1833945 Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/jacuzzi/board.c8
-rw-r--r--board/jacuzzi/board.h1
-rw-r--r--board/jacuzzi/gpio.inc3
3 files changed, 11 insertions, 1 deletions
diff --git a/board/jacuzzi/board.c b/board/jacuzzi/board.c
index 83e56827da..78973eba95 100644
--- a/board/jacuzzi/board.c
+++ b/board/jacuzzi/board.c
@@ -200,6 +200,11 @@ int pd_snk_is_vbus_provided(int port)
return EC_ERROR_UNIMPLEMENTED;
}
+void bc12_interrupt(enum gpio_signal signal)
+{
+ task_set_event(TASK_ID_USB_CHG_P0, USB_CHG_EVENT_BC12, 0);
+}
+
static void board_init(void)
{
/* If the reset cause is external, pulse PMIC force reset. */
@@ -222,6 +227,9 @@ static void board_init(void)
/* Enable interrupt from PMIC. */
gpio_enable_interrupt(GPIO_PMIC_EC_RESETB);
+
+ /* Enable BC12 interrupt */
+ gpio_enable_interrupt(GPIO_BC12_EC_INT_ODL);
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
diff --git a/board/jacuzzi/board.h b/board/jacuzzi/board.h
index 6f7d5f4a35..fdb6e308f1 100644
--- a/board/jacuzzi/board.h
+++ b/board/jacuzzi/board.h
@@ -122,6 +122,7 @@ enum battery_type {
void emmc_cmd_interrupt(enum gpio_signal signal);
#endif
+void bc12_interrupt(enum gpio_signal signal);
void board_reset_pd_mcu(void);
int board_get_version(void);
int board_is_sourcing_vbus(int port);
diff --git a/board/jacuzzi/gpio.inc b/board/jacuzzi/gpio.inc
index 02bc372dfb..84c828841b 100644
--- a/board/jacuzzi/gpio.inc
+++ b/board/jacuzzi/gpio.inc
@@ -31,10 +31,11 @@ GPIO_INT(LID_OPEN, PIN(C, 5), GPIO_INT_BOTH,
lid_interrupt)
GPIO_INT(AC_PRESENT, PIN(A, 6), GPIO_INT_BOTH,
extpower_interrupt) /* ACOK_OD */
+GPIO_INT(BC12_EC_INT_ODL, PIN(C, 9), GPIO_INT_FALLING,
+ bc12_interrupt)
/* Unimplemented interrupts */
GPIO(KB_INT_ODL, PIN(A, 8), GPIO_INPUT)
-GPIO(BC12_EC_INT_ODL, PIN(C, 9), GPIO_INPUT)
GPIO(ALS_RGB_INT_ODL, PIN(C, 10), GPIO_INPUT)
GPIO(TABLET_MODE_L, PIN(B, 11), GPIO_INPUT)
GPIO(LID_ACCEL_INT_ODL, PIN(A, 14), GPIO_INPUT)