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 /baseboard | |
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 'baseboard')
-rw-r--r-- | baseboard/hatch/baseboard.c | 17 | ||||
-rw-r--r-- | baseboard/hatch/baseboard.h | 6 |
2 files changed, 22 insertions, 1 deletions
diff --git a/baseboard/hatch/baseboard.c b/baseboard/hatch/baseboard.c index 326e1eb036..f1932989f2 100644 --- a/baseboard/hatch/baseboard.c +++ b/baseboard/hatch/baseboard.c @@ -10,6 +10,7 @@ #include "charge_state_v2.h" #include "chipset.h" #include "console.h" +#include "driver/bc12/pi3usb9201.h" #include "driver/ppc/sn5s330.h" #include "driver/tcpm/anx7447.h" #include "driver/tcpm/ps8xxx.h" @@ -188,6 +189,18 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = { } }; +const struct pi3usb2901_config_t pi3usb2901_bc12_chips[] = { + [USB_PD_PORT_TCPC_0] = { + .i2c_port = I2C_PORT_PPC0, + .i2c_addr = PI3USB9201_I2C_ADDR_3, + }, + + [USB_PD_PORT_TCPC_1] = { + .i2c_port = I2C_PORT_TCPC1, + .i2c_addr = PI3USB9201_I2C_ADDR_3, + }, +}; + /* GPIO to enable/disable the USB Type-A port. */ const int usb_port_enable[CONFIG_USB_PORT_POWER_SMART_PORT_COUNT] = { GPIO_EN_USB_A_5V, @@ -207,6 +220,10 @@ void baseboard_tcpc_init(void) /* Enable HDMI HPD interrupt. */ gpio_enable_interrupt(GPIO_HDMI_CONN_HPD); + + /* Enable BC 1.2 interrupts */ + gpio_enable_interrupt(GPIO_USB_C0_BC12_INT_ODL); + gpio_enable_interrupt(GPIO_USB_C1_BC12_INT_ODL); } DECLARE_HOOK(HOOK_INIT, baseboard_tcpc_init, HOOK_PRIO_INIT_I2C + 1); diff --git a/baseboard/hatch/baseboard.h b/baseboard/hatch/baseboard.h index bab9147ae0..9095973e1e 100644 --- a/baseboard/hatch/baseboard.h +++ b/baseboard/hatch/baseboard.h @@ -49,7 +49,7 @@ /* Common charger defines */ #define CONFIG_CHARGE_MANAGER -/* #define CONFIG_CHARGE_RAMP_HW */ +#define CONFIG_CHARGE_RAMP_HW #define CONFIG_CHARGER #define CONFIG_CHARGER_BQ25710 #define CONFIG_CHARGER_DISCHARGE_ON_AC @@ -98,6 +98,10 @@ #define CONFIG_CMD_PD_CONTROL #define CONFIG_CMD_PPC_DUMP +/* BC 1.2 */ +#define CONFIG_USB_CHARGER +#define CONFIG_BC12_DETECT_PI3USB9201 + /* USB Type A Features */ #define CONFIG_USB_PORT_POWER_SMART #undef CONFIG_USB_PORT_POWER_SMART_PORT_COUNT |