diff options
author | Devin Lu <devin.lu@quantatw.com> | 2020-09-07 17:10:17 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-10 08:10:12 +0000 |
commit | 7209c81795193151d99b2f9bd50a9668b036e0c2 (patch) | |
tree | 8fcf9b67204ab45066260052e0b247a5c4dcc8fa /board | |
parent | 657a488ed43cec7da776e5d2773270e870a7df80 (diff) | |
download | chrome-ec-7209c81795193151d99b2f9bd50a9668b036e0c2.tar.gz |
Meep: Fix triggering condition for PPC interrupt of SYV682A
Apply CL:2309522 to meep.
BUG=none
BRANCH=firmware-octopus-11297.B
TEST=1. make BOARD=meep.
2. Verify USBC charger is able to charging.
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Change-Id: I7407e360bb1521e4a9c5be38111508545a970733
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2396095
Reviewed-by: Marco Chen <marcochen@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/meep/board.c | 32 | ||||
-rw-r--r-- | board/meep/board.h | 1 |
2 files changed, 23 insertions, 10 deletions
diff --git a/board/meep/board.c b/board/meep/board.c index 01b4d0f089..51327cd78b 100644 --- a/board/meep/board.c +++ b/board/meep/board.c @@ -365,13 +365,13 @@ __override uint16_t board_get_ps8xxx_product_id(int port) } } -const struct ppc_config_t ppc_syv682x_port0 = { +static const struct ppc_config_t ppc_syv682x_port0 = { .i2c_port = I2C_PORT_TCPC0, .i2c_addr_flags = SYV682X_ADDR0_FLAGS, .drv = &syv682x_drv, }; -const struct ppc_config_t ppc_syv682x_port1 = { +static const struct ppc_config_t ppc_syv682x_port1 = { .i2c_port = I2C_PORT_TCPC1, .i2c_addr_flags = SYV682X_ADDR0_FLAGS, .drv = &syv682x_drv, @@ -379,13 +379,25 @@ const struct ppc_config_t ppc_syv682x_port1 = { static void board_setup_ppc(void) { - if (support_syv_ppc) { - memcpy(&ppc_chips[USB_PD_PORT_TCPC_0], - &ppc_syv682x_port0, - sizeof(struct ppc_config_t)); - memcpy(&ppc_chips[USB_PD_PORT_TCPC_1], - &ppc_syv682x_port1, - sizeof(struct ppc_config_t)); - } + if (!support_syv_ppc) + return; + + memcpy(&ppc_chips[USB_PD_PORT_TCPC_0], + &ppc_syv682x_port0, + sizeof(struct ppc_config_t)); + memcpy(&ppc_chips[USB_PD_PORT_TCPC_1], + &ppc_syv682x_port1, + sizeof(struct ppc_config_t)); + + gpio_set_flags(GPIO_USB_PD_C0_INT_ODL, GPIO_INT_BOTH); + gpio_set_flags(GPIO_USB_PD_C1_INT_ODL, GPIO_INT_BOTH); } DECLARE_HOOK(HOOK_INIT, board_setup_ppc, HOOK_PRIO_INIT_I2C + 2); + +int ppc_get_alert_status(int port) +{ + if (port == 0) + return gpio_get_level(GPIO_USB_PD_C0_INT_ODL) == 0; + + return gpio_get_level(GPIO_USB_PD_C1_INT_ODL) == 0; +} diff --git a/board/meep/board.h b/board/meep/board.h index c0e33b1b58..be7ce9158a 100644 --- a/board/meep/board.h +++ b/board/meep/board.h @@ -53,6 +53,7 @@ /* Additional PPC second source */ #define CONFIG_USBC_PPC_SYV682X +#define CONFIG_USBC_PPC_DEDICATED_INT /* Additional TCPC second source in Port 1 */ #define CONFIG_USB_PD_TCPM_MULTI_PS8XXX |