diff options
author | Rob Barnes <robbarnes@google.com> | 2021-01-05 13:33:27 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-08 21:21:03 +0000 |
commit | 01a4fc5e60405d348cad489c677a22431a2ed605 (patch) | |
tree | d1dd58456654565cdec9ad2f0e71b5cdcb96df00 /baseboard | |
parent | 6798fb493dbec19cf25775bad2ddbcdde9a13211 (diff) | |
download | chrome-ec-01a4fc5e60405d348cad489c677a22431a2ed605.tar.gz |
guybrush: a0z1380 set vbus_source_current_limit
Fill in vbus_source_current_limit stub.
Add missing io expander configuration.
BUG=None
BRANCH=None
TEST=Build
Signed-off-by: Rob Barnes <robbarnes@google.com>
Change-Id: I2e196333ad607297e33a72b64839f5485e42f909
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2611818
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r-- | baseboard/guybrush/baseboard.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/baseboard/guybrush/baseboard.c b/baseboard/guybrush/baseboard.c index 7457e16666..3a7c9a751d 100644 --- a/baseboard/guybrush/baseboard.c +++ b/baseboard/guybrush/baseboard.c @@ -19,6 +19,7 @@ #include "driver/tcpm/nct38xx.h" #include "gpio.h" #include "i2c.h" +#include "ioexpander.h" #include "isl9241.h" #include "nct38xx.h" #include "pi3usb9201.h" @@ -359,6 +360,22 @@ struct usb_mux usb_muxes[] = { }; BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT); +struct ioexpander_config_t ioex_config[] = { + [USBC_PORT_C0] = { + .i2c_host_port = I2C_PORT_TCPC0, + .i2c_slave_addr = NCT38XX_I2C_ADDR1_1_FLAGS, + .drv = &nct38xx_ioexpander_drv, + }, + [USBC_PORT_C1] = { + .i2c_host_port = I2C_PORT_TCPC1, + .i2c_slave_addr = NCT38XX_I2C_ADDR1_1_FLAGS, + .drv = &nct38xx_ioexpander_drv, + }, +}; +BUILD_ASSERT(ARRAY_SIZE(ioex_config) == USBC_PORT_COUNT); +BUILD_ASSERT(CONFIG_IO_EXPANDER_PORT_COUNT == USBC_PORT_COUNT); + + int board_set_active_charge_port(int port) { @@ -389,8 +406,13 @@ int board_is_i2c_port_powered(int port) int board_aoz1380_set_vbus_source_current_limit(int port, enum tcpc_rp_value rp) { - /* TODO */ - return 0; + int rv; + + /* Use the TCPC to set the current limit */ + rv = ioex_set_level(IOEX_USB_C0_PPC_ILIM_3A_EN, + (rp == TYPEC_RP_3A0) ? 1 : 0); + + return rv; } void board_set_charge_limit(int port, int supplier, int charge_ma, |