diff options
author | Scott Collyer <scollyer@google.com> | 2019-02-05 17:42:32 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-02-19 22:15:19 -0800 |
commit | 3e9fe80cd030bd72d831f763f2ac873fe3f4c339 (patch) | |
tree | a8560ac71a800c9008a4ff5bc3186436cd927036 /board/hatch/board.c | |
parent | 3e8588095bb0dda2aabc11fd7439083c073953f3 (diff) | |
download | chrome-ec-3e9fe80cd030bd72d831f763f2ac873fe3f4c339.tar.gz |
hatch: Enable bc1.2 support
This CL adds the config options and GPIO signals and interrupt handler
required for bc1.2 for the pi3usb8201 chip.
BUG=b:123995100
BRANCH=none
TEST=Verified that bc1.2 detection occurs following connecting a charger
and a EC reboot. Verified that the D+/D- switches are closed in both
client and host mode as expected.
Change-Id: I43ca74f02d2515dc4dfa3dd8dc689d719779e4b5
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1459822
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'board/hatch/board.c')
-rw-r--r-- | board/hatch/board.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/board/hatch/board.c b/board/hatch/board.c index 21ff639892..9bac034d31 100644 --- a/board/hatch/board.c +++ b/board/hatch/board.c @@ -24,10 +24,12 @@ #include "spi.h" #include "switch.h" #include "system.h" +#include "task.h" #include "temp_sensor.h" #include "thermal.h" #include "thermistor.h" #include "uart.h" +#include "usb_charge.h" #include "usb_pd.h" #include "usbc_ppc.h" #include "util.h" @@ -74,6 +76,22 @@ static void hdmi_hpd_interrupt(enum gpio_signal signal) baseboard_mst_enable_control(MST_HDMI, gpio_get_level(signal)); } +static void bc12_interrupt(enum gpio_signal signal) +{ + switch (signal) { + case GPIO_USB_C0_BC12_INT_ODL: + task_set_event(TASK_ID_USB_CHG_P0, USB_CHG_EVENT_BC12, 0); + break; + + case GPIO_USB_C1_BC12_INT_ODL: + task_set_event(TASK_ID_USB_CHG_P1, USB_CHG_EVENT_BC12, 0); + break; + + default: + break; + } +} + #include "gpio_list.h" /* Must come after other header files. */ /******************************************************************************/ |